From c907ed517d05861db942b4555f0d3883e6c8814a Mon Sep 17 00:00:00 2001 From: slothlife Date: Wed, 26 Aug 2015 23:34:15 -0500 Subject: [PATCH] Remove C++11 explicit on conversion operator --- apps/openmw/mwworld/weather.cpp | 14 ++++++++++---- apps/openmw/mwworld/weather.hpp | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 8799ae57c..744cae28b 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -127,7 +127,13 @@ RegionWeather::RegionWeather(const ESM::RegionWeatherState& state) RegionWeather::operator ESM::RegionWeatherState() const { - return ESM::RegionWeatherState { mWeather, mChances }; + ESM::RegionWeatherState state = + { + mWeather, + mChances + }; + + return state; } void RegionWeather::setChances(const std::vector& chances) @@ -370,12 +376,12 @@ WeatherManager::WeatherManager(MWRender::RenderingManager& rendering, const MWWo , mWeatherSettings() , mMasser("Masser", fallback) , mSecunda("Secunda", fallback) + , mThunderFrequency(fallback.getFallbackFloat("Weather_Thunderstorm_Thunder_Frequency")) + , mThunderThreshold(fallback.getFallbackFloat("Weather_Thunderstorm_Thunder_Threshold")) , mThunderSoundID0(fallback.getFallbackString("Weather_Thunderstorm_Thunder_Sound_ID_0")) , mThunderSoundID1(fallback.getFallbackString("Weather_Thunderstorm_Thunder_Sound_ID_1")) , mThunderSoundID2(fallback.getFallbackString("Weather_Thunderstorm_Thunder_Sound_ID_2")) , mThunderSoundID3(fallback.getFallbackString("Weather_Thunderstorm_Thunder_Sound_ID_3")) - , mThunderFrequency(fallback.getFallbackFloat("Weather_Thunderstorm_Thunder_Frequency")) - , mThunderThreshold(fallback.getFallbackFloat("Weather_Thunderstorm_Thunder_Threshold")) , mWindSpeed(0.f) , mIsStorm(false) , mStormDirection(0,1,0) @@ -705,7 +711,7 @@ void WeatherManager::write(ESM::ESMWriter& writer, Loading::Listener& progress) std::map::iterator it = mRegions.begin(); for(; it != mRegions.end(); ++it) { - state.mRegions.insert(std::make_pair(it->first, ESM::RegionWeatherState(it->second))); + state.mRegions.insert(std::make_pair(it->first, it->second)); } writer.startRecord(ESM::REC_WTHR); diff --git a/apps/openmw/mwworld/weather.hpp b/apps/openmw/mwworld/weather.hpp index d07e7e1e4..cdbe14dfa 100644 --- a/apps/openmw/mwworld/weather.hpp +++ b/apps/openmw/mwworld/weather.hpp @@ -127,7 +127,7 @@ namespace MWWorld explicit RegionWeather(const ESM::Region& region); explicit RegionWeather(const ESM::RegionWeatherState& state); - explicit operator ESM::RegionWeatherState() const; + operator ESM::RegionWeatherState() const; void setChances(const std::vector& chances);