mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:23:54 +00:00
move mInteriors and mExterior back to World::World
This commit is contained in:
parent
6baf904f0f
commit
3f007d29cc
4 changed files with 22 additions and 7 deletions
|
@ -110,8 +110,8 @@ namespace MWWorld
|
|||
|
||||
if (iter==mActiveCells.end())
|
||||
{
|
||||
mExteriors[std::make_pair (x, y)].loadExt (x, y, mWorld->getStore(), mWorld->getEsmReader());
|
||||
Ptr::CellStore *cell = &mExteriors[std::make_pair (x, y)];
|
||||
mWorld->getExterior(x, y)->loadExt (x, y, mWorld->getStore(), mWorld->getEsmReader());
|
||||
Ptr::CellStore *cell = mWorld->getExterior(x, y);
|
||||
|
||||
loadCell (cell, new MWRender::ExteriorCellRender (*cell, mEnvironment, mScene));
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ namespace MWWorld
|
|||
mCurrentCell = iter->first;
|
||||
|
||||
// adjust player
|
||||
playerCellChange (&mExteriors[std::make_pair (X, Y)], position, adjustPlayerPos);
|
||||
playerCellChange (mWorld->getExterior(X, Y), position, adjustPlayerPos);
|
||||
|
||||
// Sky system
|
||||
mWorld->adjustSky();
|
||||
|
@ -181,8 +181,8 @@ namespace MWWorld
|
|||
|
||||
// Load cell.
|
||||
std::cout << "cellName:" << cellName << std::endl;
|
||||
mInteriors[cellName].loadInt (cellName, mWorld->getStore(), mWorld->getEsmReader());
|
||||
Ptr::CellStore *cell = &mInteriors[cellName];
|
||||
mWorld->getInterior(cellName)->loadInt (cellName, mWorld->getStore(), mWorld->getEsmReader());
|
||||
Ptr::CellStore *cell = mWorld->getInterior(cellName);
|
||||
|
||||
loadCell (cell, new MWRender::InteriorCellRender (*cell, mEnvironment, mScene));
|
||||
|
||||
|
|
|
@ -59,8 +59,6 @@ namespace MWWorld
|
|||
MWRender::MWScene mScene;
|
||||
Ptr::CellStore *mCurrentCell; // the cell, the player is in
|
||||
CellRenderCollection mActiveCells;
|
||||
std::map<std::string, Ptr::CellStore> mInteriors;
|
||||
std::map<std::pair<int, int>, Ptr::CellStore> mExteriors;
|
||||
bool mCellChanged;
|
||||
Environment& mEnvironment;
|
||||
World *mWorld;
|
||||
|
|
|
@ -320,6 +320,16 @@ namespace MWWorld
|
|||
delete mGlobalVariables;
|
||||
delete mWorldScene;
|
||||
}
|
||||
|
||||
Ptr::CellStore *World::getExterior (int x, int y)
|
||||
{
|
||||
return &mExteriors[std::make_pair (x, y)];
|
||||
}
|
||||
|
||||
Ptr::CellStore *World::getInterior (std::string name)
|
||||
{
|
||||
return &mInteriors[name];
|
||||
}
|
||||
|
||||
MWWorld::Player& World::getPlayer()
|
||||
{
|
||||
|
|
|
@ -76,6 +76,9 @@ namespace MWWorld
|
|||
bool mSky;
|
||||
Environment& mEnvironment;
|
||||
int mNextDynamicRecord;
|
||||
|
||||
std::map<std::string, Ptr::CellStore> mInteriors;
|
||||
std::map<std::pair<int, int>, Ptr::CellStore> mExteriors;
|
||||
|
||||
OEngine::Physic::PhysicEngine* mPhysEngine;
|
||||
|
||||
|
@ -99,6 +102,10 @@ namespace MWWorld
|
|||
Environment& environment, const std::string& encoding);
|
||||
|
||||
~World();
|
||||
|
||||
Ptr::CellStore *getExterior (int x, int y);
|
||||
|
||||
Ptr::CellStore *getInterior (std::string name);
|
||||
|
||||
void removeScripts (Ptr::CellStore *cell);
|
||||
|
||||
|
|
Loading…
Reference in a new issue