1180 Loading Grand Prix's from locale directory
This commit is contained in:
parent
c09a3172f1
commit
b561f440ba
@ -144,6 +144,48 @@ void PlayerManager::deletePlayer(PlayerProfile *player)
|
|||||||
m_all_players.erase(player);
|
m_all_players.erase(player);
|
||||||
} // deletePlayer
|
} // deletePlayer
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
/** This function makes sure that a current player is defined. This is called
|
||||||
|
* when a screen skipping command line option is given (-N, -R, ...), in
|
||||||
|
* which case there might not be a current player (if no default player is
|
||||||
|
* set in players.xml, i.e. the 'remember be' option was not picked ). Since
|
||||||
|
* a lot of code depends on having a local player, just set the most
|
||||||
|
* frequently used non-guest to be the current player.
|
||||||
|
*/
|
||||||
|
void PlayerManager::enforceCurrentPlayer()
|
||||||
|
{
|
||||||
|
if (m_current_player) return;
|
||||||
|
|
||||||
|
PlayerProfile *player;
|
||||||
|
for_in(player, m_all_players)
|
||||||
|
{
|
||||||
|
if (!player->isGuestAccount())
|
||||||
|
{
|
||||||
|
Log::info("PlayerManager", "Enfocring current player '%ls'.",
|
||||||
|
player->getName().c_str() );
|
||||||
|
m_current_player = player;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} // for player in m_all_players
|
||||||
|
|
||||||
|
// This shouldn't happen - but just in case: add the default players
|
||||||
|
// again, and search again for a non-guest player.
|
||||||
|
addDefaultPlayer();
|
||||||
|
for_in(player, m_all_players)
|
||||||
|
{
|
||||||
|
if (!player->isGuestAccount())
|
||||||
|
{
|
||||||
|
Log::info("PlayerManager", "Enfocring current player '%s'.",
|
||||||
|
player->getName().c_str());
|
||||||
|
m_current_player = player;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} // for player in m_all_players
|
||||||
|
|
||||||
|
// Now this really really should not happen.
|
||||||
|
Log::fatal("PlayerManager", "Failed to find a non-guest player.");
|
||||||
|
} // enforceCurrentPlayer
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/** Called when no player profiles exists. It creates two players: one
|
/** Called when no player profiles exists. It creates two players: one
|
||||||
* guest player, and one non-guest player for whic hit tries to guess a
|
* guest player, and one non-guest player for whic hit tries to guess a
|
||||||
|
@ -78,6 +78,7 @@ public:
|
|||||||
void deletePlayer(PlayerProfile *player);
|
void deletePlayer(PlayerProfile *player);
|
||||||
void setCurrentPlayer(PlayerProfile *player, bool remember_me);
|
void setCurrentPlayer(PlayerProfile *player, bool remember_me);
|
||||||
const PlayerProfile *getPlayerById(unsigned int id);
|
const PlayerProfile *getPlayerById(unsigned int id);
|
||||||
|
void enforceCurrentPlayer();
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
/** Returns the current player. */
|
/** Returns the current player. */
|
||||||
PlayerProfile* getCurrentPlayer() { return m_current_player; }
|
PlayerProfile* getCurrentPlayer() { return m_current_player; }
|
||||||
|
@ -398,46 +398,46 @@ namespace UserConfigParams
|
|||||||
"Always put the player at the back or not (Bully mode).") );
|
"Always put the player at the back or not (Bully mode).") );
|
||||||
PARAM_PREFIX StringUserConfigParam m_additional_gp_directory
|
PARAM_PREFIX StringUserConfigParam m_additional_gp_directory
|
||||||
PARAM_DEFAULT( StringUserConfigParam("", "additional_gp_directory",
|
PARAM_DEFAULT( StringUserConfigParam("", "additional_gp_directory",
|
||||||
"Directory with additional GP's."));
|
"Directory with additional GP's."));
|
||||||
|
|
||||||
// ---- Video
|
// ---- Video
|
||||||
PARAM_PREFIX GroupUserConfigParam m_video_group
|
PARAM_PREFIX GroupUserConfigParam m_video_group
|
||||||
PARAM_DEFAULT( GroupUserConfigParam("Video", "Video Settings") );
|
PARAM_DEFAULT( GroupUserConfigParam("Video", "Video Settings") );
|
||||||
|
|
||||||
PARAM_PREFIX IntUserConfigParam m_width
|
PARAM_PREFIX IntUserConfigParam m_width
|
||||||
PARAM_DEFAULT( IntUserConfigParam(1024, "width", &m_video_group,
|
PARAM_DEFAULT( IntUserConfigParam(1024, "width", &m_video_group,
|
||||||
"Screen/window width in pixels") );
|
"Screen/window width in pixels") );
|
||||||
PARAM_PREFIX IntUserConfigParam m_height
|
PARAM_PREFIX IntUserConfigParam m_height
|
||||||
PARAM_DEFAULT( IntUserConfigParam(768, "height", &m_video_group,
|
PARAM_DEFAULT( IntUserConfigParam(768, "height", &m_video_group,
|
||||||
"Screen/window height in pixels") );
|
"Screen/window height in pixels") );
|
||||||
PARAM_PREFIX BoolUserConfigParam m_fullscreen
|
PARAM_PREFIX BoolUserConfigParam m_fullscreen
|
||||||
PARAM_DEFAULT( BoolUserConfigParam(false, "fullscreen",
|
PARAM_DEFAULT( BoolUserConfigParam(false, "fullscreen",
|
||||||
&m_video_group) );
|
&m_video_group) );
|
||||||
PARAM_PREFIX IntUserConfigParam m_prev_width
|
PARAM_PREFIX IntUserConfigParam m_prev_width
|
||||||
PARAM_DEFAULT( IntUserConfigParam(1024, "prev_width",
|
PARAM_DEFAULT( IntUserConfigParam(1024, "prev_width",
|
||||||
&m_video_group, "Previous screen/window width") );
|
&m_video_group, "Previous screen/window width") );
|
||||||
PARAM_PREFIX IntUserConfigParam m_prev_height
|
PARAM_PREFIX IntUserConfigParam m_prev_height
|
||||||
PARAM_DEFAULT( IntUserConfigParam(768, "prev_height",
|
PARAM_DEFAULT( IntUserConfigParam(768, "prev_height",
|
||||||
&m_video_group,"Previous screen/window height") );
|
&m_video_group,"Previous screen/window height") );
|
||||||
PARAM_PREFIX BoolUserConfigParam m_prev_fullscreen
|
PARAM_PREFIX BoolUserConfigParam m_prev_fullscreen
|
||||||
PARAM_DEFAULT( BoolUserConfigParam(false, "prev_fullscreen",
|
PARAM_DEFAULT( BoolUserConfigParam(false, "prev_fullscreen",
|
||||||
&m_video_group) );
|
&m_video_group) );
|
||||||
|
|
||||||
|
|
||||||
PARAM_PREFIX BoolUserConfigParam m_remember_window_location
|
PARAM_PREFIX BoolUserConfigParam m_remember_window_location
|
||||||
PARAM_DEFAULT( BoolUserConfigParam(false, "remember_window_location",
|
PARAM_DEFAULT( BoolUserConfigParam(false, "remember_window_location",
|
||||||
&m_video_group) );
|
&m_video_group) );
|
||||||
PARAM_PREFIX IntUserConfigParam m_window_x
|
PARAM_PREFIX IntUserConfigParam m_window_x
|
||||||
PARAM_DEFAULT( IntUserConfigParam(-1, "window_x",
|
PARAM_DEFAULT( IntUserConfigParam(-1, "window_x",
|
||||||
&m_video_group,"If remember_window_location is true") );
|
&m_video_group,"If remember_window_location is true") );
|
||||||
PARAM_PREFIX IntUserConfigParam m_window_y
|
PARAM_PREFIX IntUserConfigParam m_window_y
|
||||||
PARAM_DEFAULT( IntUserConfigParam(-1, "window_y",
|
PARAM_DEFAULT( IntUserConfigParam(-1, "window_y",
|
||||||
&m_video_group,"If remember_window_location is true") );
|
&m_video_group,"If remember_window_location is true") );
|
||||||
|
|
||||||
PARAM_PREFIX BoolUserConfigParam m_display_fps
|
PARAM_PREFIX BoolUserConfigParam m_display_fps
|
||||||
PARAM_DEFAULT( BoolUserConfigParam(false, "show_fps",
|
PARAM_DEFAULT( BoolUserConfigParam(false, "show_fps",
|
||||||
&m_video_group, "Display frame per seconds") );
|
&m_video_group, "Display frame per seconds") );
|
||||||
PARAM_PREFIX IntUserConfigParam m_max_fps
|
PARAM_PREFIX IntUserConfigParam m_max_fps
|
||||||
PARAM_DEFAULT( IntUserConfigParam(120, "max_fps",
|
PARAM_DEFAULT( IntUserConfigParam(120, "max_fps",
|
||||||
&m_video_group, "Maximum fps, should be at least 60") );
|
&m_video_group, "Maximum fps, should be at least 60") );
|
||||||
|
|
||||||
|
135
src/main.cpp
135
src/main.cpp
@ -392,21 +392,19 @@ void cmdLineHelp()
|
|||||||
{
|
{
|
||||||
Log::info("main",
|
Log::info("main",
|
||||||
"Usage: %s [OPTIONS]\n\n"
|
"Usage: %s [OPTIONS]\n\n"
|
||||||
|
|
||||||
"Run SuperTuxKart, a racing game with go-kart that features"
|
"Run SuperTuxKart, a racing game with go-kart that features"
|
||||||
" the Tux and friends.\n\n"
|
" the Tux and friends.\n\n"
|
||||||
|
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" -N, --no-start-screen Immediately start race without showing a "
|
" -N, --no-start-screen Immediately start race without showing a "
|
||||||
"menu.\n"
|
"menu.\n"
|
||||||
" -R, --race-now Same as -N but also skip the ready-set-go phase "
|
" -R, --race-now Same as -N but also skip the ready-set-go phase"
|
||||||
"and the music.\n"
|
" and the music.\n"
|
||||||
" -t, --track=NAME Start at track NAME.\n"
|
" -t, --track=NAME Start at track NAME.\n"
|
||||||
" --gp=NAME Start the specified Grand Prix.\n"
|
" --gp=NAME Start the specified Grand Prix.\n"
|
||||||
" --stk-config=FILE use ./data/FILE instead of "
|
|
||||||
"./data/stk_config.xml\n"
|
|
||||||
" --add-gp-dir=DIR Load Grand Prixs in DIR. Setting will be saved "
|
" --add-gp-dir=DIR Load Grand Prixs in DIR. Setting will be saved "
|
||||||
"in config.xml\n"
|
"in config.xml\n"
|
||||||
|
" --stk-config=FILE use ./data/FILE instead of "
|
||||||
|
"./data/stk_config.xml\n"
|
||||||
" -k, --numkarts=NUM Number of karts on the racetrack.\n"
|
" -k, --numkarts=NUM Number of karts on the racetrack.\n"
|
||||||
" --kart=NAME Use kart number NAME.\n"
|
" --kart=NAME Use kart number NAME.\n"
|
||||||
" --ai=a,b,... Use the karts a, b, ... for the AI.\n"
|
" --ai=a,b,... Use the karts a, b, ... for the AI.\n"
|
||||||
@ -471,7 +469,8 @@ int handleCmdLinePreliminary()
|
|||||||
cmdLineHelp();
|
cmdLineHelp();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
if( CommandLine::has("--gamepad-visualisation") )
|
if( CommandLine::has("--gamepad-visualisation") ||
|
||||||
|
CommandLine::has("--gamepad-visualization") )
|
||||||
UserConfigParams::m_gamepad_visualisation=true;
|
UserConfigParams::m_gamepad_visualisation=true;
|
||||||
if( CommandLine::has("--debug=memory"))
|
if( CommandLine::has("--debug=memory"))
|
||||||
UserConfigParams::m_verbosity |= UserConfigParams::LOG_MEMORY;
|
UserConfigParams::m_verbosity |= UserConfigParams::LOG_MEMORY;
|
||||||
@ -501,15 +500,15 @@ int handleCmdLinePreliminary()
|
|||||||
if( CommandLine::has( "--stk-config", &s))
|
if( CommandLine::has( "--stk-config", &s))
|
||||||
{
|
{
|
||||||
stk_config->load(file_manager->getAsset(s));
|
stk_config->load(file_manager->getAsset(s));
|
||||||
Log::info("main", "STK config will be read from %s.", s.c_str());
|
Log::info("main", "STK config will be read from %s.",s.c_str());
|
||||||
}
|
}
|
||||||
if( CommandLine::has( "--trackdir", &s))
|
if( CommandLine::has( "--trackdir", &s))
|
||||||
TrackManager::addTrackSearchDir(s);
|
TrackManager::addTrackSearchDir(s);
|
||||||
if( CommandLine::has( "--kartdir", &s))
|
if( CommandLine::has( "--kartdir", &s))
|
||||||
KartPropertiesManager::addKartSearchDir(s);
|
KartPropertiesManager::addKartSearchDir(s);
|
||||||
|
|
||||||
if( CommandLine::has("--no-graphics") ||
|
if( CommandLine::has( "--no-graphics") ||
|
||||||
CommandLine::has("-l" ) )
|
CommandLine::has("-l" ) )
|
||||||
{
|
{
|
||||||
ProfileWorld::disableGraphics();
|
ProfileWorld::disableGraphics();
|
||||||
UserConfigParams::m_log_errors_to_console=true;
|
UserConfigParams::m_log_errors_to_console=true;
|
||||||
@ -542,14 +541,13 @@ int handleCmdLinePreliminary()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Log::warn("main", "Resolution %s has been blacklisted, so "
|
Log::warn("main", "Resolution %s has been blacklisted, so "
|
||||||
"it is not available!", res.c_str());
|
"it is not available!", res.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log::fatal("main", "Error: --screensize argument must be given as "
|
Log::fatal("main", "Error: --screensize argument must be "
|
||||||
"WIDTHxHEIGHT");
|
"given as WIDTHxHEIGHT");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -586,13 +584,7 @@ int handleCmdLinePreliminary()
|
|||||||
IRRLICHT_VERSION_REVISION, IRRLICHT_SDK_VERSION );
|
IRRLICHT_VERSION_REVISION, IRRLICHT_SDK_VERSION );
|
||||||
Log::info("main", "==============================");
|
Log::info("main", "==============================");
|
||||||
} // --verbose or -v
|
} // --verbose or -v
|
||||||
|
|
||||||
int n;
|
|
||||||
if(CommandLine::has("--xmas", &n))
|
|
||||||
UserConfigParams::m_xmas_mode = n;
|
|
||||||
if(CommandLine::has("--log", &n))
|
|
||||||
Log::setLogLevel(n);
|
|
||||||
|
|
||||||
// Enable loading GP's from local directory
|
// Enable loading GP's from local directory
|
||||||
if(CommandLine::has("--add-gp-dir", &s))
|
if(CommandLine::has("--add-gp-dir", &s))
|
||||||
{
|
{
|
||||||
@ -602,10 +594,16 @@ int handleCmdLinePreliminary()
|
|||||||
else
|
else
|
||||||
UserConfigParams::m_additional_gp_directory = s + "/";
|
UserConfigParams::m_additional_gp_directory = s + "/";
|
||||||
|
|
||||||
Log::info("main", "Additional Grand Prix will be loaded from %s",
|
Log::info("main", "Additional Grand Prix's will be loaded from %s",
|
||||||
UserConfigParams::m_additional_gp_directory.c_str());
|
UserConfigParams::m_additional_gp_directory.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int n;
|
||||||
|
if(CommandLine::has("--xmas", &n))
|
||||||
|
UserConfigParams::m_xmas_mode = n;
|
||||||
|
if(CommandLine::has("--log", &n))
|
||||||
|
Log::setLogLevel(n);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} // handleCmdLinePreliminary
|
} // handleCmdLinePreliminary
|
||||||
|
|
||||||
@ -1078,18 +1076,43 @@ void initRest()
|
|||||||
} // initRest
|
} // initRest
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
#ifdef BREAKPAD
|
void askForInternetPermission()
|
||||||
bool ShowDumpResults(const wchar_t* dump_path,
|
|
||||||
const wchar_t* minidump_id,
|
|
||||||
void* context,
|
|
||||||
EXCEPTION_POINTERS* exinfo,
|
|
||||||
MDRawAssertionInfo* assertion,
|
|
||||||
bool succeeded)
|
|
||||||
{
|
{
|
||||||
wprintf(L"Path: %s id %s.\n", dump_path, minidump_id);
|
if (UserConfigParams::m_internet_status ==
|
||||||
return succeeded;
|
Online::RequestManager::IPERM_NOT_ASKED)
|
||||||
}
|
{
|
||||||
#endif
|
class ConfirmServer :
|
||||||
|
public MessageDialog::IConfirmDialogListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void onConfirm()
|
||||||
|
{
|
||||||
|
UserConfigParams::m_internet_status =
|
||||||
|
Online::RequestManager::IPERM_ALLOWED;
|
||||||
|
GUIEngine::ModalDialog::dismiss();
|
||||||
|
} // onConfirm
|
||||||
|
// --------------------------------------------------------
|
||||||
|
virtual void onCancel()
|
||||||
|
{
|
||||||
|
UserConfigParams::m_internet_status =
|
||||||
|
Online::RequestManager::IPERM_NOT_ALLOWED;
|
||||||
|
GUIEngine::ModalDialog::dismiss();
|
||||||
|
} // onCancel
|
||||||
|
}; // ConfirmServer
|
||||||
|
|
||||||
|
new MessageDialog(_("SuperTuxKart may connect to a server "
|
||||||
|
"to download add-ons and notify you of updates. Would you "
|
||||||
|
"like this feature to be enabled? (To change this setting "
|
||||||
|
"at a later time, go to options, select tab "
|
||||||
|
"'User Interface', and edit \"Allow STK to connect to the "
|
||||||
|
"Internet\")."),
|
||||||
|
MessageDialog::MESSAGE_DIALOG_CONFIRM,
|
||||||
|
new ConfirmServer(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // askForInternetPermission
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
#if defined(DEBUG) && defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(DEBUG) && defined(WIN32) && !defined(__CYGWIN__)
|
||||||
#pragma comment(linker, "/SUBSYSTEM:console")
|
#pragma comment(linker, "/SUBSYSTEM:console")
|
||||||
@ -1098,10 +1121,6 @@ bool ShowDumpResults(const wchar_t* dump_path,
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
int main(int argc, char *argv[] )
|
int main(int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
#ifdef BREAKPAD
|
|
||||||
google_breakpad::ExceptionHandler eh(L"C:\\Temp", NULL, ShowDumpResults,
|
|
||||||
NULL, google_breakpad::ExceptionHandler::HANDLER_ALL);
|
|
||||||
#endif
|
|
||||||
CommandLine::init(argc, argv);
|
CommandLine::init(argc, argv);
|
||||||
|
|
||||||
CrashReporting::installHandlers();
|
CrashReporting::installHandlers();
|
||||||
@ -1161,8 +1180,7 @@ int main(int argc, char *argv[] )
|
|||||||
// Both item_manager and powerup_manager load models and therefore
|
// Both item_manager and powerup_manager load models and therefore
|
||||||
// textures from the model directory. To avoid reading the
|
// textures from the model directory. To avoid reading the
|
||||||
// materials.xml twice, we do this here once for both:
|
// materials.xml twice, we do this here once for both:
|
||||||
file_manager->pushTextureSearchPath(file_manager->getAsset(
|
file_manager->pushTextureSearchPath(file_manager->getAsset(FileManager::MODEL,""));
|
||||||
FileManager::MODEL,""));
|
|
||||||
const std::string materials_file =
|
const std::string materials_file =
|
||||||
file_manager->getAsset(FileManager::MODEL,"materials.xml");
|
file_manager->getAsset(FileManager::MODEL,"materials.xml");
|
||||||
if(materials_file!="")
|
if(materials_file!="")
|
||||||
@ -1227,40 +1245,15 @@ int main(int argc, char *argv[] )
|
|||||||
wiimote_manager->askUserToConnectWiimotes();
|
wiimote_manager->askUserToConnectWiimotes();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(UserConfigParams::m_internet_status ==
|
askForInternetPermission();
|
||||||
Online::RequestManager::IPERM_NOT_ASKED)
|
|
||||||
{
|
|
||||||
class ConfirmServer :
|
|
||||||
public MessageDialog::IConfirmDialogListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void onConfirm()
|
|
||||||
{
|
|
||||||
UserConfigParams::m_internet_status =
|
|
||||||
Online::RequestManager::IPERM_ALLOWED;
|
|
||||||
GUIEngine::ModalDialog::dismiss();
|
|
||||||
} // onConfirm
|
|
||||||
// --------------------------------------------------------
|
|
||||||
virtual void onCancel()
|
|
||||||
{
|
|
||||||
UserConfigParams::m_internet_status =
|
|
||||||
Online::RequestManager::IPERM_NOT_ALLOWED;
|
|
||||||
GUIEngine::ModalDialog::dismiss();
|
|
||||||
} // onCancel
|
|
||||||
}; // ConfirmServer
|
|
||||||
|
|
||||||
new MessageDialog(_("SuperTuxKart may connect to a server "
|
|
||||||
"to download add-ons and notify you of updates. Would you "
|
|
||||||
"like this feature to be enabled? (To change this setting "
|
|
||||||
"at a later time, go to options, select tab "
|
|
||||||
"'User Interface', and edit \"Allow STK to connect to the "
|
|
||||||
"Internet\")."),
|
|
||||||
MessageDialog::MESSAGE_DIALOG_CONFIRM,
|
|
||||||
new ConfirmServer(), true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Skip the start screen. This esp. means that no login screen is
|
||||||
|
// displayed (if necessary), so we have to make sure there is
|
||||||
|
// a current player
|
||||||
|
PlayerManager::get()->enforceCurrentPlayer();
|
||||||
|
|
||||||
InputDevice *device;
|
InputDevice *device;
|
||||||
|
|
||||||
// Use keyboard 0 by default in --no-start-screen
|
// Use keyboard 0 by default in --no-start-screen
|
||||||
|
@ -37,10 +37,14 @@ GrandPrixManager::GrandPrixManager()
|
|||||||
if (StringUtils::hasSuffix(*i, ".grandprix"))
|
if (StringUtils::hasSuffix(*i, ".grandprix"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{ m_gp_data.push_back(new GrandPrixData(*i)); }
|
{
|
||||||
catch (std::logic_error& er)
|
m_gp_data.push_back(new GrandPrixData(*i));
|
||||||
{ Log::error("GrandPrixManager", "Ignoring GP %s ( %s ) \n",
|
}
|
||||||
i->c_str(), er.what()); }
|
catch (std::logic_error& e)
|
||||||
|
{
|
||||||
|
Log::error("GrandPrixManager", "Ignoring GP %s ( %s ) \n",
|
||||||
|
i->c_str(), e.what());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,10 +58,14 @@ GrandPrixManager::GrandPrixManager()
|
|||||||
if (StringUtils::hasSuffix(*i, ".grandprix"))
|
if (StringUtils::hasSuffix(*i, ".grandprix"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{ m_gp_data.push_back(new GrandPrixData(dir, *i)); }
|
{
|
||||||
catch (std::logic_error& er)
|
m_gp_data.push_back(new GrandPrixData(dir, *i));
|
||||||
{ Log::error("GrandPrixManager", "Ignoring GP %s ( %s ) \n",
|
}
|
||||||
i->c_str(), er.what()); }
|
catch (std::logic_error& e)
|
||||||
|
{
|
||||||
|
Log::error("GrandPrixManager", "Ignoring GP %s ( %s ) \n",
|
||||||
|
i->c_str(), e.what());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,10 @@ private:
|
|||||||
public:
|
public:
|
||||||
GrandPrixManager();
|
GrandPrixManager();
|
||||||
~GrandPrixManager();
|
~GrandPrixManager();
|
||||||
const GrandPrixData* getGrandPrix(int i) const {return m_gp_data[i]; }
|
void load(const std::string &filename);
|
||||||
|
const GrandPrixData* getGrandPrix(int i) const { return m_gp_data[i]; }
|
||||||
const GrandPrixData* getGrandPrix(const std::string& s) const;
|
const GrandPrixData* getGrandPrix(const std::string& s) const;
|
||||||
unsigned int getNumberOfGrandPrix() const {return m_gp_data.size();}
|
unsigned int getNumberOfGrandPrix() const { return m_gp_data.size(); }
|
||||||
void checkConsistency();
|
void checkConsistency();
|
||||||
|
|
||||||
}; // GrandPrixManager
|
}; // GrandPrixManager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user