Implement fStromWindSpeed (Fixes #2764)

c++11
scrawl 10 years ago
parent 87a089d6b6
commit f12619b86a

@ -66,6 +66,10 @@ void WeatherManager::setFallbackWeather(Weather& weather,const std::string& name
weather.mGlareView = mFallback->getFallbackFloat("Weather_"+upper+"_Glare_View"); weather.mGlareView = mFallback->getFallbackFloat("Weather_"+upper+"_Glare_View");
weather.mCloudTexture = mFallback->getFallbackString("Weather_"+upper+"_Cloud_Texture"); weather.mCloudTexture = mFallback->getFallbackString("Weather_"+upper+"_Cloud_Texture");
static const float fStromWindSpeed = mStore->get<ESM::GameSetting>().find("fStromWindSpeed")->getFloat();
weather.mIsStorm = weather.mWindSpeed > fStromWindSpeed;
bool usesPrecip = mFallback->getFallbackBool("Weather_"+upper+"_Using_Precip"); bool usesPrecip = mFallback->getFallbackBool("Weather_"+upper+"_Using_Precip");
if (usesPrecip) if (usesPrecip)
weather.mRainEffect = "meshes\\raindrop.nif"; weather.mRainEffect = "meshes\\raindrop.nif";
@ -79,7 +83,6 @@ Rain Height Max=700 ?
Rain Threshold=0.6 ? Rain Threshold=0.6 ?
Max Raindrops=650 ? Max Raindrops=650 ?
*/ */
weather.mIsStorm = (name == "ashstorm" || name == "blight");
mWeatherSettings[name] = weather; mWeatherSettings[name] = weather;
} }
@ -112,8 +115,8 @@ float WeatherManager::calculateAngleFade (const std::string& moonName, float ang
return 1.f; return 1.f;
} }
WeatherManager::WeatherManager(MWRender::RenderingManager* rendering,MWWorld::Fallback* fallback) : WeatherManager::WeatherManager(MWRender::RenderingManager* rendering, MWWorld::Fallback* fallback, MWWorld::ESMStore* store) :
mHour(14), mWindSpeed(0.f), mIsStorm(false), mStormDirection(0,1,0), mFallback(fallback), mHour(14), mWindSpeed(0.f), mIsStorm(false), mStormDirection(0,1,0), mFallback(fallback), mStore(store),
mRendering(rendering), mCurrentWeather("clear"), mNextWeather(""), mFirstUpdate(true), mRendering(rendering), mCurrentWeather("clear"), mNextWeather(""), mFirstUpdate(true),
mRemainingTransitionTime(0), mThunderFlash(0), mThunderChance(0), mThunderChanceNeeded(50), mRemainingTransitionTime(0), mThunderFlash(0), mThunderChance(0), mThunderChanceNeeded(50),
mTimePassed(0), mWeatherUpdateTime(0), mThunderSoundDelay(0) mTimePassed(0), mWeatherUpdateTime(0), mThunderSoundDelay(0)

@ -156,7 +156,8 @@ namespace MWWorld
class WeatherManager class WeatherManager
{ {
public: public:
WeatherManager(MWRender::RenderingManager*,MWWorld::Fallback* fallback); // Have to pass fallback and Store, can't use singleton since World isn't fully constructed yet at the time
WeatherManager(MWRender::RenderingManager*, MWWorld::Fallback* fallback, MWWorld::ESMStore* store);
~WeatherManager(); ~WeatherManager();
/** /**
@ -210,6 +211,7 @@ namespace MWWorld
std::string mPlayingSoundID; std::string mPlayingSoundID;
MWWorld::Fallback* mFallback; MWWorld::Fallback* mFallback;
MWWorld::ESMStore* mStore;
void setFallbackWeather(Weather& weather,const std::string& name); void setFallbackWeather(Weather& weather,const std::string& name);
MWRender::RenderingManager* mRendering; MWRender::RenderingManager* mRendering;

@ -163,8 +163,6 @@ namespace MWWorld
mProjectileManager.reset(new ProjectileManager(rootNode, resourceSystem, mPhysics)); mProjectileManager.reset(new ProjectileManager(rootNode, resourceSystem, mPhysics));
mRendering = new MWRender::RenderingManager(viewer, rootNode, resourceSystem, &mFallback); mRendering = new MWRender::RenderingManager(viewer, rootNode, resourceSystem, &mFallback);
mWeatherManager = new MWWorld::WeatherManager(mRendering,&mFallback);
mEsm.resize(contentFiles.size()); mEsm.resize(contentFiles.size());
Loading::Listener* listener = MWBase::Environment::get().getWindowManager()->getLoadingScreen(); Loading::Listener* listener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
listener->loadingOn(); listener->loadingOn();
@ -193,6 +191,8 @@ namespace MWWorld
mGlobalVariables.fill (mStore); mGlobalVariables.fill (mStore);
mWeatherManager = new MWWorld::WeatherManager(mRendering,&mFallback,&mStore);
mWorldScene = new Scene(*mRendering, mPhysics); mWorldScene = new Scene(*mRendering, mPhysics);
} }
@ -265,7 +265,7 @@ namespace MWWorld
// we don't want old weather to persist on a new game // we don't want old weather to persist on a new game
delete mWeatherManager; delete mWeatherManager;
mWeatherManager = 0; mWeatherManager = 0;
mWeatherManager = new MWWorld::WeatherManager(mRendering,&mFallback); mWeatherManager = new MWWorld::WeatherManager(mRendering,&mFallback,&mStore);
if (!mStartupScript.empty()) if (!mStartupScript.empty())
MWBase::Environment::get().getWindowManager()->executeInConsole(mStartupScript); MWBase::Environment::get().getWindowManager()->executeInConsole(mStartupScript);

Loading…
Cancel
Save