diff options
author | Eugene Sandulenko | 2007-01-21 20:24:38 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2007-01-21 20:24:38 +0000 |
commit | d3b0ff8ade3a147aa3ce78399fd66fb340b07584 (patch) | |
tree | e0a8429b516c22e364bca025cd30604f905615b5 /engines | |
parent | 01a5faa6a0ba89b7f774efe33839a077eeaa5f9d (diff) | |
download | scummvm-rg350-d3b0ff8ade3a147aa3ce78399fd66fb340b07584.tar.gz scummvm-rg350-d3b0ff8ade3a147aa3ce78399fd66fb340b07584.tar.bz2 scummvm-rg350-d3b0ff8ade3a147aa3ce78399fd66fb340b07584.zip |
Reduce dependency from common/advancedDetector.h
svn-id: r25156
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/agi.cpp | 8 | ||||
-rw-r--r-- | engines/agi/agi.h | 11 | ||||
-rw-r--r-- | engines/agi/detection.cpp | 21 | ||||
-rw-r--r-- | engines/agi/id.cpp | 4 | ||||
-rw-r--r-- | engines/cine/cine.h | 16 | ||||
-rw-r--r-- | engines/cine/detection.cpp | 13 | ||||
-rw-r--r-- | engines/parallaction/detection.cpp | 13 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 16 | ||||
-rw-r--r-- | engines/saga/game.cpp | 43 | ||||
-rw-r--r-- | engines/saga/rscfile.cpp | 12 | ||||
-rw-r--r-- | engines/saga/saga.h | 48 | ||||
-rw-r--r-- | engines/saga/sagagame.h | 18 |
12 files changed, 140 insertions, 83 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 17fc74db90..b1888e362e 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -441,12 +441,12 @@ int AgiEngine::agiDetectGame() { assert(_gameDescription != NULL); - _opt.amigaMode = ((_gameDescription->features & AGI_AMIGA) == AGI_AMIGA); - _opt.agdsMode = ((_gameDescription->features & AGI_AGDS) == AGI_AGDS); - _opt.agimouse = ((_gameDescription->features & AGI_MOUSE) == AGI_MOUSE); + _opt.amigaMode = ((getFeatures() & AGI_AMIGA) == AGI_AMIGA); + _opt.agdsMode = ((getFeatures() & AGI_AGDS) == AGI_AGDS); + _opt.agimouse = ((getFeatures() & AGI_MOUSE) == AGI_MOUSE); - if(_gameDescription->version <= 0x2999) { + if(getVersion() <= 0x2999) { _loader = new AgiLoader_v2(this); } else { _loader = new AgiLoader_v3(this); diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 6d58d5944b..6b2f4d98c4 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -29,7 +29,6 @@ #include "common/scummsys.h" #include "common/endian.h" #include "common/util.h" -#include "common/advancedDetector.h" #include "common/file.h" #include "common/savefile.h" #include "common/system.h" @@ -111,13 +110,7 @@ enum AgiGameFeatures { }; -struct AGIGameDescription { - Common::ADGameDescription desc; - - int gameType; - uint32 features; - uint16 version; -}; +struct AGIGameDescription; enum { NO_GAMEDIR = 0, @@ -531,6 +524,8 @@ public: } const AGIGameDescription *_gameDescription; + uint32 getFeatures() const; + uint16 getVersion() const; private: diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 1b4e35fea4..a5e320631d 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -31,6 +31,23 @@ namespace Agi { + +struct AGIGameDescription { + Common::ADGameDescription desc; + + int gameType; + uint32 features; + uint16 version; +}; + +uint32 AgiEngine::getFeatures() const { + return _gameDescription->features; +} + +uint16 AgiEngine::getVersion() const { + return _gameDescription->version; +} + static GameList GAME_detectGames(const FSList &fslist); } @@ -834,12 +851,12 @@ static const AGIGameDescription gameDescriptions[] = { FANMADE("Journey Of Chef", "aa0a0b5a6364801ae65fdb96d6741df5"), FANMADE("Jukebox (v1.0)", "c4b9c5528cc67f6ba777033830de7751"), FANMADE("Justin Quest (v1.0 in development)", "103050989da7e0ffdc1c5e1793a4e1ec"), - FANMADE("J�ulumaa (v0.05) (Estonian)", "53982ecbfb907e41392b3961ad1c3475"), + FANMADE("Jï ½ulumaa (v0.05) (Estonian)", "53982ecbfb907e41392b3961ad1c3475"), FANMADE("Kings Quest 2 - Breast Intentions (v2.0)", "6b4f796d0421d2e12e501b511962e03a"), FANMADE("Lasse Holm: The Quest for Revenge (v1.0)", "f9fbcc8a4ef510bfbb92423296ff4abb"), FANMADE("Lawman for Hire", "c78b28bfd3767dd455b992cd8b7854fa"), FANMADE("Lefty Goes on Vacation (Not in The Right Place)", "ccdc49a33870310b01f2c48b8a1f3c34"), - FANMADE("Les Ins�parables (v1.0)", "4b780887cab0ecabc5eca319acb3acf2"), + FANMADE("Les Insï ½parables (v1.0)", "4b780887cab0ecabc5eca319acb3acf2"), FANMADE("Little Pirate (Demo 2 v0.6)", "437068efe4ec32d436da09d6f2ea56e1"), FANMADE("Lost Eternity (v1.0)", "95f15c5632feb8a39e9ca3d9af35fcc9"), FANMADE("MD Quest - The Search for Michiel (v0.10)", "2a6fcb21d2b5e4144c38ed817fabe8ee"), diff --git a/engines/agi/id.cpp b/engines/agi/id.cpp index 2875974faf..2bcaf4e2d5 100644 --- a/engines/agi/id.cpp +++ b/engines/agi/id.cpp @@ -32,7 +32,7 @@ namespace Agi { int AgiEngine::v2IdGame() { int ver; - ver = _gameDescription->version; + ver = getVersion(); _game.ver = ver; debugC(2, kDebugLevelMain, "game.ver = 0x%x", _game.ver); agiSetRelease(ver); @@ -51,7 +51,7 @@ int AgiEngine::v2IdGame() { int AgiEngine::v3IdGame() { int ver; - ver = _gameDescription->version; + ver = getVersion(); _game.ver = ver; debugC(2, kDebugLevelMain, "game.ver = 0x%x", _game.ver); agiSetRelease(ver); diff --git a/engines/cine/cine.h b/engines/cine/cine.h index db1c32f4a8..4646850a93 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -28,7 +28,6 @@ #include "common/stdafx.h" #include "common/scummsys.h" #include "common/util.h" -#include "common/advancedDetector.h" #include "engines/engine.h" @@ -59,12 +58,7 @@ enum CineGameFeatures { GF_ALT_FONT = 1 << 2 }; -struct CINEGameDescription { - Common::ADGameDescription desc; - - int gameType; - uint32 features; -}; +struct CINEGameDescription; class CineEngine : public Engine { @@ -79,10 +73,10 @@ public: CineEngine(OSystem *syst); virtual ~CineEngine(); - int getGameType() const { return _gameDescription->gameType; } - uint32 getFeatures() const { return _gameDescription->features; } - Common::Language getLanguage() const { return _gameDescription->desc.language; } - Common::Platform getPlatform() const { return _gameDescription->desc.platform; } + int getGameType() const; + uint32 getFeatures() const; + Common::Language getLanguage() const; + Common::Platform getPlatform() const; bool loadSaveDirectory(void); void makeSystemMenu(void); diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 1a4df5ce00..f4bbcd58dc 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -32,6 +32,19 @@ #include "cine/cine.h" namespace Cine { +struct CINEGameDescription { + Common::ADGameDescription desc; + + int gameType; + uint32 features; +}; + +int CineEngine::getGameType() const { return _gameDescription->gameType; } +uint32 CineEngine::getFeatures() const { return _gameDescription->features; } +Common::Language CineEngine::getLanguage() const { return _gameDescription->desc.language; } +Common::Platform CineEngine::getPlatform() const { return _gameDescription->desc.platform; } + + static GameList GAME_detectGames(const FSList &fslist); } diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 3f51f7c834..d3faefe31c 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -30,6 +30,19 @@ #include "parallaction/parallaction.h" namespace Parallaction { + +struct PARALLACTIONGameDescription { + Common::ADGameDescription desc; + + int gameType; + uint32 features; +}; + +int Parallaction::getGameType() const { return _gameDescription->gameType; } +uint32 Parallaction::getFeatures() const { return _gameDescription->features; } +Common::Language Parallaction::getLanguage() const { return _gameDescription->desc.language; } +Common::Platform Parallaction::getPlatform() const { return _gameDescription->desc.platform; } + static GameList GAME_detectGames(const FSList &fslist); } diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index fee8c6cba5..c55da285a1 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -26,7 +26,6 @@ #include "engines/engine.h" #include "parallaction/defs.h" #include "parallaction/inventory.h" -#include "common/advancedDetector.h" namespace Parallaction { @@ -59,12 +58,7 @@ enum ParallactionGameType { GType_BRA }; -struct PARALLACTIONGameDescription { - Common::ADGameDescription desc; - - int gameType; - uint32 features; -}; +struct PARALLACTIONGameDescription; struct Job; typedef void (*JobFn)(void*, Job*); @@ -226,10 +220,10 @@ public: void changeCharacter(const char *name); public: - int getGameType() const { return _gameDescription->gameType; } - uint32 getFeatures() const { return _gameDescription->features; } - Common::Language getLanguage() const { return _gameDescription->desc.language; } - Common::Platform getPlatform() const { return _gameDescription->desc.platform; } + int getGameType() const; + uint32 getFeatures() const; + Common::Language getLanguage() const; + Common::Platform getPlatform() const; private: const PARALLACTIONGameDescription *_gameDescription; diff --git a/engines/saga/game.cpp b/engines/saga/game.cpp index 1ecaa09bbf..76f16591b4 100644 --- a/engines/saga/game.cpp +++ b/engines/saga/game.cpp @@ -39,6 +39,49 @@ namespace Saga { +struct SAGAGameDescription { + Common::ADGameDescription desc; + + int gameType; + int gameId; + uint32 features; + const GameDisplayInfo *gameDisplayInfo; + int startSceneNumber; + const GameResourceDescription *resourceDescription; + int fontsCount; + const GameFontDescription *fontDescriptions; + const GameSoundInfo *voiceInfo; + const GameSoundInfo *sfxInfo; + const GameSoundInfo *musicInfo; + int patchesCount; + const GamePatchDescription *patchDescriptions; +}; + +const bool SagaEngine::isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; } +const bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); } +const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; } +const GameSoundInfo *SagaEngine::getVoiceInfo() const { return _gameDescription->voiceInfo; } +const GameSoundInfo *SagaEngine::getSfxInfo() const { return _gameDescription->sfxInfo; } +const GameSoundInfo *SagaEngine::getMusicInfo() const { return _gameDescription->musicInfo; } + +const GameFontDescription *SagaEngine::getFontDescription(int index) { + assert(index < _gameDescription->fontsCount); + return &_gameDescription->fontDescriptions[index]; +} +int SagaEngine::getFontsCount() const { return _gameDescription->fontsCount; } + +int SagaEngine::getGameId() const { return _gameDescription->gameId; } +int SagaEngine::getGameType() const { return _gameDescription->gameType; } +uint32 SagaEngine::getFeatures() const { return _gameDescription->features; } +Common::Language SagaEngine::getLanguage() const { return _gameDescription->desc.language; } +Common::Platform SagaEngine::getPlatform() const { return _gameDescription->desc.platform; } +int SagaEngine::getGameNumber() const { return _gameNumber; } +int SagaEngine::getStartSceneNumber() const { return _gameDescription->startSceneNumber; } + +int SagaEngine::getPatchesCount() const { return _gameDescription->patchesCount; } +const GamePatchDescription *SagaEngine::getPatchDescriptions() const { return _gameDescription->patchDescriptions; } +const Common::ADGameFileDescription *SagaEngine::getFilesDescriptions() const { return _gameDescription->desc.filesDescriptions; } + static GameList GAME_detectGames(const FSList &fslist); } diff --git a/engines/saga/rscfile.cpp b/engines/saga/rscfile.cpp index 3d1061f377..225963df64 100644 --- a/engines/saga/rscfile.cpp +++ b/engines/saga/rscfile.cpp @@ -34,6 +34,8 @@ #include "saga/sndres.h" #include "saga/stream.h" +#include "common/advancedDetector.h" + namespace Saga { struct MacResMap { @@ -317,8 +319,8 @@ bool Resource::loadContext(ResourceContext *context) { } //process external patch files - for (j = 0; j < _vm->getGameDescription()->patchesCount; j++) { - patchDescription = &_vm->getGameDescription()->patchDescriptions[j]; + for (j = 0; j < _vm->getPatchesCount(); j++) { + patchDescription = &_vm->getPatchDescriptions()[j]; if ((patchDescription->fileType & context->fileType) != 0) { if (patchDescription->resourceId < context->count) { resourceData = &context->table[patchDescription->resourceId]; @@ -342,7 +344,7 @@ bool Resource::createContexts() { ResourceContext *context; _contextsCount = 0; - for (i = 0; _vm->getGameDescription()->desc.filesDescriptions[i].fileName; i++) + for (i = 0; _vm->getFilesDescriptions()[i].fileName; i++) _contextsCount++; _contexts = (ResourceContext*)calloc(_contextsCount, sizeof(*_contexts)); @@ -350,8 +352,8 @@ bool Resource::createContexts() { for (i = 0; i < _contextsCount; i++) { context = &_contexts[i]; context->file = new Common::File(); - context->fileName = _vm->getGameDescription()->desc.filesDescriptions[i].fileName; - context->fileType = _vm->getGameDescription()->desc.filesDescriptions[i].fileType; + context->fileName = _vm->getFilesDescriptions()[i].fileName; + context->fileType = _vm->getFilesDescriptions()[i].fileType; context->serial = 0; // IHNM has serveral different voice files, so we need to allow diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 4d26c960d7..42ec768580 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -31,7 +31,10 @@ #include "saga/gfx.h" #include "saga/list.h" -#include "common/advancedDetector.h" + +namespace Common { +struct ADGameFileDescription; +} namespace Saga { @@ -247,7 +250,6 @@ inline uint16 objectIndexToId(int type, int index) { return (type << OBJECT_TYPE_SHIFT) | (OBJECT_TYPE_MASK & index); } - class SagaEngine : public Engine { friend class Scene; @@ -372,29 +374,29 @@ public: public: bool initGame(void); -public: - const SAGAGameDescription *getGameDescription() const { return _gameDescription; } - const bool isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; } - const bool isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); } - const GameResourceDescription *getResourceDescription() { return _gameDescription->resourceDescription; } - const GameSoundInfo *getVoiceInfo() const { return _gameDescription->voiceInfo; } - const GameSoundInfo *getSfxInfo() const { return _gameDescription->sfxInfo; } - const GameSoundInfo *getMusicInfo() const { return _gameDescription->musicInfo; } - - const GameFontDescription *getFontDescription(int index) { - assert(index < _gameDescription->fontsCount); - return &_gameDescription->fontDescriptions[index]; - } - int getFontsCount() const { return _gameDescription->fontsCount; } - int getGameId() const { return _gameDescription->gameId; } - int getGameType() const { return _gameDescription->gameType; } - uint32 getFeatures() const { return _gameDescription->features; } - Common::Language getLanguage() const { return _gameDescription->desc.language; } - Common::Platform getPlatform() const { return _gameDescription->desc.platform; } - int getGameNumber() const { return _gameNumber; } - int getStartSceneNumber() const { return _gameDescription->startSceneNumber; } + const bool isBigEndian() const; + const bool isMacResources() const; + const GameResourceDescription *getResourceDescription(); + const GameSoundInfo *getVoiceInfo() const; + const GameSoundInfo *getSfxInfo() const; + const GameSoundInfo *getMusicInfo() const; + + const GameFontDescription *getFontDescription(int index); + int getFontsCount() const; + + int getGameId() const; + int getGameType() const; + uint32 getFeatures() const; + Common::Language getLanguage() const; + Common::Platform getPlatform() const; + int getGameNumber() const; + int getStartSceneNumber() const; + + int getPatchesCount() const; + const GamePatchDescription *getPatchDescriptions() const; + const Common::ADGameFileDescription *getFilesDescriptions() const; const Common::Rect &getDisplayClip() const { return _displayClip;} int getDisplayWidth() const { return _gameDisplayInfo.logicalWidth; } diff --git a/engines/saga/sagagame.h b/engines/saga/sagagame.h index 08cf23bb51..593ad30ecb 100644 --- a/engines/saga/sagagame.h +++ b/engines/saga/sagagame.h @@ -326,22 +326,6 @@ struct GamePatchDescription { const GameSoundInfo *soundInfo; }; -struct SAGAGameDescription { - Common::ADGameDescription desc; - - int gameType; - int gameId; - uint32 features; - const GameDisplayInfo *gameDisplayInfo; - int startSceneNumber; - const GameResourceDescription *resourceDescription; - int fontsCount; - const GameFontDescription *fontDescriptions; - const GameSoundInfo *voiceInfo; - const GameSoundInfo *sfxInfo; - const GameSoundInfo *musicInfo; - int patchesCount; - const GamePatchDescription *patchDescriptions; -}; +struct SAGAGameDescription; #define FILE_MD5_BYTES 5000 |