some cleanup

This commit is contained in:
Marc Zinnschlag 2013-03-10 11:30:50 +01:00
parent 65c382116f
commit bdec87e51b
2 changed files with 42 additions and 42 deletions

View file

@ -19,7 +19,7 @@ using namespace MWWorld;
using namespace MWSound; using namespace MWSound;
#define lerp(x, y) (x * (1-factor) + y * factor) #define lerp(x, y) (x * (1-factor) + y * factor)
std::string WeatherManager::getFallback (const std::string& key) std::string WeatherManager::getFallback (const std::string& key) const
{ {
std::map<std::string,std::string>::const_iterator it; std::map<std::string,std::string>::const_iterator it;
if((it = mFallback.find(key)) == mFallback.end()) if((it = mFallback.find(key)) == mFallback.end())
@ -28,18 +28,18 @@ std::string WeatherManager::getFallback (const std::string& key)
} }
return it->second; return it->second;
} }
std::string WeatherManager::getFallbackString(const std::string& fall) std::string WeatherManager::getFallbackString(const std::string& fall) const
{ {
return WeatherManager::getFallback(fall); return getFallback(fall);
} }
float WeatherManager::getFallbackFloat(const std::string& fall) float WeatherManager::getFallbackFloat(const std::string& fall) const
{ {
std::string fallback=getFallbackString(fall); std::string fallback=getFallbackString(fall);
return boost::lexical_cast<float>(fallback); return boost::lexical_cast<float>(fallback);
} }
ColourValue WeatherManager::getFallbackColour(const std::string& fall) ColourValue WeatherManager::getFallbackColour(const std::string& fall) const
{ {
std::string sum; std::string sum;
std::string ret[3]; std::string ret[3];

View file

@ -142,10 +142,10 @@ namespace MWWorld
float mHour; float mHour;
int mDay, mMonth; int mDay, mMonth;
std::map<std::string,std::string> mFallback; std::map<std::string,std::string> mFallback;
std::string getFallback (const std::string& key); std::string getFallback (const std::string& key) const;
std::string getFallbackString(const std::string& fall); std::string getFallbackString(const std::string& fall) const;
float getFallbackFloat(const std::string& fall); float getFallbackFloat(const std::string& fall) const;
Ogre::ColourValue getFallbackColour(const std::string& fall); Ogre::ColourValue getFallbackColour(const std::string& fall) const;
void setFallbackWeather(Weather& weather,const std::string& name); void setFallbackWeather(Weather& weather,const std::string& name);
MWRender::RenderingManager* mRendering; MWRender::RenderingManager* mRendering;