Adding debug messages for 1180

This commit is contained in:
konstin
2014-03-06 20:30:52 +01:00
parent 9ddd5a2d5c
commit f7953f4f12
2 changed files with 17 additions and 8 deletions

View File

@@ -401,8 +401,9 @@ void cmdLineHelp()
" and the music.\n"
" -t, --track=NAME Start at track NAME.\n"
" --gp=NAME Start the specified Grand Prix.\n"
" --add-gp-dir=DIR Load Grand Prixs in DIR. Setting will be saved "
"in config.xml\n"
" --add-gp-dir=DIR Load Grand Prix in DIR. Setting will be saved "
"inconfig.xml under additional_gp_directory. Use "
"--add-gp-dir=\"\" to unset.\n"
" --stk-config=FILE use ./data/FILE instead of "
"./data/stk_config.xml\n"
" -k, --numkarts=NUM Number of karts on the racetrack.\n"

View File

@@ -28,8 +28,9 @@ GrandPrixManager *grand_prix_manager = NULL;
GrandPrixManager::GrandPrixManager()
{
// Findout which grand prixs are available and load them
// Grand Prix in the standart directory
std::set<std::string> result;
std::string gp_dir = file_manager->getAsset(FileManager::GRANDPRIX,"");
std::string gp_dir = file_manager->getAsset(FileManager::GRANDPRIX, "");
file_manager->listFiles(result, gp_dir);
for(std::set<std::string>::iterator i = result.begin();
i != result.end() ; i++)
@@ -39,6 +40,8 @@ GrandPrixManager::GrandPrixManager()
try
{
m_gp_data.push_back(new GrandPrixData(*i));
Log::debug("GrandPrixManager", "Grand Prix %s loaded.",
i->c_str());
}
catch (std::logic_error& e)
{
@@ -48,9 +51,11 @@ GrandPrixManager::GrandPrixManager()
}
}
// Load additional Grand Prixs
// Load additional Grand Prix
const std::string dir = UserConfigParams::m_additional_gp_directory;
if(dir != "") {
Log::info("GrandPrixManager", "Loading additional Grand Prix from "
"%s ...", dir.c_str());
file_manager->listFiles(result, dir);
for(std::set<std::string>::iterator i = result.begin();
i != result.end() ; i++)
@@ -59,16 +64,19 @@ GrandPrixManager::GrandPrixManager()
{
try
{
m_gp_data.push_back(new GrandPrixData(dir, *i));
m_gp_data.push_back(new GrandPrixData(dir, *i));
Log::debug("GrandPrixManager", "Grand Prix %s loaded from "
"%s", i->c_str(),
dir.c_str());
}
catch (std::logic_error& e)
{
Log::error("GrandPrixManager", "Ignoring GP %s ( %s ) \n",
i->c_str(), e.what());
i->c_str(), e.what());
}
}
}
}
} // end for
} // end if
} // GrandPrixManager
// ----------------------------------------------------------------------------
GrandPrixManager::~GrandPrixManager()