[Scummvm-cvs-logs] SF.net SVN: scummvm: [25156] scummvm/trunk/engines

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Jan 21 21:24:39 CET 2007


Revision: 25156
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25156&view=rev
Author:   sev
Date:     2007-01-21 12:24:38 -0800 (Sun, 21 Jan 2007)

Log Message:
-----------
Reduce dependency from common/advancedDetector.h

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.cpp
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agi/detection.cpp
    scummvm/trunk/engines/agi/id.cpp
    scummvm/trunk/engines/cine/cine.h
    scummvm/trunk/engines/cine/detection.cpp
    scummvm/trunk/engines/parallaction/detection.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/saga/game.cpp
    scummvm/trunk/engines/saga/rscfile.cpp
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/saga/sagagame.h

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/agi/agi.cpp	2007-01-21 20:24:38 UTC (rev 25156)
@@ -441,12 +441,12 @@
 
 	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);

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/agi/agi.h	2007-01-21 20:24:38 UTC (rev 25156)
@@ -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,14 +110,8 @@
 
 };
 
-struct AGIGameDescription {
-	Common::ADGameDescription desc;
+struct AGIGameDescription;
 
-	int gameType;
-	uint32 features;
-	uint16 version;
-};
-
 enum {
 	NO_GAMEDIR = 0,
 	GAMEDIR
@@ -531,6 +524,8 @@
 	}
 
 	const AGIGameDescription *_gameDescription;
+	uint32 getFeatures() const;
+	uint16 getVersion() const;
 
 private:
 

Modified: scummvm/trunk/engines/agi/detection.cpp
===================================================================
--- scummvm/trunk/engines/agi/detection.cpp	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/agi/detection.cpp	2007-01-21 20:24:38 UTC (rev 25156)
@@ -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 @@
 	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\xEF \xBDulumaa (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\xEF \xBDparables (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"),

Modified: scummvm/trunk/engines/agi/id.cpp
===================================================================
--- scummvm/trunk/engines/agi/id.cpp	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/agi/id.cpp	2007-01-21 20:24:38 UTC (rev 25156)
@@ -32,7 +32,7 @@
 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::v3IdGame() {
 	int ver;
 
-	ver = _gameDescription->version;
+	ver = getVersion();
 	_game.ver = ver;
 	debugC(2, kDebugLevelMain, "game.ver = 0x%x", _game.ver);
 	agiSetRelease(ver);

Modified: scummvm/trunk/engines/cine/cine.h
===================================================================
--- scummvm/trunk/engines/cine/cine.h	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/cine/cine.h	2007-01-21 20:24:38 UTC (rev 25156)
@@ -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,13 +58,8 @@
 	GF_ALT_FONT = 1 << 2
 };
 
-struct CINEGameDescription {
-	Common::ADGameDescription desc;
+struct CINEGameDescription;
 
-	int gameType;
-	uint32 features;
-};
-
 class CineEngine : public Engine {
 
 protected:
@@ -79,10 +73,10 @@
 	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);

Modified: scummvm/trunk/engines/cine/detection.cpp
===================================================================
--- scummvm/trunk/engines/cine/detection.cpp	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/cine/detection.cpp	2007-01-21 20:24:38 UTC (rev 25156)
@@ -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);
 }
 

Modified: scummvm/trunk/engines/parallaction/detection.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/detection.cpp	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/parallaction/detection.cpp	2007-01-21 20:24:38 UTC (rev 25156)
@@ -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);
 }
 

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-01-21 20:24:38 UTC (rev 25156)
@@ -26,7 +26,6 @@
 #include "engines/engine.h"
 #include "parallaction/defs.h"
 #include "parallaction/inventory.h"
-#include "common/advancedDetector.h"
 
 
 namespace Parallaction {
@@ -59,13 +58,8 @@
 	GType_BRA
 };
 
-struct PARALLACTIONGameDescription {
-	Common::ADGameDescription desc;
+struct PARALLACTIONGameDescription;
 
-	int gameType;
-	uint32 features;
-};
-
 struct Job;
 typedef void (*JobFn)(void*, Job*);
 
@@ -226,10 +220,10 @@
 	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;

Modified: scummvm/trunk/engines/saga/game.cpp
===================================================================
--- scummvm/trunk/engines/saga/game.cpp	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/saga/game.cpp	2007-01-21 20:24:38 UTC (rev 25156)
@@ -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);
 }
 

Modified: scummvm/trunk/engines/saga/rscfile.cpp
===================================================================
--- scummvm/trunk/engines/saga/rscfile.cpp	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/saga/rscfile.cpp	2007-01-21 20:24:38 UTC (rev 25156)
@@ -34,6 +34,8 @@
 #include "saga/sndres.h"
 #include "saga/stream.h"
 
+#include "common/advancedDetector.h"
+
 namespace Saga {
 
 struct MacResMap {
@@ -317,8 +319,8 @@
 	}
 
 	//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 @@
 	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 @@
 	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

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/saga/saga.h	2007-01-21 20:24:38 UTC (rev 25156)
@@ -31,8 +31,11 @@
 
 #include "saga/gfx.h"
 #include "saga/list.h"
-#include "common/advancedDetector.h"
 
+namespace Common {
+struct ADGameFileDescription;
+}
+
 namespace Saga {
 
 class SndRes;
@@ -247,7 +250,6 @@
 	return (type << OBJECT_TYPE_SHIFT) | (OBJECT_TYPE_MASK & index);
 }
 
-
 class SagaEngine : public Engine {
 	friend class Scene;
 
@@ -372,30 +374,30 @@
 
 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; }
+	const bool isBigEndian() const;
+	const bool isMacResources() const;
+	const GameResourceDescription *getResourceDescription();
+	const GameSoundInfo *getVoiceInfo() const;
+	const GameSoundInfo *getSfxInfo() const;
+	const GameSoundInfo *getMusicInfo() const;
 
-	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 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; }
 	int getDisplayHeight() const { return _gameDisplayInfo.logicalHeight;}

Modified: scummvm/trunk/engines/saga/sagagame.h
===================================================================
--- scummvm/trunk/engines/saga/sagagame.h	2007-01-21 17:14:53 UTC (rev 25155)
+++ scummvm/trunk/engines/saga/sagagame.h	2007-01-21 20:24:38 UTC (rev 25156)
@@ -326,22 +326,6 @@
 	const GameSoundInfo *soundInfo;
 };
 
-struct SAGAGameDescription {
-	Common::ADGameDescription desc;
+struct SAGAGameDescription;
 
-	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;
-};
-
 #define FILE_MD5_BYTES 5000


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list