mirror of
https://github.com/libretro/scummvm.git
synced 2024-11-27 19:30:41 +00:00
Turned the last remaining few GameDetector methods into static methods
svn-id: r22344
This commit is contained in:
parent
c319e97246
commit
6321cfc874
@ -22,11 +22,8 @@
|
||||
*/
|
||||
|
||||
class DCLauncherDialog {
|
||||
private:
|
||||
GameDetector &_detector;
|
||||
|
||||
public:
|
||||
DCLauncherDialog(GameDetector &d) : _detector(d) {}
|
||||
DCLauncherDialog() {}
|
||||
int runModal();
|
||||
};
|
||||
|
||||
|
@ -224,7 +224,7 @@ int DCLauncherDialog::runModal()
|
||||
ConfMan.set("path", dir, base);
|
||||
|
||||
// Set the target.
|
||||
_detector.setTarget(base);
|
||||
GameDetector::setTarget(base);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user