|
|
@ -1,5 +1,8 @@
|
|
|
|
#include "fallback.hpp"
|
|
|
|
#include "fallback.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <boost/lexical_cast.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Fallback
|
|
|
|
namespace Fallback
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool stob(std::string const& s) {
|
|
|
|
bool stob(std::string const& s) {
|
|
|
@ -18,14 +21,16 @@ namespace Fallback
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return it->second;
|
|
|
|
return it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
float Map::getFallbackFloat(const std::string& fall) const
|
|
|
|
float Map::getFallbackFloat(const std::string& fall) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string fallback=getFallbackString(fall);
|
|
|
|
std::string fallback=getFallbackString(fall);
|
|
|
|
if(fallback.empty())
|
|
|
|
if(fallback.empty())
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return std::stof(fallback);
|
|
|
|
return boost::lexical_cast<float>(fallback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int Map::getFallbackInt(const std::string& fall) const
|
|
|
|
int Map::getFallbackInt(const std::string& fall) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string fallback=getFallbackString(fall);
|
|
|
|
std::string fallback=getFallbackString(fall);
|
|
|
@ -43,6 +48,7 @@ namespace Fallback
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return stob(fallback);
|
|
|
|
return stob(fallback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
osg::Vec4f Map::getFallbackColour(const std::string& fall) const
|
|
|
|
osg::Vec4f Map::getFallbackColour(const std::string& fall) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string sum=getFallbackString(fall);
|
|
|
|
std::string sum=getFallbackString(fall);
|
|
|
|