Skip to content

Commit aa07366

Browse files
authored
perf(heightmap): Reduce cost of min height loop in HeightMapRenderObjClass::updateCenter by 93% (#2077)
1 parent 67f97c5 commit aa07366

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,8 +1677,8 @@ void HeightMapRenderObjClass::updateCenter(CameraClass *camera , RefRenderObjLis
16771677

16781678
Real intersectionZ;
16791679
minHt = m_map->getMaxHeightValue();
1680-
for (i=0; i<m_x; i++) {
1681-
for (j=0; j<m_y; j++) {
1680+
for (j=0; j<m_y; j+=4) {
1681+
for (i=0; i<m_x; i+=4) {
16821682
Short cur = m_map->getDisplayHeight(i,j);
16831683
if (cur<minHt) minHt = cur;
16841684
}

0 commit comments

Comments
 (0)