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

move mInteriors and mExterior back to World::World

This commit is contained in:
Sebastian Wick 2011-08-01 14:34:50 +02:00
parent 6baf904f0f
commit 3f007d29cc
4 changed files with 22 additions and 7 deletions

View file

@ -110,8 +110,8 @@ namespace MWWorld
if (iter==mActiveCells.end()) if (iter==mActiveCells.end())
{ {
mExteriors[std::make_pair (x, y)].loadExt (x, y, mWorld->getStore(), mWorld->getEsmReader()); mWorld->getExterior(x, y)->loadExt (x, y, mWorld->getStore(), mWorld->getEsmReader());
Ptr::CellStore *cell = &mExteriors[std::make_pair (x, y)]; Ptr::CellStore *cell = mWorld->getExterior(x, y);
loadCell (cell, new MWRender::ExteriorCellRender (*cell, mEnvironment, mScene)); loadCell (cell, new MWRender::ExteriorCellRender (*cell, mEnvironment, mScene));
} }
@ -136,7 +136,7 @@ namespace MWWorld
mCurrentCell = iter->first; mCurrentCell = iter->first;
// adjust player // adjust player
playerCellChange (&mExteriors[std::make_pair (X, Y)], position, adjustPlayerPos); playerCellChange (mWorld->getExterior(X, Y), position, adjustPlayerPos);
// Sky system // Sky system
mWorld->adjustSky(); mWorld->adjustSky();
@ -181,8 +181,8 @@ namespace MWWorld
// Load cell. // Load cell.
std::cout << "cellName:" << cellName << std::endl; std::cout << "cellName:" << cellName << std::endl;
mInteriors[cellName].loadInt (cellName, mWorld->getStore(), mWorld->getEsmReader()); mWorld->getInterior(cellName)->loadInt (cellName, mWorld->getStore(), mWorld->getEsmReader());
Ptr::CellStore *cell = &mInteriors[cellName]; Ptr::CellStore *cell = mWorld->getInterior(cellName);
loadCell (cell, new MWRender::InteriorCellRender (*cell, mEnvironment, mScene)); loadCell (cell, new MWRender::InteriorCellRender (*cell, mEnvironment, mScene));

View file

@ -59,8 +59,6 @@ namespace MWWorld
MWRender::MWScene mScene; MWRender::MWScene mScene;
Ptr::CellStore *mCurrentCell; // the cell, the player is in Ptr::CellStore *mCurrentCell; // the cell, the player is in
CellRenderCollection mActiveCells; CellRenderCollection mActiveCells;
std::map<std::string, Ptr::CellStore> mInteriors;
std::map<std::pair<int, int>, Ptr::CellStore> mExteriors;
bool mCellChanged; bool mCellChanged;
Environment& mEnvironment; Environment& mEnvironment;
World *mWorld; World *mWorld;

View file

@ -320,6 +320,16 @@ namespace MWWorld
delete mGlobalVariables; delete mGlobalVariables;
delete mWorldScene; 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() MWWorld::Player& World::getPlayer()
{ {

View file

@ -76,6 +76,9 @@ namespace MWWorld
bool mSky; bool mSky;
Environment& mEnvironment; Environment& mEnvironment;
int mNextDynamicRecord; int mNextDynamicRecord;
std::map<std::string, Ptr::CellStore> mInteriors;
std::map<std::pair<int, int>, Ptr::CellStore> mExteriors;
OEngine::Physic::PhysicEngine* mPhysEngine; OEngine::Physic::PhysicEngine* mPhysEngine;
@ -99,6 +102,10 @@ namespace MWWorld
Environment& environment, const std::string& encoding); Environment& environment, const std::string& encoding);
~World(); ~World();
Ptr::CellStore *getExterior (int x, int y);
Ptr::CellStore *getInterior (std::string name);
void removeScripts (Ptr::CellStore *cell); void removeScripts (Ptr::CellStore *cell);