[Scummvm-cvs-logs] CVS: scummvm/backends/dc dcmain.cpp,1.31,1.32 selector.cpp,1.26,1.27

Marcus Comstedt marcus_c at users.sourceforge.net
Wed Apr 27 15:01:44 CEST 2005


Update of /cvsroot/scummvm/scummvm/backends/dc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23777

Modified Files:
	dcmain.cpp selector.cpp 
Log Message:
Slightly more elegant LauncherDialog connector.

Index: dcmain.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/dcmain.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- dcmain.cpp	22 Apr 2005 21:30:07 -0000	1.31
+++ dcmain.cpp	27 Apr 2005 21:58:21 -0000	1.32
@@ -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 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;
 }

Index: selector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/selector.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- selector.cpp	6 Dec 2004 15:44:37 -0000	1.26
+++ selector.cpp	27 Apr 2005 21:58:21 -0000	1.27
@@ -468,9 +468,7 @@
     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;





More information about the Scummvm-git-logs mailing list