From: <kla...@us...> - 2016-06-30 21:13:31
|
Revision: 13709 http://sourceforge.net/p/vegastrike/code/13709 Author: klaussfreire Date: 2016-06-30 21:13:28 +0000 (Thu, 30 Jun 2016) Log Message: ----------- Small profile-guided optimization: avoid handling the heap if the new occluder is going to be excluded anyway (ie: less relevant than the least relevant occluder in a full heap) Modified Paths: -------------- trunk/vegastrike/src/gfx/occlusion.cpp Modified: trunk/vegastrike/src/gfx/occlusion.cpp =================================================================== --- trunk/vegastrike/src/gfx/occlusion.cpp 2016-06-30 21:12:02 UTC (rev 13708) +++ trunk/vegastrike/src/gfx/occlusion.cpp 2016-06-30 21:13:28 UTC (rev 13709) @@ -254,9 +254,11 @@ forced_occluders_set.insert(occHash); } } else { - dynamic_occluders.push(occ); - while (dynamic_occluders.size() > 16) - dynamic_occluders.pop(); + if (dynamic_occluders.size() < 16 || !(dynamic_occluders.top() < occ)) { + dynamic_occluders.push(occ); + while (dynamic_occluders.size() > 16) + dynamic_occluders.pop(); + } } } |