forked from mirror/openmw-tes3mp
fixed crash bug
This commit is contained in:
parent
012a41427c
commit
6d8cfa7dfa
3 changed files with 18 additions and 20 deletions
|
@ -31,7 +31,7 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
mWorld->removeScripts (iter->first);
|
mWorld->removeScripts (iter->first);
|
||||||
|
|
||||||
mEnvironment.mMechanicsManager->dropActors (iter->first); // FIXME: gehört in world?
|
mEnvironment.mMechanicsManager->dropActors (iter->first); // FIXME: gehört in world?
|
||||||
mEnvironment.mSoundManager->stopSound (iter->first); // FIXME: same
|
mEnvironment.mSoundManager->stopSound (iter->first); // FIXME: same
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
|
@ -152,21 +152,21 @@ namespace MWWorld
|
||||||
|
|
||||||
Scene::~Scene()
|
Scene::~Scene()
|
||||||
{
|
{
|
||||||
/*for (CellRenderCollection::iterator iter (mActiveCells.begin());
|
for (CellRenderCollection::iterator iter (mActiveCells.begin());
|
||||||
iter!=mActiveCells.end(); ++iter)
|
iter!=mActiveCells.end(); ++iter)
|
||||||
delete iter->second;*/
|
delete iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scene::hasCellChanged() const
|
bool Scene::hasCellChanged() const
|
||||||
{
|
{
|
||||||
return mCellChanged;
|
return mCellChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<Ptr::CellStore *, MWRender::CellRender *> Scene::getActiveCells ()
|
std::map<Ptr::CellStore *, MWRender::CellRender *> Scene::getActiveCells ()
|
||||||
{
|
{
|
||||||
return mActiveCells;
|
return mActiveCells;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
|
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
|
||||||
{
|
{
|
||||||
SuppressDoingPhysics scopeGuard;
|
SuppressDoingPhysics scopeGuard;
|
||||||
|
@ -206,7 +206,7 @@ namespace MWWorld
|
||||||
|
|
||||||
changeCell (x, y, position, true);
|
changeCell (x, y, position, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr::CellStore* Scene::getCurrentCell ()
|
Ptr::CellStore* Scene::getCurrentCell ()
|
||||||
{
|
{
|
||||||
return mCurrentCell;
|
return mCurrentCell;
|
||||||
|
@ -217,4 +217,3 @@ namespace MWWorld
|
||||||
mCellChanged = false;
|
mCellChanged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace MWWorld
|
||||||
|
|
||||||
typedef std::map<Ptr::CellStore *, MWRender::CellRender *> CellRenderCollection;
|
typedef std::map<Ptr::CellStore *, MWRender::CellRender *> CellRenderCollection;
|
||||||
|
|
||||||
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;
|
||||||
bool mCellChanged;
|
bool mCellChanged;
|
||||||
|
@ -81,9 +81,9 @@ namespace MWWorld
|
||||||
void changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos);
|
void changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos);
|
||||||
///< Move from exterior to interior or from interior cell to a different
|
///< Move from exterior to interior or from interior cell to a different
|
||||||
/// interior cell.
|
/// interior cell.
|
||||||
|
|
||||||
Ptr::CellStore* getCurrentCell ();
|
Ptr::CellStore* getCurrentCell ();
|
||||||
|
|
||||||
CellRenderCollection getActiveCells ();
|
CellRenderCollection getActiveCells ();
|
||||||
|
|
||||||
bool hasCellChanged() const;
|
bool hasCellChanged() const;
|
||||||
|
@ -92,10 +92,10 @@ namespace MWWorld
|
||||||
void changeToInteriorCell (const std::string& cellName, const ESM::Position& position);
|
void changeToInteriorCell (const std::string& cellName, const ESM::Position& position);
|
||||||
///< Move to interior cell.
|
///< Move to interior cell.
|
||||||
|
|
||||||
void changeToExteriorCell (const ESM::Position& position);
|
void changeToExteriorCell (const ESM::Position& position);
|
||||||
///< Move to exterior cell.
|
///< Move to exterior cell.
|
||||||
|
|
||||||
void markCellAsUnchanged();
|
void markCellAsUnchanged();
|
||||||
|
|
||||||
std::string getFacedHandle();
|
std::string getFacedHandle();
|
||||||
};
|
};
|
||||||
|
|
|
@ -283,7 +283,7 @@ namespace MWWorld
|
||||||
mSky (false), mEnvironment (environment), mNextDynamicRecord (0)
|
mSky (false), mEnvironment (environment), mNextDynamicRecord (0)
|
||||||
{
|
{
|
||||||
mPhysEngine = physEng;
|
mPhysEngine = physEng;
|
||||||
|
|
||||||
mPhysics = new PhysicsSystem(renderer, physEng);
|
mPhysics = new PhysicsSystem(renderer, physEng);
|
||||||
|
|
||||||
boost::filesystem::path masterPath (fileCollections.getCollection (".esm").getPath (master));
|
boost::filesystem::path masterPath (fileCollections.getCollection (".esm").getPath (master));
|
||||||
|
@ -311,16 +311,16 @@ namespace MWWorld
|
||||||
MWRender::SkyManager::create(renderer.getWindow(), mScene.getCamera(), resDir);
|
MWRender::SkyManager::create(renderer.getWindow(), mScene.getCamera(), resDir);
|
||||||
|
|
||||||
mPhysEngine = physEng;
|
mPhysEngine = physEng;
|
||||||
|
|
||||||
mWorldScene = new Scene(environment, this, mScene, mPhysics);
|
mWorldScene = new Scene(environment, this, mScene, mPhysics);
|
||||||
}
|
}
|
||||||
|
|
||||||
World::~World()
|
World::~World()
|
||||||
{
|
{
|
||||||
delete mPlayer;
|
delete mWorldScene;
|
||||||
delete mSkyManager;
|
delete mSkyManager;
|
||||||
delete mGlobalVariables;
|
delete mGlobalVariables;
|
||||||
//delete mWorldScene;
|
delete mPlayer;
|
||||||
delete mPhysics;
|
delete mPhysics;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,12 +347,12 @@ namespace MWWorld
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr::CellStore *World::getExterior (int x, int y)
|
Ptr::CellStore *World::getExterior (int x, int y)
|
||||||
{
|
{
|
||||||
return &mExteriors[std::make_pair (x, y)];
|
return &mExteriors[std::make_pair (x, y)];
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr::CellStore *World::getInterior (std::string name)
|
Ptr::CellStore *World::getInterior (std::string name)
|
||||||
{
|
{
|
||||||
return &mInteriors[name];
|
return &mInteriors[name];
|
||||||
|
@ -367,7 +367,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
return mStore;
|
return mStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESM::ESMReader& World::getEsmReader()
|
ESM::ESMReader& World::getEsmReader()
|
||||||
{
|
{
|
||||||
return mEsm;
|
return mEsm;
|
||||||
|
@ -768,4 +768,3 @@ namespace MWWorld
|
||||||
return std::make_pair (stream.str(), created);
|
return std::make_pair (stream.str(), created);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue