|
|
|
@ -148,16 +148,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();
|
|
|
|
|
|
|
|
|
@ -189,9 +189,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()
|
|
|
|
@ -224,8 +224,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)
|
|
|
|
|
{
|
|
|
|
@ -492,12 +492,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
|
|
|
|
@ -2214,7 +2208,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
|
|
|
|
@ -3478,17 +3472,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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|