From 3c55fd316fb1e9203744fd520c9553eedb15a348 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 17 Sep 2003 23:05:07 +0000 Subject: cleanup svn-id: r10284 --- base/gameDetector.cpp | 10 ++-------- base/gameDetector.h | 25 ------------------------- base/plugins.cpp | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 33 deletions(-) (limited to 'base') 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; -- cgit v1.2.3