removed duplicate code from World class

pull/7/head
Marc Zinnschlag 15 years ago
parent 5d40055b44
commit 8bbcbc05d5

@ -187,7 +187,7 @@ void OMW::Engine::go()
loadBSA();
// Create the world
mEnvironment.mWorld = new MWWorld::World (mOgre, mDataDir, mMaster, mCellName, mNewGame);
mEnvironment.mWorld = new MWWorld::World (mOgre, mDataDir, mMaster, mNewGame);
// Set up the GUI system
mGuiManager = new OEngine::GUI::MyGUIManager(mOgre.getWindow(),
@ -219,6 +219,12 @@ void OMW::Engine::go()
mEnvironment.mMechanicsManager->configureGUI();
// load cell
ESM::Position pos;
pos.pos[0] = pos.pos[1] = pos.pos[2] = 0;
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
mEnvironment.mWorld->changeCell (mCellName, pos);
// Sets up the input system
MWInput::MWInputManager input(mOgre, mEnvironment.mWorld->getPlayerPos(),
*mEnvironment.mWindowManager, mDebug);

@ -164,7 +164,7 @@ namespace MWWorld
}
World::World (OEngine::Render::OgreRenderer& renderer, const boost::filesystem::path& dataDir,
const std::string& master, const std::string& startCell, bool newGame)
const std::string& master, bool newGame)
: mSkyManager (0), mScene (renderer), mPlayerPos (0), mCurrentCell (0), mGlobalVariables (0),
mSky (false), mCellChanged (false)
{
@ -177,13 +177,7 @@ namespace MWWorld
mEsm.open (masterPath.file_string());
mStore.load (mEsm);
mInteriors[startCell].loadInt (startCell, mStore, mEsm);
mCurrentCell = &mInteriors[startCell];
insertInteriorScripts (mInteriors[startCell]);
mPlayerPos = new MWRender::PlayerPos (mScene.getCamera(), mStore.npcs.find ("player"));
mPlayerPos->setCell (&mInteriors[startCell]);
// global variables
mGlobalVariables = new Globals (mStore);
@ -194,19 +188,8 @@ namespace MWWorld
mGlobalVariables->setInt ("chargenstate", 1);
}
// This connects the cell data with the rendering scene.
mActiveCells.insert (std::make_pair (&mInteriors[startCell],
new MWRender::InteriorCellRender (mInteriors[startCell], mScene)));
// Load the cell and insert it into the renderer
for (CellRenderCollection::iterator iter (mActiveCells.begin());
iter!=mActiveCells.end(); ++iter)
iter->second->show();
mSkyManager =
MWRender::SkyManager::create(renderer.getWindow(), mScene.getCamera());
toggleSky();
}
World::~World()

@ -74,7 +74,7 @@ namespace MWWorld
public:
World (OEngine::Render::OgreRenderer& renderer, const boost::filesystem::path& master,
const std::string& dataDir, const std::string& startCell, bool newGame);
const std::string& dataDir, bool newGame);
~World();

Loading…
Cancel
Save