diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 44e05d6115..2a105a1abc 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -686,11 +686,6 @@ namespace MWRender updateAmbient(); } - void RenderingManager::skySetDate(int day, int month) - { - mSky->setDate(day, month); - } - int RenderingManager::skyGetMasserPhase() const { return mSky->getMasserPhase(); diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 86f248491a..8e8c266895 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -135,7 +135,6 @@ namespace MWRender void setAmbientColour(const osg::Vec4f& colour); - void skySetDate(int day, int month); int skyGetMasserPhase() const; int skyGetSecundaPhase() const; void skySetMoonColour(bool red); diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 483de27317..1cc8cc0d3e 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -238,11 +238,8 @@ namespace MWRender , mAtmosphereNightRoll(0.f) , mCreated(false) , mIsStorm(false) - , mDay(0) - , mMonth(0) , mTimescaleClouds(Fallback::Map::getBool("Weather_Timescale_Clouds")) , mCloudAnimationTimer(0.f) - , mRainTimer(0.f) , mStormParticleDirection(MWWorld::Weather::defaultDirection()) , mStormDirection(MWWorld::Weather::defaultDirection()) , mClouds() @@ -250,8 +247,6 @@ namespace MWRender , mCloudBlendFactor(0.f) , mCloudSpeed(0.f) , mStarsOpacity(0.f) - , mRemainingTransitionTime(0.f) - , mRainEnabled(false) , mRainSpeed(0.f) , mRainDiameter(0.f) , mRainMinHeight(0.f) @@ -263,7 +258,6 @@ namespace MWRender , mWindSpeed(0.f) , mBaseWindSpeed(0.f) , mEnabled(true) - , mSunEnabled(true) , mSunglareEnabled(true) , mPrecipitationAlpha(0.f) , mDirtyParticlesEffect(false) @@ -921,12 +915,6 @@ namespace MWRender mSecunda->setState(state); } - void SkyManager::setDate(int day, int month) - { - mDay = day; - mMonth = month; - } - void SkyManager::setGlareTimeOfDayFade(float val) { mSun->setGlareTimeOfDayFade(val); diff --git a/apps/openmw/mwrender/sky.hpp b/apps/openmw/mwrender/sky.hpp index 4ec357056e..6a32978c4e 100644 --- a/apps/openmw/mwrender/sky.hpp +++ b/apps/openmw/mwrender/sky.hpp @@ -54,12 +54,6 @@ namespace MWRender void setEnabled(bool enabled); - void setHour(double hour); - ///< will be called even when sky is disabled. - - void setDate(int day, int month); - ///< will be called even when sky is disabled. - int getMasserPhase() const; ///< 0 new moon, 1 waxing or waning cresecent, 2 waxing or waning half, /// 3 waxing or waning gibbous, 4 full moon @@ -85,8 +79,6 @@ namespace MWRender float getPrecipitationAlpha() const; - void setRainSpeed(float speed); - void setStormParticleDirection(const osg::Vec3f& direction); void setSunDirection(const osg::Vec3f& direction); @@ -165,14 +157,9 @@ namespace MWRender bool mIsStorm; - int mDay; - int mMonth; - bool mTimescaleClouds; float mCloudAnimationTimer; - float mRainTimer; - // particle system rotation is independent of cloud rotation internally osg::Vec3f mStormParticleDirection; osg::Vec3f mStormDirection; @@ -190,9 +177,6 @@ namespace MWRender VFS::Path::Normalized mCurrentParticleEffect; - float mRemainingTransitionTime; - - bool mRainEnabled; std::string mRainEffect; float mRainSpeed; float mRainDiameter; @@ -206,7 +190,6 @@ namespace MWRender float mBaseWindSpeed; bool mEnabled; - bool mSunEnabled; bool mSunglareEnabled; float mPrecipitationAlpha; diff --git a/apps/openmw/mwworld/datetimemanager.cpp b/apps/openmw/mwworld/datetimemanager.cpp index 69374a77a9..633aeb42f0 100644 --- a/apps/openmw/mwworld/datetimemanager.cpp +++ b/apps/openmw/mwworld/datetimemanager.cpp @@ -183,22 +183,19 @@ namespace MWWorld return months[month]; } - bool DateTimeManager::updateGlobalFloat(GlobalVariableName name, float value) + void DateTimeManager::updateGlobalFloat(GlobalVariableName name, float value) { if (name == Globals::sGameHour) { setHour(value); - return true; } else if (name == Globals::sDay) { setDay(static_cast(value)); - return true; } else if (name == Globals::sMonth) { setMonth(static_cast(value)); - return true; } else if (name == Globals::sYear) { @@ -212,26 +209,21 @@ namespace MWWorld { mDaysPassed = static_cast(value); } - - return false; } - bool DateTimeManager::updateGlobalInt(GlobalVariableName name, int value) + void DateTimeManager::updateGlobalInt(GlobalVariableName name, int value) { if (name == Globals::sGameHour) { setHour(static_cast(value)); - return true; } else if (name == Globals::sDay) { setDay(value); - return true; } else if (name == Globals::sMonth) { setMonth(value); - return true; } else if (name == Globals::sYear) { @@ -245,8 +237,6 @@ namespace MWWorld { mDaysPassed = value; } - - return false; } void DateTimeManager::setSimulationTimeScale(float scale) diff --git a/apps/openmw/mwworld/datetimemanager.hpp b/apps/openmw/mwworld/datetimemanager.hpp index af62d9ba3f..fce8898cf2 100644 --- a/apps/openmw/mwworld/datetimemanager.hpp +++ b/apps/openmw/mwworld/datetimemanager.hpp @@ -53,8 +53,8 @@ namespace MWWorld private: friend class World; void setup(Globals& globalVariables); - bool updateGlobalInt(GlobalVariableName name, int value); - bool updateGlobalFloat(GlobalVariableName name, float value); + void updateGlobalInt(GlobalVariableName name, int value); + void updateGlobalFloat(GlobalVariableName name, float value); void advanceTime(double hours, Globals& globalVariables); void setHour(double hour); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 84f4a6de2c..ef4d4d5489 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -241,7 +241,6 @@ namespace MWWorld { if (mSky && (isCellExterior() || isCellQuasiExterior())) { - updateSkyDate(); mRendering->setSkyEnabled(true); } else @@ -635,19 +634,13 @@ namespace MWWorld void World::setGlobalInt(GlobalVariableName name, int value) { - bool dateUpdated = mTimeManager->updateGlobalInt(name, value); - if (dateUpdated) - updateSkyDate(); - + mTimeManager->updateGlobalInt(name, value); mGlobalVariables[name].setInteger(value); } void World::setGlobalFloat(GlobalVariableName name, float value) { - bool dateUpdated = mTimeManager->updateGlobalFloat(name, value); - if (dateUpdated) - updateSkyDate(); - + mTimeManager->updateGlobalFloat(name, value); mGlobalVariables[name].setFloat(value); } @@ -921,7 +914,6 @@ namespace MWWorld mWeatherManager->advanceTime(hours, incremental); mTimeManager->advanceTime(hours, mGlobalVariables); - updateSkyDate(); if (!incremental) { @@ -3853,12 +3845,6 @@ namespace MWWorld mWorldScene->reportStats(frameNumber, stats); } - void World::updateSkyDate() - { - ESM::EpochTimeStamp currentDate = mTimeManager->getEpochTimeStamp(); - mRendering->skySetDate(currentDate.mDay, currentDate.mMonth); - } - std::vector World::getAll(const ESM::RefId& id) { return mWorldModel.getAll(id); diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 9e00118533..0da5a7f1f7 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -172,8 +172,6 @@ namespace MWWorld void fillGlobalVariables(); - void updateSkyDate(); - void loadContentFiles(const Files::Collections& fileCollections, const std::vector& content, ToUTF8::Utf8Encoder* encoder, Loading::Listener* listener);