Skip to content

Commit 5deddce

Browse files
authored
bugfix(heightmap): Fix dynamic lights on terrain (#2039)
1 parent 224017e commit 5deddce

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,10 @@ Int HeightMapRenderObjClass::initHeightData(Int x, Int y, WorldHeightMap *pMap,
13871387
//=============================================================================
13881388
// HeightMapRenderObjClass::On_Frame_Update
13891389
//=============================================================================
1390-
/** Updates the diffuse color values in the vertices as affected by the dynamic lights.*/
1390+
// Updates the diffuse color values in the vertices as affected by the dynamic
1391+
// lights.
1392+
// TheSuperHackers @bugfix xezon 15/12/2025 Now draws the dynamic lights
1393+
// properly on the entirety of the drawable map region.
13911394
//=============================================================================
13921395
void HeightMapRenderObjClass::On_Frame_Update(void)
13931396
{
@@ -1418,10 +1421,10 @@ void HeightMapRenderObjClass::On_Frame_Update(void)
14181421
Int numDynaLights=0;
14191422
W3DDynamicLight *enabledLights[MAX_ENABLED_DYNAMIC_LIGHTS];
14201423

1421-
Int yCoordMin = m_map->getDrawOrgY();
1422-
Int yCoordMax = m_y+m_map->getDrawOrgY();
1423-
Int xCoordMin = m_map->getDrawOrgX();
1424-
Int xCoordMax = m_x+m_map->getDrawOrgX();
1424+
const Int xCoordMin = m_map->getDrawOrgX() - m_map->getBorderSizeInline();
1425+
const Int yCoordMin = m_map->getDrawOrgY() - m_map->getBorderSizeInline();
1426+
const Int xCoordMax = xCoordMin + m_map->getDrawWidth();
1427+
const Int yCoordMax = yCoordMin + m_map->getDrawHeight();
14251428

14261429
for (pDynamicLightsIterator.First(); !pDynamicLightsIterator.Is_Done(); pDynamicLightsIterator.Next())
14271430
{

0 commit comments

Comments
 (0)