diff options
author | Marcus Comstedt | 2004-08-26 21:51:26 +0000 |
---|---|---|
committer | Marcus Comstedt | 2004-08-26 21:51:26 +0000 |
commit | 77026760c8f76dbd28c81f1804c5c172ff70e2b8 (patch) | |
tree | 55a481392e1a410760a52d241402cbd4f2585e1e /backends/dc | |
parent | fa89ee800aafcfd59d9e64ed27fbbabf9372dd11 (diff) | |
download | scummvm-rg350-77026760c8f76dbd28c81f1804c5c172ff70e2b8.tar.gz scummvm-rg350-77026760c8f76dbd28c81f1804c5c172ff70e2b8.tar.bz2 scummvm-rg350-77026760c8f76dbd28c81f1804c5c172ff70e2b8.zip |
Run the DC launcher from inside the regular main() function.
svn-id: r14787
Diffstat (limited to 'backends/dc')
-rw-r--r-- | backends/dc/DCLauncherDialog.h | 31 | ||||
-rw-r--r-- | backends/dc/dcmain.cpp | 22 |
2 files changed, 46 insertions, 7 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; } + |