1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-27 03:40:24 +00:00

Correct base cloud speed, support Timescale Clouds fallback setting (#7792)

This commit is contained in:
Alexei Kotov 2024-01-26 15:32:14 +03:00
parent ad64c71753
commit 2ea4013382
3 changed files with 14 additions and 3 deletions

View file

@ -173,6 +173,7 @@
Feature #7652: Sort inactive post processing shaders list properly Feature #7652: Sort inactive post processing shaders list properly
Feature #7698: Implement sAbsorb, sDamage, sDrain, sFortify and sRestore Feature #7698: Implement sAbsorb, sDamage, sDrain, sFortify and sRestore
Feature #7709: Improve resolution selection in Launcher Feature #7709: Improve resolution selection in Launcher
Feature #7792: Support Timescale Clouds
Task #5896: Do not use deprecated MyGUI properties Task #5896: Do not use deprecated MyGUI properties
Task #6624: Drop support for saves made prior to 0.45 Task #6624: Drop support for saves made prior to 0.45
Task #7113: Move from std::atoi to std::from_char Task #7113: Move from std::atoi to std::from_char

View file

@ -240,6 +240,7 @@ namespace MWRender
, mIsStorm(false) , mIsStorm(false)
, mDay(0) , mDay(0)
, mMonth(0) , mMonth(0)
, mTimescaleClouds(Fallback::Map::getBool("Weather_Timescale_Clouds"))
, mCloudAnimationTimer(0.f) , mCloudAnimationTimer(0.f)
, mRainTimer(0.f) , mRainTimer(0.f)
, mStormParticleDirection(MWWorld::Weather::defaultDirection()) , mStormParticleDirection(MWWorld::Weather::defaultDirection())
@ -557,8 +558,17 @@ namespace MWRender
mParticleNode->setAttitude(quat); mParticleNode->setAttitude(quat);
} }
const float timeScale = MWBase::Environment::get().getWorld()->getTimeManager()->getGameTimeScale();
// UV Scroll the clouds // UV Scroll the clouds
mCloudAnimationTimer += duration * mCloudSpeed * 0.003; float cloudDelta = duration * mCloudSpeed / 400.f;
if (mTimescaleClouds)
cloudDelta *= timeScale / 60.f;
mCloudAnimationTimer += cloudDelta;
if (mCloudAnimationTimer >= 4.f)
mCloudAnimationTimer -= 4.f;
mNextCloudUpdater->setTextureCoord(mCloudAnimationTimer); mNextCloudUpdater->setTextureCoord(mCloudAnimationTimer);
mCloudUpdater->setTextureCoord(mCloudAnimationTimer); mCloudUpdater->setTextureCoord(mCloudAnimationTimer);
@ -574,8 +584,7 @@ namespace MWRender
} }
// rotate the stars by 360 degrees every 4 days // rotate the stars by 360 degrees every 4 days
mAtmosphereNightRoll += MWBase::Environment::get().getWorld()->getTimeManager()->getGameTimeScale() * duration mAtmosphereNightRoll += timeScale * duration * osg::DegreesToRadians(360.f) / (3600 * 96.f);
* osg::DegreesToRadians(360.f) / (3600 * 96.f);
if (mAtmosphereNightNode->getNodeMask() != 0) if (mAtmosphereNightNode->getNodeMask() != 0)
mAtmosphereNightNode->setAttitude(osg::Quat(mAtmosphereNightRoll, osg::Vec3f(0, 0, 1))); mAtmosphereNightNode->setAttitude(osg::Quat(mAtmosphereNightRoll, osg::Vec3f(0, 0, 1)));
mPrecipitationOccluder->update(); mPrecipitationOccluder->update();

View file

@ -165,6 +165,7 @@ namespace MWRender
int mDay; int mDay;
int mMonth; int mMonth;
bool mTimescaleClouds;
float mCloudAnimationTimer; float mCloudAnimationTimer;
float mRainTimer; float mRainTimer;