aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Comstedt2005-04-27 21:58:21 +0000
committerMarcus Comstedt2005-04-27 21:58:21 +0000
commit925c69797dd0f4a76e91ed2903abee02d6e311b7 (patch)
tree6039ef544fd090a2269dbd865075daa2f2db9a18
parentf95e696034d038d5fc0e7cc1d4a2e795b2ed02ed (diff)
downloadscummvm-rg350-925c69797dd0f4a76e91ed2903abee02d6e311b7.tar.gz
scummvm-rg350-925c69797dd0f4a76e91ed2903abee02d6e311b7.tar.bz2
scummvm-rg350-925c69797dd0f4a76e91ed2903abee02d6e311b7.zip
Slightly more elegant LauncherDialog connector.
svn-id: r17844
-rw-r--r--backends/dc/dcmain.cpp16
-rw-r--r--backends/dc/selector.cpp4
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;