forked from mirror/openmw-tes3mp
Merge pull request #381 from OpenMW/master
Add OpenMW commits up to 31 Jan 2018
This commit is contained in:
commit
4496625154
2 changed files with 20 additions and 27 deletions
|
@ -168,16 +168,16 @@ namespace MWWorld
|
|||
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap,
|
||||
int activationDistanceOverride, const std::string& startCell, const std::string& startupScript,
|
||||
const std::string& resourcePath, const std::string& userDataPath)
|
||||
: mResourceSystem(resourceSystem), mFallback(fallbackMap), mPlayer (0), mLocalScripts (mStore),
|
||||
: mResourceSystem(resourceSystem), mFallback(fallbackMap), mLocalScripts (mStore),
|
||||
mSky (true), mCells (mStore, mEsm),
|
||||
mGodMode(false), mScriptsEnabled(true), mContentFiles (contentFiles), mUserDataPath(userDataPath),
|
||||
mActivationDistanceOverride (activationDistanceOverride), mStartupScript(startupScript),
|
||||
mStartCell (startCell), mDistanceToFacedObject(-1), mTeleportEnabled(true),
|
||||
mLevitationEnabled(true), mGoToJail(false), mDaysInPrison(0), mSpellPreloadTimer(0.f)
|
||||
{
|
||||
mPhysics = new MWPhysics::PhysicsSystem(resourceSystem, rootNode);
|
||||
mRendering = new MWRender::RenderingManager(viewer, rootNode, resourceSystem, workQueue, &mFallback, resourcePath);
|
||||
mProjectileManager.reset(new ProjectileManager(mRendering->getLightRoot(), resourceSystem, mRendering, mPhysics));
|
||||
mPhysics.reset(new MWPhysics::PhysicsSystem(resourceSystem, rootNode));
|
||||
mRendering.reset(new MWRender::RenderingManager(viewer, rootNode, resourceSystem, workQueue, &mFallback, resourcePath));
|
||||
mProjectileManager.reset(new ProjectileManager(mRendering->getLightRoot(), resourceSystem, mRendering.get(), mPhysics.get()));
|
||||
|
||||
mRendering->preloadCommonAssets();
|
||||
|
||||
|
@ -209,9 +209,9 @@ namespace MWWorld
|
|||
|
||||
mSwimHeightScale = mStore.get<ESM::GameSetting>().find("fSwimHeightScale")->getFloat();
|
||||
|
||||
mWeatherManager = new MWWorld::WeatherManager(*mRendering, mFallback, mStore);
|
||||
mWeatherManager.reset(new MWWorld::WeatherManager(*mRendering, mFallback, mStore));
|
||||
|
||||
mWorldScene = new Scene(*mRendering, mPhysics);
|
||||
mWorldScene.reset(new Scene(*mRendering.get(), mPhysics.get()));
|
||||
}
|
||||
|
||||
void World::fillGlobalVariables()
|
||||
|
@ -244,8 +244,8 @@ namespace MWWorld
|
|||
|
||||
// we don't want old weather to persist on a new game
|
||||
// Note that if reset later, the initial ChangeWeather that the chargen script calls will be lost.
|
||||
delete mWeatherManager;
|
||||
mWeatherManager = new MWWorld::WeatherManager(*mRendering, mFallback, mStore);
|
||||
mWeatherManager.reset();
|
||||
mWeatherManager.reset(new MWWorld::WeatherManager(*mRendering.get(), mFallback, mStore));
|
||||
|
||||
if (!bypass)
|
||||
{
|
||||
|
@ -525,12 +525,6 @@ namespace MWWorld
|
|||
{
|
||||
// Must be cleared before mRendering is destroyed
|
||||
mProjectileManager->clear();
|
||||
delete mWeatherManager;
|
||||
delete mWorldScene;
|
||||
delete mRendering;
|
||||
delete mPhysics;
|
||||
|
||||
delete mPlayer;
|
||||
}
|
||||
|
||||
const ESM::Cell *World::getExterior (const std::string& cellName) const
|
||||
|
@ -2314,7 +2308,7 @@ namespace MWWorld
|
|||
{
|
||||
const ESM::NPC *player = mStore.get<ESM::NPC>().find("player");
|
||||
if (!mPlayer)
|
||||
mPlayer = new MWWorld::Player(player);
|
||||
mPlayer.reset(new MWWorld::Player(player));
|
||||
else
|
||||
{
|
||||
// Remove the old CharacterController
|
||||
|
@ -3667,17 +3661,17 @@ namespace MWWorld
|
|||
|
||||
if (MWMechanics::isSummoningEffect(it->mEffectID))
|
||||
{
|
||||
preload(mWorldScene, mStore, "VFX_Summon_Start");
|
||||
preload(mWorldScene, mStore, MWMechanics::getSummonedCreature(it->mEffectID));
|
||||
preload(mWorldScene.get(), mStore, "VFX_Summon_Start");
|
||||
preload(mWorldScene.get(), mStore, MWMechanics::getSummonedCreature(it->mEffectID));
|
||||
}
|
||||
|
||||
preload(mWorldScene, mStore, effect->mCasting);
|
||||
preload(mWorldScene, mStore, effect->mHit);
|
||||
preload(mWorldScene.get(), mStore, effect->mCasting);
|
||||
preload(mWorldScene.get(), mStore, effect->mHit);
|
||||
|
||||
if (it->mArea > 0)
|
||||
preload(mWorldScene, mStore, effect->mArea);
|
||||
preload(mWorldScene.get(), mStore, effect->mArea);
|
||||
if (it->mRange == ESM::RT_Target)
|
||||
preload(mWorldScene, mStore, effect->mBolt);
|
||||
preload(mWorldScene.get(), mStore, effect->mBolt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,17 +74,11 @@ namespace MWWorld
|
|||
Resource::ResourceSystem* mResourceSystem;
|
||||
|
||||
Fallback::Map mFallback;
|
||||
MWRender::RenderingManager* mRendering;
|
||||
|
||||
MWWorld::WeatherManager* mWeatherManager;
|
||||
|
||||
MWWorld::Scene *mWorldScene;
|
||||
MWWorld::Player *mPlayer;
|
||||
std::vector<ESM::ESMReader> mEsm;
|
||||
MWWorld::ESMStore mStore;
|
||||
LocalScripts mLocalScripts;
|
||||
MWWorld::Globals mGlobalVariables;
|
||||
MWPhysics::PhysicsSystem *mPhysics;
|
||||
bool mSky;
|
||||
|
||||
ESM::Variant* mGameHour;
|
||||
|
@ -98,6 +92,11 @@ namespace MWWorld
|
|||
|
||||
std::string mCurrentWorldSpace;
|
||||
|
||||
std::unique_ptr<MWWorld::Player> mPlayer;
|
||||
std::unique_ptr<MWPhysics::PhysicsSystem> mPhysics;
|
||||
std::unique_ptr<MWRender::RenderingManager> mRendering;
|
||||
std::unique_ptr<MWWorld::Scene> mWorldScene;
|
||||
std::unique_ptr<MWWorld::WeatherManager> mWeatherManager;
|
||||
std::shared_ptr<ProjectileManager> mProjectileManager;
|
||||
|
||||
bool mGodMode;
|
||||
|
|
Loading…
Reference in a new issue