diff options
| -rw-r--r-- | backends/dc/DCLauncherDialog.h | 31 | ||||
| -rw-r--r-- | backends/dc/dcmain.cpp | 22 | ||||
| -rw-r--r-- | base/main.cpp | 12 | 
3 files changed, 55 insertions, 10 deletions
| diff --git a/backends/dc/DCLauncherDialog.h b/backends/dc/DCLauncherDialog.h new file mode 100644 index 0000000000..e1a54ab506 --- /dev/null +++ b/backends/dc/DCLauncherDialog.h @@ -0,0 +1,31 @@ +/* ScummVM - Scumm Interpreter + * Dreamcast port + * Copyright (C) 2002-2004  Marcus Comstedt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. + * + * $Header$ + * + */ + +class DCLauncherDialog { + private: +  GameDetector &_detector; + + public: +  DCLauncherDialog(GameDetector &d) : _detector(d) {} +  int runModal(); +}; + diff --git a/backends/dc/dcmain.cpp b/backends/dc/dcmain.cpp index 3d35133a38..73d71a29f9 100644 --- a/backends/dc/dcmain.cpp +++ b/backends/dc/dcmain.cpp @@ -30,6 +30,7 @@  #include <base/plugins.h>  #include "dc.h"  #include "icon.h" +#include "DCLauncherDialog.h"  Icon icon; @@ -202,20 +203,27 @@ void dc_init_hardware()  extern "C" int scummvm_main(int argc, char *argv[]);  int main()  { -  static char *argv[] = { "scummvm", NULL, NULL, NULL }; -  static int argc = 3; +  static char *argv[] = { "scummvm", NULL, }; +  static int argc = 1;    dc_init_hardware();    initSound(); -  PluginManager::instance().loadPlugins(); +  scummvm_main(argc, argv); + +  exit(0); +} + +int DCLauncherDialog::runModal() +{ +  static char *argv[] = { "scummvm", NULL, NULL, NULL }; +  static int argc = 3;    if(!selectGame(argv[2], argv[1], icon))      exit(0); -  PluginManager::instance().unloadPlugins(); +  _detector.parseCommandLine(argc, argv); -  scummvm_main(argc, argv); - -  exit(0); +  return 0;  } + diff --git a/base/main.cpp b/base/main.cpp index 10c914991e..749d62a5fa 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -45,6 +45,10 @@  #include "backends/wince/CELauncherDialog.h"   #endif +#ifdef __DC__ +#include "backends/dc/DCLauncherDialog.h" +#endif +  /*   * Version string and build date string. These can be used by anything that   * wants to display this information to the user (e.g. about dialog). @@ -214,10 +218,12 @@ static int launcherDialog(GameDetector &detector, OSystem *system) {  	system->setPalette(dummy_palette, 0, 16); -#ifndef _WIN32_WCE -	GUI::LauncherDialog dlg(detector); -#else +#if defined(_WIN32_WCE)  	CELauncherDialog dlg(detector); +#elif defined(__DC__) +	DCLauncherDialog dlg(detector); +#else +	GUI::LauncherDialog dlg(detector);  #endif  	return dlg.runModal();  } | 
