aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2006-05-04 22:52:18 +0000
committerMax Horn2006-05-04 22:52:18 +0000
commit6321cfc874ee95b9b2471783a18f4173fb60ab78 (patch)
treed656ceb19a97ef038c61390e316aa6d50e63c6dc
parentc319e972467beb3b824af01bc707ea225c38572e (diff)
downloadscummvm-rg350-6321cfc874ee95b9b2471783a18f4173fb60ab78.tar.gz
scummvm-rg350-6321cfc874ee95b9b2471783a18f4173fb60ab78.tar.bz2
scummvm-rg350-6321cfc874ee95b9b2471783a18f4173fb60ab78.zip
Turned the last remaining few GameDetector methods into static methods
svn-id: r22344
-rw-r--r--backends/dc/DCLauncherDialog.h5
-rw-r--r--backends/dc/dcmain.cpp2
-rw-r--r--backends/dc/selector.cpp1
-rw-r--r--backends/morphos/morphos_start.cpp1
-rw-r--r--backends/wince/CELauncherDialog.cpp2
-rw-r--r--backends/wince/CELauncherDialog.h3
-rw-r--r--base/gameDetector.h6
-rw-r--r--base/main.cpp17
-rw-r--r--gui/launcher.cpp6
-rw-r--r--gui/launcher.h5
10 files changed, 19 insertions, 29 deletions
diff --git a/backends/dc/DCLauncherDialog.h b/backends/dc/DCLauncherDialog.h
index aa35ff90fe..7dffcaa576 100644
--- a/backends/dc/DCLauncherDialog.h
+++ b/backends/dc/DCLauncherDialog.h
@@ -22,11 +22,8 @@
*/
class DCLauncherDialog {
- private:
- GameDetector &_detector;
-
public:
- DCLauncherDialog(GameDetector &d) : _detector(d) {}
+ DCLauncherDialog() {}
int runModal();
};
diff --git a/backends/dc/dcmain.cpp b/backends/dc/dcmain.cpp
index 1d82deb46d..67081533b3 100644
--- a/backends/dc/dcmain.cpp
+++ b/backends/dc/dcmain.cpp
@@ -224,7 +224,7 @@ int DCLauncherDialog::runModal()
ConfMan.set("path", dir, base);
// Set the target.
- _detector.setTarget(base);
+ GameDetector::setTarget(base);
return 0;
}
diff --git a/backends/dc/selector.cpp b/backends/dc/selector.cpp
index bd9086431d..ade5cb9fc4 100644
--- a/backends/dc/selector.cpp
+++ b/backends/dc/selector.cpp
@@ -24,7 +24,6 @@
#include <common/stdafx.h>
#include <common/scummsys.h>
#include <base/engine.h>
-#include <base/gameDetector.h>
#include <base/plugins.h>
#include <backends/fs/fs.h>
#include "dc.h"
diff --git a/backends/morphos/morphos_start.cpp b/backends/morphos/morphos_start.cpp
index 82c57be7bc..ac5c16ad85 100644
--- a/backends/morphos/morphos_start.cpp
+++ b/backends/morphos/morphos_start.cpp
@@ -36,7 +36,6 @@
#include "common/stdafx.h"
#include "scumm/scumm.h"
-#include "base/gameDetector.h"
#include "base/main.h"
#include "common/scaler.h"
#include "sound/mididrv.h"
diff --git a/backends/wince/CELauncherDialog.cpp b/backends/wince/CELauncherDialog.cpp
index 90675fb3da..243b5e5ea3 100644
--- a/backends/wince/CELauncherDialog.cpp
+++ b/backends/wince/CELauncherDialog.cpp
@@ -72,7 +72,7 @@ public:
};
-CELauncherDialog::CELauncherDialog(GameDetector &detector) : GUI::LauncherDialog(detector) {
+CELauncherDialog::CELauncherDialog() : GUI::LauncherDialog() {
}
void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
diff --git a/backends/wince/CELauncherDialog.h b/backends/wince/CELauncherDialog.h
index f612b53b97..7cb54a3f56 100644
--- a/backends/wince/CELauncherDialog.h
+++ b/backends/wince/CELauncherDialog.h
@@ -25,14 +25,13 @@
#include "backends/fs/fs.h"
-#include "base/gameDetector.h"
#include "base/plugins.h"
#include "gui/launcher.h"
class CELauncherDialog : public GUI::LauncherDialog {
public:
- CELauncherDialog(GameDetector &detector);
+ CELauncherDialog();
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
protected:
void addGame();
diff --git a/base/gameDetector.h b/base/gameDetector.h
index ebb642b57d..48714a73d3 100644
--- a/base/gameDetector.h
+++ b/base/gameDetector.h
@@ -38,14 +38,14 @@ public:
GameDetector();
static Common::String parseCommandLine(Common::StringMap &settings, int argc, char **argv);
- void processSettings(Common::String &target, Common::StringMap &settings);
- const Plugin *detectMain();
+ static void processSettings(Common::String &target, Common::StringMap &settings);
+ static const Plugin *detectMain();
public:
static GameDescriptor findGame(const String &gameName, const Plugin **plugin = NULL);
//protected:
- void setTarget(const String &name); // TODO: This should be protected
+ static void setTarget(const String &name); // TODO: This should be protected
};
#endif
diff --git a/base/main.cpp b/base/main.cpp
index a3c24ed30c..8ea0dd2688 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -137,7 +137,7 @@ static void setupDummyPalette(OSystem &system) {
system.setPalette(dummy_palette, 0, 16);
}
-static bool launcherDialog(GameDetector &detector, OSystem &system) {
+static bool launcherDialog(OSystem &system) {
system.beginGFXTransaction();
// Set the user specified graphics mode (if any).
@@ -155,11 +155,11 @@ static bool launcherDialog(GameDetector &detector, OSystem &system) {
setupDummyPalette(system);
#if defined(_WIN32_WCE)
- CELauncherDialog dlg(detector);
+ CELauncherDialog dlg;
#elif defined(__DC__)
- DCLauncherDialog dlg(detector);
+ DCLauncherDialog dlg;
#else
- GUI::LauncherDialog dlg(detector);
+ GUI::LauncherDialog dlg;
#endif
return (dlg.runModal() != -1);
}
@@ -380,8 +380,7 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
// Process the remaining command line settings
- GameDetector detector;
- detector.processSettings(command, settings);
+ GameDetector::processSettings(command, settings);
#if defined(__SYMBIAN32__) || defined(_WIN32_WCE)
// init keymap support here: we wanna move this somewhere else?
@@ -408,7 +407,7 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
// Unless a game was specified, show the launcher dialog
if (ConfMan.getActiveDomainName().empty()) {
- running = launcherDialog(detector, system);
+ running = launcherDialog(system);
// Discard any command line options. Those that affect the graphics
// mode etc. already have should have been handled by the backend at
@@ -422,7 +421,7 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
// cleanly, so this is now enabled to encourage people to fix bits :)
while (running) {
// Verify the given game name is a valid supported game
- const Plugin *plugin = detector.detectMain();
+ const Plugin *plugin = GameDetector::detectMain();
if (plugin) {
// Unload all plugins not needed for this game,
// to save memory
@@ -442,7 +441,7 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
PluginManager::instance().loadPlugins();
}
- running = launcherDialog(detector, system);
+ running = launcherDialog(system);
}
// Deinit the timer
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 86e8ad926b..73f74924a0 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -434,8 +434,8 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
#pragma mark -
-LauncherDialog::LauncherDialog(GameDetector &detector)
- : Dialog(0, 0, 320, 200), _detector(detector) {
+LauncherDialog::LauncherDialog()
+ : Dialog(0, 0, 320, 200) {
_drawingHints |= THEME_HINT_MAIN_DIALOG;
const int screenW = g_system->getOverlayWidth();
@@ -737,7 +737,7 @@ void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
case kListItemDoubleClickedCmd:
// Print out what was selected
assert(item >= 0);
- _detector.setTarget(_domains[item]);
+ GameDetector::setTarget(_domains[item]);
close();
break;
case kListSelectionChangedCmd:
diff --git a/gui/launcher.h b/gui/launcher.h
index b5320937c4..7b456a2dbd 100644
--- a/gui/launcher.h
+++ b/gui/launcher.h
@@ -25,8 +25,6 @@
#include "gui/dialog.h"
#include "common/str.h"
-class GameDetector;
-
namespace GUI {
class BrowserDialog;
@@ -37,7 +35,7 @@ class LauncherDialog : public Dialog {
typedef Common::String String;
typedef Common::StringList StringList;
public:
- LauncherDialog(GameDetector &detector);
+ LauncherDialog();
~LauncherDialog();
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
@@ -51,7 +49,6 @@ protected:
GraphicsWidget *_logo;
#endif
StringList _domains;
- GameDetector &_detector;
BrowserDialog *_browser;
virtual void handleScreenChanged();