1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 19:45:40 +00:00

Simplify a funny-written function

This commit is contained in:
jvoisin 2023-05-01 16:36:48 +02:00
parent 83203ae4d9
commit 5299065cad
3 changed files with 4 additions and 17 deletions

View file

@ -403,20 +403,10 @@ namespace MWWorld
mWorkQueue = workQueue; mWorkQueue = workQueue;
} }
bool CellPreloader::syncTerrainLoad( void CellPreloader::syncTerrainLoad(Loading::Listener& listener)
const std::vector<CellPreloader::PositionCellGrid>& positions, double timestamp, Loading::Listener& listener)
{ {
if (!mTerrainPreloadItem) if (mTerrainPreloadItem != nullptr && !mTerrainPreloadItem->isDone())
return true;
else if (mTerrainPreloadItem->isDone())
{
return true;
}
else
{
mTerrainPreloadItem->wait(listener); mTerrainPreloadItem->wait(listener);
return true;
}
} }
void CellPreloader::abortTerrainPreloadExcept(const CellPreloader::PositionCellGrid* exceptPos) void CellPreloader::abortTerrainPreloadExcept(const CellPreloader::PositionCellGrid* exceptPos)

View file

@ -71,8 +71,7 @@ namespace MWWorld
typedef std::pair<osg::Vec3f, osg::Vec4i> PositionCellGrid; typedef std::pair<osg::Vec3f, osg::Vec4i> PositionCellGrid;
void setTerrainPreloadPositions(const std::vector<PositionCellGrid>& positions); void setTerrainPreloadPositions(const std::vector<PositionCellGrid>& positions);
bool syncTerrainLoad(const std::vector<CellPreloader::PositionCellGrid>& positions, double timestamp, void syncTerrainLoad(Loading::Listener& listener);
Loading::Listener& listener);
void abortTerrainPreloadExcept(const PositionCellGrid* exceptPos); void abortTerrainPreloadExcept(const PositionCellGrid* exceptPos);
bool isTerrainLoaded(const CellPreloader::PositionCellGrid& position, double referenceTime) const; bool isTerrainLoaded(const CellPreloader::PositionCellGrid& position, double referenceTime) const;

View file

@ -1218,9 +1218,7 @@ namespace MWWorld
loadingListener->setLabel("#{OMWEngine:InitializingData}"); loadingListener->setLabel("#{OMWEngine:InitializingData}");
while (!mPreloader->syncTerrainLoad(vec, mRendering.getReferenceTime(), *loadingListener)) mPreloader->syncTerrainLoad(*loadingListener);
{
}
} }
void Scene::reloadTerrain() void Scene::reloadTerrain()