From: Brad A. <br...@us...> - 2012-02-10 21:07:53
|
gemrb: Infinity Engine emulator The branch master has been updated via ebe6d2ffe6498a3a7fe8e49658696f8546466cf9 (commit) Summary of changes: gemrb/core/Interface.cpp | 35 +++++++++++++---------------------- 1 files changed, 13 insertions(+), 22 deletions(-) from 7fbcad7d3cac1694911bfe49b583c91ad0cdb86f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=ebe6d2ffe6498a3a7fe8e49658696f8546466cf9 commit ebe6d2ffe6498a3a7fe8e49658696f8546466cf9 Author: Brad Allred <bra...@me...> Date: Fri Feb 10 14:06:43 2012 -0700 Revert accidentially pushed commit 3d60c339ad352c32279d95fc5e10aede8ff180fa Revert "Interface: add ability to run GemRB without a config via new -g GamePath parameter." This reverts commit 3d60c339ad352c32279d95fc5e10aede8ff180fa. diff --git a/gemrb/core/Interface.cpp b/gemrb/core/Interface.cpp index c5d38b3..9795d36 100644 --- a/gemrb/core/Interface.cpp +++ b/gemrb/core/Interface.cpp @@ -1492,30 +1492,11 @@ int Interface::Init() printStatus( "OK", LIGHT_GREEN ); - const char* argConfigPath = NULL; - const char* argGamePath = NULL; - for (int i=1; i < (argc - 1); i++) { - print("processing arg:%s\n", argv[i]); - if (strcmp("-c", argv[i]) == 0) { // config path - argConfigPath = argv[++i]; - continue; - } - if (strcmp("-g", argv[i]) == 0) { // GamePath - argGamePath = argv[++i]; - continue; - } - printMessage("Core", "Unknown argument:%s\n", YELLOW, argv[i]); - } - print("-c=%s, -g=%s\n", argConfigPath, argGamePath); - - if ((argConfigPath && !LoadConfig(argConfigPath)) || !LoadConfig()) { + if (!LoadConfig()) { printMessage( "Core", "Could not load config file ", YELLOW); - printStatus( "WARNING", LIGHT_RED ); - } - if (argGamePath) { - strncpy(GamePath, argGamePath, sizeof(GamePath)); + printStatus( "ERROR", LIGHT_RED ); + return GEM_ERROR; } - printMessage( "Core", "Starting Plugin Manager...\n", WHITE ); PluginMgr *plugin = PluginMgr::Get(); #if TARGET_OS_MAC @@ -2235,6 +2216,16 @@ bool Interface::LoadConfig(void) //if (!name[0]) // FIXME: could this happen? // strcpy (name, PACKAGE); // ugly hack + // If we were called as $0 -c <filename>, load config from filename + if (argc > 2 && ! strcmp("-c", argv[1])) { + if (LoadConfig( argv[2] )) { + return true; + } else { + // Explicitly specified cfg file HAS to be present + return false; + } + } + // FIXME: temporary hack, to be deleted?? if (LoadConfig( "GemRB.cfg" )) { return true; ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |