Preload player cell as soon as the player is read from the savegame

Giving the worker thread something to do while the rest of the savegame is parsed.
This commit is contained in:
scrawl 2017-02-09 03:47:36 +01:00
parent d141b98f0c
commit 1d8a9ff622
2 changed files with 6 additions and 3 deletions

View file

@ -82,14 +82,14 @@ namespace MWWorld
void preloadExteriorGrid(const osg::Vec3f& playerPos, const osg::Vec3f& predictedPos);
void preloadFastTravelDestinations(const osg::Vec3f& playerPos, const osg::Vec3f& predictedPos);
void preloadCell(MWWorld::CellStore* cell, bool preloadSurrounding=false);
public:
Scene (MWRender::RenderingManager& rendering, MWPhysics::PhysicsSystem *physics);
~Scene();
void preloadCell(MWWorld::CellStore* cell, bool preloadSurrounding=false);
void unloadCell (CellStoreCollection::iterator iter);
void loadCell (CellStore *cell, Loading::Listener* loadingListener, bool respawn);

View file

@ -374,10 +374,13 @@ namespace MWWorld
reader.getHNT(mTeleportEnabled, "TELE");
reader.getHNT(mLevitationEnabled, "LEVT");
return;
case ESM::REC_PLAY:
mPlayer->readRecord(reader, type);
mWorldScene->preloadCell(getPlayerPtr().getCell(), true);
break;
default:
if (!mStore.readRecord (reader, type) &&
!mGlobalVariables.readRecord (reader, type) &&
!mPlayer->readRecord (reader, type) &&
!mWeatherManager->readRecord (reader, type) &&
!mCells.readRecord (reader, type, contentFileMap)
&& !mProjectileManager->readRecord (reader, type)