|
|
|
@ -152,24 +152,9 @@ namespace MWWorld
|
|
|
|
|
mRendering->skyDisable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void World::setFallbackValues(std::vector<std::string> pairs)
|
|
|
|
|
void World::setFallbackValues(std::map<std::string,std::string> fallbackMap)
|
|
|
|
|
{
|
|
|
|
|
for(std::vector<std::string>::iterator it = pairs.begin(); it != pairs.end(); it++)
|
|
|
|
|
{
|
|
|
|
|
std::string kv = *it;
|
|
|
|
|
int seperator = kv.find("=");
|
|
|
|
|
if(seperator < 1 || seperator == (kv.length()-1))
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string key = it->substr(0,seperator);
|
|
|
|
|
std::string value = it->substr(seperator+1);
|
|
|
|
|
if(mFallback.find(key) == mFallback.end()) {
|
|
|
|
|
std::cout << "insert " << key << ":" << value << std::endl;
|
|
|
|
|
mFallback.insert(std::make_pair<std::string,std::string>(key,value));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
mFallback = fallbackMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string World::getFallback(std::string key)
|
|
|
|
@ -185,7 +170,7 @@ namespace MWWorld
|
|
|
|
|
World::World (OEngine::Render::OgreRenderer& renderer,
|
|
|
|
|
const Files::Collections& fileCollections,
|
|
|
|
|
const std::string& master, const boost::filesystem::path& resDir,
|
|
|
|
|
bool newGame, Environment& environment, const std::string& encoding, std::vector<std::string> fallbackPairs)
|
|
|
|
|
bool newGame, Environment& environment, const std::string& encoding, std::map<std::string,std::string> fallbackMap)
|
|
|
|
|
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
|
|
|
|
|
mSky (true), mEnvironment (environment), mNextDynamicRecord (0), mCells (mStore, mEsm, *this),
|
|
|
|
|
mNumFacing(0)
|
|
|
|
@ -221,7 +206,8 @@ namespace MWWorld
|
|
|
|
|
|
|
|
|
|
mWorldScene = new Scene(environment, this, *mRendering, mPhysics);
|
|
|
|
|
|
|
|
|
|
setFallbackValues(fallbackPairs);
|
|
|
|
|
setFallbackValues(fallbackMap);
|
|
|
|
|
std::cout << "Weather_Sunrise_Time=" << getFallback("Weather_Sunrise_Time") << std::endl;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|