mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 18:53:52 +00:00
Merge branch 'terrainfix' into graphics
This commit is contained in:
commit
35b5fdab5d
1 changed files with 10 additions and 10 deletions
|
@ -152,16 +152,6 @@ namespace MWRender
|
|||
|
||||
mTerrainGroup.loadTerrain(terrainX, terrainY, true);
|
||||
|
||||
// when loading from a heightmap, Ogre::Terrain does not update the derived data (normal map, LOD)
|
||||
// synchronously, even if we supply synchronous = true parameter to loadTerrain.
|
||||
// the following to be the only way to make sure derived data is ready when rendering the next frame.
|
||||
while (mTerrainGroup.isDerivedDataUpdateInProgress())
|
||||
{
|
||||
// we need to wait for this to finish
|
||||
OGRE_THREAD_SLEEP(5);
|
||||
Root::getSingleton().getWorkQueue()->processResponses();
|
||||
}
|
||||
|
||||
Terrain* terrain = mTerrainGroup.getTerrain(terrainX, terrainY);
|
||||
initTerrainBlendMaps(terrain,
|
||||
cellX, cellY,
|
||||
|
@ -189,6 +179,16 @@ namespace MWRender
|
|||
}
|
||||
}
|
||||
|
||||
// when loading from a heightmap, Ogre::Terrain does not update the derived data (normal map, LOD)
|
||||
// synchronously, even if we supply synchronous = true parameter to loadTerrain.
|
||||
// the following to be the only way to make sure derived data is ready when rendering the next frame.
|
||||
while (mTerrainGroup.isDerivedDataUpdateInProgress())
|
||||
{
|
||||
// we need to wait for this to finish
|
||||
OGRE_THREAD_SLEEP(5);
|
||||
Root::getSingleton().getWorkQueue()->processResponses();
|
||||
}
|
||||
|
||||
mTerrainGroup.freeTemporaryResources();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue