diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 92360eea3..1b337635a 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -12,21 +12,73 @@ WeatherManager::WeatherManager(MWRender::RenderingManager* rendering) : { mRendering = rendering; + #define clr(r,g,b) ColourValue(r/255.f, g/255.f, b/255.f) + /// \todo read these from Morrowind.ini Weather clear; clear.mCloudTexture = "tx_sky_clear.dds"; - clear.mCloudsMaximumPercent = 0.75; + clear.mCloudsMaximumPercent = 1.0; + clear.mTransitionDelta = 0.15; + clear.mSkySunriseColor = clr(118, 141, 164); + clear.mSkyDayColor = clr(95, 135, 203); + clear.mSkySunsetColor = clr(56, 89, 129); + clear.mSkyNightColor = clr(9, 10, 11); + clear.mFogSunriseColor = clr(255, 189, 157); + clear.mFogDayColor = clr(206, 227, 255); + clear.mFogSunsetColor = clr(255, 189, 157); + clear.mFogNightColor = clr(9, 10, 11); + clear.mAmbientSunriseColor = clr(47, 66, 96); + clear.mAmbientDayColor = clr(137, 140, 160); + clear.mAmbientSunsetColor = clr(68, 75, 96); + clear.mAmbientNightColor = clr(32, 35, 42); + clear.mSunSunriseColor = clr(242, 159, 99); + clear.mSunDayColor = clr(255, 252, 238); + clear.mSunSunsetColor = clr(255, 115, 79); + clear.mSunNightColor = clr(59, 97, 176); + clear.mSunDiscSunsetColour = clr(255, 189, 157); + clear.mLandFogDayDepth = 0.69; + clear.mLandFogNightDepth = 0.69; + clear.mWindSpeed = 0.1; + clear.mCloudSpeed = 1.25; + clear.mGlareView = 1.0; + mWeatherSettings["clear"] = clear; Weather cloudy; cloudy.mCloudTexture = "tx_sky_cloudy.dds"; - cloudy.mCloudsMaximumPercent = 0.9; + cloudy.mCloudsMaximumPercent = 1.0; + cloudy.mTransitionDelta = 0.15; + cloudy.mSkySunriseColor = clr(126, 158, 173); + cloudy.mSkyDayColor = clr(117, 160, 215); + cloudy.mSkySunsetColor = clr(111, 114, 159); + cloudy.mSkyNightColor = clr(9, 10, 11); + cloudy.mFogSunriseColor = clr(255, 207, 149); + cloudy.mFogDayColor = clr(245, 235, 224); + cloudy.mFogSunsetColor = clr(255, 155, 106); + cloudy.mFogNightColor = clr(9, 10, 11); + cloudy.mAmbientSunriseColor = clr(66, 74, 87); + cloudy.mAmbientDayColor = clr(137, 145, 160); + cloudy.mAmbientSunsetColor = clr(71, 80, 92); + cloudy.mAmbientNightColor = clr(32, 39, 54); + cloudy.mSunSunriseColor = clr(241, 177, 99); + cloudy.mSunDayColor = clr(255, 236, 221); + cloudy.mSunSunsetColor = clr(255, 89, 00); + cloudy.mSunNightColor = clr(77, 91, 124); + cloudy.mSunDiscSunsetColour = clr(255, 202, 179); + cloudy.mLandFogDayDepth = 0.72; + cloudy.mLandFogNightDepth = 0.72; + cloudy.mWindSpeed = 0.2; + cloudy.mCloudSpeed = 2; + cloudy.mGlareView = 1.0; + mWeatherSettings["cloudy"] = cloudy; + /* Weather overcast; overcast.mCloudTexture = "tx_sky_overcast.dds"; overcast.mCloudsMaximumPercent = 1.0; mWeatherSettings["overcast"] = overcast; + */ setWeather("clear", true); setWeather("cloudy", false); diff --git a/apps/openmw/mwworld/weather.hpp b/apps/openmw/mwworld/weather.hpp index 4153ccdd0..1ba482b2c 100644 --- a/apps/openmw/mwworld/weather.hpp +++ b/apps/openmw/mwworld/weather.hpp @@ -11,6 +11,74 @@ namespace MWRender namespace MWWorld { + /// Global weather manager properties (according to INI) + struct WeatherGlobals + { + /* + EnvReduceColor=255,255,255,255 + LerpCloseColor=037,046,048,255 + BumpFadeColor=230,239,255,255 + AlphaReduce=0.35 + Minimum Time Between Environmental Sounds=1.0 + Maximum Time Between Environmental Sounds=5.0 + Sun Glare Fader Max=0.5 + Sun Glare Fader Angle Max=30.0 + Sun Glare Fader Color=222,095,039 + Timescale Clouds=0 + Precip Gravity=575 + Hours Between Weather Changes=20 + Rain Ripples=1 + Rain Ripple Radius=1024 + Rain Ripples Per Drop=1 + Rain Ripple Scale=0.3 + Rain Ripple Speed=1.0 + Fog Depth Change Speed=3 + Sunrise Time=6 + Sunset Time=18 + Sunrise Duration=2 + Sunset Duration=2 + Sky Pre-Sunrise Time=.5 + Sky Post-Sunrise Time=1 + Sky Pre-Sunset Time=1.5 + Sky Post-Sunset Time=.5 + Ambient Pre-Sunrise Time=.5 + Ambient Post-Sunrise Time=2 + Ambient Pre-Sunset Time=1 + Ambient Post-Sunset Time=1.25 + Fog Pre-Sunrise Time=.5 + Fog Post-Sunrise Time=1 + Fog Pre-Sunset Time=2 + Fog Post-Sunset Time=1 + Sun Pre-Sunrise Time=0 + Sun Post-Sunrise Time=0 + Sun Pre-Sunset Time=1 + Sun Post-Sunset Time=1.25 + Stars Post-Sunset Start=1 + Stars Pre-Sunrise Finish=2 + Stars Fading Duration=2 + Snow Ripples=0 + Snow Ripple Radius=1024 + Snow Ripples Per Flake=1 + Snow Ripple Scale=0.3 + Snow Ripple Speed=1.0 + Snow Gravity Scale=0.1 + Snow High Kill=700 + Snow Low Kill=150 + */ + + float mSunriseTime, + mSunsetTime, + mSunriseDuration, + mSunsetDuration; + + WeatherGlobals() : + mSunriseTime(8), + mSunsetTime(18), + mSunriseDuration(2), + mSunsetDuration(2) + {}; + }; + /// Defines the actual weather that results from weather setting (see below), time of day and weather transition struct WeatherResult { @@ -40,38 +108,38 @@ namespace MWWorld }; - /// Defines a single weather setting + /// Defines a single weather setting (according to INI) struct Weather { Ogre::String mCloudTexture; // Sky (atmosphere) colors - Ogre::ColourValue mSkySunriseColor; - Ogre::ColourValue mSkyDayColor; - Ogre::ColourValue mSkySunsetColor; - Ogre::ColourValue mSkyNightColor; + Ogre::ColourValue mSkySunriseColor, + mSkyDayColor, + mSkySunsetColor, + mSkyNightColor; // Fog colors - Ogre::ColourValue mFogSunriseColor; - Ogre::ColourValue mFogDayColor; - Ogre::ColourValue mFogSunsetColor; - Ogre::ColourValue mFogNightColor; + Ogre::ColourValue mFogSunriseColor, + mFogDayColor, + mFogSunsetColor, + mFogNightColor; // Ambient lighting colors - Ogre::ColourValue mAmbientSunriseColor; - Ogre::ColourValue mAmbientDayColor; - Ogre::ColourValue mAmbientSunsetColor; - Ogre::ColourValue mAmbientNightColor; + Ogre::ColourValue mAmbientSunriseColor, + mAmbientDayColor, + mAmbientSunsetColor, + mAmbientNightColor; // Sun (directional) lighting colors - Ogre::ColourValue mSunSunriseColor; - Ogre::ColourValue mSunDayColor; - Ogre::ColourValue mSunSunsetColor; - Ogre::ColourValue mSunNightColor; + Ogre::ColourValue mSunSunriseColor, + mSunDayColor, + mSunSunsetColor, + mSunNightColor; // Fog depth/density - float mLandFogDayDepth; - float mLandFogNightDepth; + float mLandFogDayDepth, + mLandFogNightDepth; // Color modulation for the sun itself during sunset (not completely sure) Ogre::ColourValue mSunDiscSunsetColour; @@ -95,6 +163,10 @@ namespace MWWorld // Sound effect // This is used for Blight, Ashstorm and Blizzard (Bloodmoon) Ogre::String mAmbientLoopSoundID; + + /// \todo rain, thunder, ashstorm... + + /// \todo disease chance }; ///