aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/morphos/morphos_start.cpp2
-rw-r--r--base/gameDetector.cpp10
-rw-r--r--base/gameDetector.h25
-rw-r--r--base/plugins.cpp28
-rw-r--r--common/engine.h5
5 files changed, 36 insertions, 34 deletions
diff --git a/backends/morphos/morphos_start.cpp b/backends/morphos/morphos_start.cpp
index fafba9683c..9cb104fe26 100644
--- a/backends/morphos/morphos_start.cpp
+++ b/backends/morphos/morphos_start.cpp
@@ -71,7 +71,7 @@ Library *TimerBase = NULL;
OSystem_MorphOS *TheSystem = NULL;
-OSystem *OSystem_MorphOS_create(int game_id, int gfx_mode, bool full_screen)
+OSystem *OSystem_MorphOS_create(int gfx_mode, bool full_screen)
{
if (TheSystem)
delete TheSystem;
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index a7f468f4fa..02183415af 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -189,7 +189,6 @@ GameDetector::GameDetector() {
_gameDataPath = 0;
_gameTempo = 0;
_midi_driver = MD_AUTO;
- _game.id = 0;
_game.features = 0;
_plugin = 0;
@@ -632,7 +631,6 @@ bool GameDetector::parseMusicDriver(const char *s) {
bool GameDetector::detectGame() {
const TargetSettings *target;
const char *realGame, *basename;
- _game.id = 0;
_gameText.clear();
realGame = g_config->get("gameid");
@@ -726,7 +724,7 @@ OSystem *GameDetector::createSystem() {
#elif defined(X11_BACKEND)
return OSystem_X11_create();
#elif defined(__MORPHOS__)
- return OSystem_MorphOS_create(_game.id, _gfx_mode, _fullScreen);
+ return OSystem_MorphOS_create(_gfx_mode, _fullScreen);
#elif defined(_WIN32_WCE)
return OSystem_WINCE3_create();
#elif defined(MACOS_CARBON)
@@ -742,12 +740,8 @@ OSystem *GameDetector::createSystem() {
}
Engine *GameDetector::createEngine(OSystem *system) {
- Engine *engine = NULL;
-
assert(_plugin);
- engine = _plugin->createInstance(this, system);
-
- return engine;
+ return _plugin->createInstance(this, system);
}
int GameDetector::getMidiDriverType() {
diff --git a/base/gameDetector.h b/base/gameDetector.h
index 32eaf96630..f5c2afe6ba 100644
--- a/base/gameDetector.h
+++ b/base/gameDetector.h
@@ -102,31 +102,6 @@ struct Language {
typedef Engine *(*EngineFactory)(GameDetector *detector, OSystem *syst);
-// Factory functions => no need to include the specific classes
-// in this header. This serves two purposes:
-// 1) Clean seperation from the game modules (scumm, simon) and the generic code
-// 2) Faster (compiler doesn't have to parse lengthy header files)
-#ifndef DISABLE_SCUMM
-extern const TargetSettings *Engine_SCUMM_targetList();
-extern Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst);
-#endif
-
-#ifndef DISABLE_SIMON
-extern Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst);
-extern const TargetSettings *Engine_SIMON_targetList();
-#endif
-
-#ifndef DISABLE_SKY
-extern const TargetSettings *Engine_SKY_targetList();
-extern Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst);
-#endif
-
-#ifndef DISABLE_SWORD2
-extern const TargetSettings *Engine_SWORD2_targetList();
-extern Engine *Engine_SWORD2_create(GameDetector *detector, OSystem *syst);
-#endif
-
-
class GameDetector {
typedef ScummVM::String String;
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 174a097b4d..0b5b909558 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -25,6 +25,34 @@
#include "common/engine.h"
+// Factory functions => no need to include the specific classes
+// in this header. This serves two purposes:
+// 1) Clean seperation from the game modules (scumm, simon) and the generic code
+// 2) Faster (compiler doesn't have to parse lengthy header files)
+#ifndef DISABLE_SCUMM
+extern const TargetSettings *Engine_SCUMM_targetList();
+extern Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst);
+#endif
+
+#ifndef DISABLE_SIMON
+extern Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst);
+extern const TargetSettings *Engine_SIMON_targetList();
+#endif
+
+#ifndef DISABLE_SKY
+extern const TargetSettings *Engine_SKY_targetList();
+extern Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst);
+#endif
+
+#ifndef DISABLE_SWORD2
+extern const TargetSettings *Engine_SWORD2_targetList();
+extern Engine *Engine_SWORD2_create(GameDetector *detector, OSystem *syst);
+#endif
+
+
+#pragma mark -
+
+
PluginManager *g_pluginManager = 0;
diff --git a/common/engine.h b/common/engine.h
index 5bd4857cef..d62a4de3cd 100644
--- a/common/engine.h
+++ b/common/engine.h
@@ -28,6 +28,11 @@ extern const char *gScummVMVersion; // e.g. "0.4.1"
extern const char *gScummVMBuildDate; // e.g. "2003-06-24"
extern const char *gScummVMFullVersion; // e.g. "ScummVM 0.4.1 (2003-06-24)"
+// TODO: Get rid of these enums. Ideally, GIDs should be
+// 100% local to the module they are defined in. Right now
+// we can't make this change since some of the backends
+// and also gui/launcher.cpp contain tests on the GID.
+// Ideally, all those should be converted to something else.
enum GameId {
GID_SCUMM_FIRST = 1,
GID_SCUMM_LAST = GID_SCUMM_FIRST + 99,