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.
coverity_scan^2
scrawl 8 years ago
parent d141b98f0c
commit 1d8a9ff622

@ -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);

@ -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)

Loading…
Cancel
Save