mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-10 15:45:37 +00:00
Merge branch 'terrainfix' into graphics
This commit is contained in:
commit
bb1f23875d
@ -3,6 +3,7 @@
|
|||||||
#include <OgreTerrain.h>
|
#include <OgreTerrain.h>
|
||||||
#include <OgreTerrainGroup.h>
|
#include <OgreTerrainGroup.h>
|
||||||
#include <OgreHardwarePixelBuffer.h>
|
#include <OgreHardwarePixelBuffer.h>
|
||||||
|
#include <OgreRoot.h>
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
|
||||||
@ -151,6 +152,16 @@ namespace MWRender
|
|||||||
|
|
||||||
mTerrainGroup.loadTerrain(terrainX, terrainY, true);
|
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);
|
Terrain* terrain = mTerrainGroup.getTerrain(terrainX, terrainY);
|
||||||
initTerrainBlendMaps(terrain,
|
initTerrainBlendMaps(terrain,
|
||||||
cellX, cellY,
|
cellX, cellY,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user