Fix an issue preventing compilation, revealing another that doesn't make much sense.

pull/998/head
AnyOldName3 9 years ago
parent c1ffc9e776
commit 2a9b12bb3f

@ -145,7 +145,7 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
"\n\twin1251 - Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic and other languages\n"
"\n\twin1252 - Western European (Latin) alphabet, used by default")
("fallback", bpo::value<FallbackMap>()->default_value(FallbackMap(), "")
("fallback", bpo::value<EscapeFallbackMap>()->default_value(EscapeFallbackMap(), "")
->multitoken()->composing(), "fallback values")
("no-grab", "Don't grab mouse cursor")
@ -248,7 +248,7 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
// other settings
engine.setSoundUsage(!variables["no-sound"].as<bool>());
engine.setFallbackValues(variables["fallback"].as<FallbackMap>().mMap);
engine.setFallbackValues(variables["fallback"].as<EscapeFallbackMap>().toFallbackMap().mMap);
engine.setActivationDistanceOverride (variables["activate-dist"].as<int>());
engine.enableFontExport(variables["export-fonts"].as<bool>());

@ -13,7 +13,20 @@ namespace Fallback
{
struct FallbackMap {
std::map<std::string, std::string> mMap;
};
struct EscapeFallbackMap : FallbackMap
{
std::map<Files::EscapeHashString, Files::EscapeHashString> mMap;
FallbackMap toFallbackMap() const
{
FallbackMap temp = FallbackMap();
for (std::map<Files::EscapeHashString, Files::EscapeHashString>::const_iterator it = mMap.begin(); it != mMap.end(); ++it)
temp.mMap[it->first.toStdString()] = it->second.toStdString();
return temp;
}
};
void validate(boost::any &v, std::vector<std::string> const &tokens, FallbackMap*, int)

Loading…
Cancel
Save