diff options
-rw-r--r-- | backends/dc/dcmain.cpp | 16 | ||||
-rw-r--r-- | backends/dc/selector.cpp | 4 |
2 files changed, 7 insertions, 13 deletions
diff --git a/backends/dc/dcmain.cpp b/backends/dc/dcmain.cpp index d925be0747..8512af7ff1 100644 --- a/backends/dc/dcmain.cpp +++ b/backends/dc/dcmain.cpp @@ -31,6 +31,7 @@ #include "dc.h" #include "icon.h" #include "DCLauncherDialog.h" +#include <common/config-manager.h> Icon icon; @@ -217,22 +218,17 @@ int main() int DCLauncherDialog::runModal() { - static char *argv[] = { "scummvm", NULL, NULL, NULL }; - static int argc = 3; + char *base = NULL, *dir = NULL; - if(!selectGame(argv[2], argv[1], icon)) + if(!selectGame(base, dir, icon)) exit(0); - FIXME: This is an evil hack: - _detector.parseCommandLine(argc, argv); - - But doing it properly isn't that hard, actually: - // Set the game path. - ConfMan.set("path", the_desired_path, kTransientDomain); + if(dir != NULL) + ConfMan.set("path", dir, Common::ConfigManager::kTransientDomain); // Set the target. - _detector.setTarget(target_name); + _detector.setTarget(base); return 0; } diff --git a/backends/dc/selector.cpp b/backends/dc/selector.cpp index 358f7fd382..cb65e465b2 100644 --- a/backends/dc/selector.cpp +++ b/backends/dc/selector.cpp @@ -468,9 +468,7 @@ bool selectGame(char *&ret, char *&dir_ret, Icon &icon) chdir(the_game.dir); #else chdir("/"); - static char dirarg[258]; - sprintf(dirarg, "-p%s", the_game.dir); - dir_ret = dirarg; + dir_ret = the_game.dir; #endif ret = the_game.filename_base; icon = the_game.icon; |