[Scummvm-cvs-logs] CVS: scummvm/saga animation.h,1.38,1.39 game.cpp,1.115,1.116 gfx.cpp,1.68,1.69 ite_introproc.cpp,1.69,1.70 puzzle.cpp,1.16,1.17 saga.cpp,1.143,1.144 saga.h,1.131,1.132

Eugene Sandulenko sev at users.sourceforge.net
Thu Oct 13 17:58:47 CEST 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19822

Modified Files:
	animation.h game.cpp gfx.cpp ite_introproc.cpp puzzle.cpp 
	saga.cpp saga.h 
Log Message:
Add language and platform to game description and use that accross the source.
That eliminates GF_LANG_DE and GF_MAC_RESOURCES.


Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/animation.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- animation.h	3 Oct 2005 10:01:09 -0000	1.38
+++ animation.h	14 Oct 2005 00:56:52 -0000	1.39
@@ -161,7 +161,7 @@
 	}
 
 	bool isLongData() const {
-		if ((_vm->getGameType() == GType_ITE) && ((_vm->getFeatures() & GF_MAC_RESOURCES) == 0)) {
+		if ((_vm->getGameType() == GType_ITE) && (_vm->getPlatform() != Common::kPlatformMacintosh)) {
 			return false;
 		}
 		return true;

Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/game.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- game.cpp	11 Oct 2005 06:08:42 -0000	1.115
+++ game.cpp	14 Oct 2005 00:56:52 -0000	1.116
@@ -840,7 +840,6 @@
 	{ GID_IHNM_CD_DE, "2b9aea838f74b4eecfb29a8f205a2bd4", "voices6.res", false },
 	{ GID_IHNM_CD_DE, "8b09a196a52627cacb4eab13bfe0b2c3", "voicess.res", false },
 
-	// Reported
 	{ GID_IHNM_CD_ES, "0439083e3dfdc51b486071d45872ae52", "musicfm.res", false },
 	{ GID_IHNM_CD_ES, "80f875a1fb384160d1f4b27166eef583", "musicgm.res", false },
 	{ GID_IHNM_CD_ES, "58b79e61594779513c7f2d35509fa89e", "patch.re_", false },
@@ -882,6 +881,8 @@
 		0,
 		NULL,
 		0, // features
+		Common::EN_USA,
+		Common::kPlatformPC,
 	},
 
 	// Inherit the earth - MAC Demo version
@@ -902,7 +903,9 @@
 		&ITEMACDEMO_GameMusic,
 		ARRAYSIZE(ITEMacPatch_Files),
 		ITEMacPatch_Files,
-		GF_BIG_ENDIAN_DATA | GF_MAC_RESOURCES | GF_WYRMKEEP | GF_CD_FX | GF_SCENE_SUBSTITUTES
+		GF_BIG_ENDIAN_DATA | GF_WYRMKEEP | GF_CD_FX | GF_SCENE_SUBSTITUTES,
+		Common::EN_USA,
+		Common::kPlatformMacintosh,
 	},
 
 	// Inherit the earth - early MAC Demo version
@@ -923,7 +926,9 @@
 		&ITEMACCD_GameMusic,
 		ARRAYSIZE(ITEMacPatch_Files),
 		ITEMacPatch_Files,
-		GF_BIG_ENDIAN_DATA | GF_MAC_RESOURCES | GF_WYRMKEEP | GF_CD_FX
+		GF_BIG_ENDIAN_DATA | GF_WYRMKEEP | GF_CD_FX,
+		Common::EN_USA,
+		Common::kPlatformMacintosh,
 	},
 
 	// Inherit the earth - MAC CD Guild version
@@ -944,7 +949,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_BIG_ENDIAN_DATA | GF_MAC_RESOURCES | GF_CD_FX
+		GF_BIG_ENDIAN_DATA | GF_CD_FX,
+		Common::EN_USA,
+		Common::kPlatformMacintosh,
 	},
 
 	// Inherit the earth - MAC CD Wyrmkeep version
@@ -965,7 +972,9 @@
 		&ITEMACCD_GameMusic,
 		ARRAYSIZE(ITEMacPatch_Files),
 		ITEMacPatch_Files,
-		GF_BIG_ENDIAN_DATA | GF_MAC_RESOURCES | GF_WYRMKEEP | GF_CD_FX
+		GF_BIG_ENDIAN_DATA | GF_WYRMKEEP | GF_CD_FX,
+		Common::EN_USA,
+		Common::kPlatformMacintosh,
 	},
 
 	// Inherit the earth - Linux Demo version
@@ -987,7 +996,9 @@
 		&ITELINDEMO_GameMusic,
 		ARRAYSIZE(ITELinPatch_Files),
 		ITELinPatch_Files,
-		GF_WYRMKEEP | GF_CD_FX | GF_SCENE_SUBSTITUTES
+		GF_WYRMKEEP | GF_CD_FX | GF_SCENE_SUBSTITUTES,
+		Common::EN_USA,
+		Common::kPlatformPC,
 	},
 
 	// Inherit the earth - Win32 Demo version
@@ -1008,7 +1019,9 @@
 		NULL,
 		ARRAYSIZE(ITEWinPatch2_Files),
 		ITEWinPatch2_Files,
-		GF_WYRMKEEP | GF_CD_FX | GF_SCENE_SUBSTITUTES
+		GF_WYRMKEEP | GF_CD_FX | GF_SCENE_SUBSTITUTES,
+		Common::EN_USA,
+		Common::kPlatformWindows,
 	},
 
 	// Inherit the earth - early Win32 Demo version
@@ -1029,7 +1042,9 @@
 		NULL,
 		ARRAYSIZE(ITEWinPatch1_Files),
 		ITEWinPatch1_Files,
-		GF_WYRMKEEP | GF_CD_FX
+		GF_WYRMKEEP | GF_CD_FX,
+		Common::EN_USA,
+		Common::kPlatformWindows,
 	},
 
 	// Inherit the earth - Wyrmkeep combined Windows/Mac/Linux CD
@@ -1051,7 +1066,9 @@
 		&ITEMACCD_GameMusic,
 		0,
 		NULL,
-		GF_WYRMKEEP | GF_CD_FX
+		GF_WYRMKEEP | GF_CD_FX,
+		Common::EN_USA,
+		Common::kPlatformUnknown,
 	},
 
 	// Inherit the earth - Wyrmkeep Linux CD version
@@ -1074,7 +1091,9 @@
 		&ITEMACCD_GameMusic,
 		ARRAYSIZE(ITELinPatch_Files),
 		ITELinPatch_Files,
-		GF_WYRMKEEP | GF_CD_FX
+		GF_WYRMKEEP | GF_CD_FX,
+		Common::DE_DEU,
+		Common::kPlatformPC,
 	},
 
 	// Inherit the earth - Wyrmkeep Windows CD version
@@ -1096,7 +1115,9 @@
 		NULL,
 		ARRAYSIZE(ITEWinPatch1_Files),
 		ITEWinPatch1_Files,
-		GF_WYRMKEEP | GF_CD_FX
+		GF_WYRMKEEP | GF_CD_FX,
+		Common::EN_USA,
+		Common::kPlatformWindows,
 	},
 
 	// Inherit the earth - DOS CD version
@@ -1118,7 +1139,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_CD_FX
+		GF_CD_FX,
+		Common::EN_USA,
+		Common::kPlatformPC,
 	},
 
 	// Inherit the earth - DOS CD German version
@@ -1140,7 +1163,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_LANG_DE | GF_CD_FX
+		GF_CD_FX,
+		Common::DE_DEU,
+		Common::kPlatformPC,
 	},
 
 	// Inherit the earth - CD version
@@ -1148,7 +1173,7 @@
 		"ite",
 		GType_ITE,
 		GID_ITE_CD,
-		"Inherit the Earth (DOS/Win32 CD Version)",
+		"Inherit the Earth (DOS CD Version)",
 		&ITE_DisplayInfo,
 		ITE_DEFAULT_SCENE,
 		&ITE_Resources,
@@ -1161,7 +1186,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_CD_FX
+		GF_CD_FX,
+		Common::EN_USA,
+		Common::kPlatformPC,
 	},
 
 	// Inherit the earth - German Floppy version
@@ -1183,7 +1210,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_LANG_DE
+		0,
+		Common::DE_DEU,
+		Common::kPlatformPC,
 	},
 
 	// Inherit the earth - Disk version
@@ -1204,7 +1233,9 @@
 		NULL,
 		0,
 		NULL,
-		0
+		0,
+		Common::EN_USA,
+		Common::kPlatformPC,
 	},
 
 	// I Have No Mouth And I Must Scream - Demo version
@@ -1225,7 +1256,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_DEFAULT_TO_1X_SCALER
+		GF_DEFAULT_TO_1X_SCALER,
+		Common::EN_USA,
+		Common::kPlatformPC,
 	},
 
 	// I Have No Mouth And I Must Scream - CD version
@@ -1246,7 +1279,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_DEFAULT_TO_1X_SCALER
+		GF_DEFAULT_TO_1X_SCALER,
+		Common::EN_USA,
+		Common::kPlatformPC,
 	},
 
 	// I Have No Mouth And I Must Scream - De CD version
@@ -1267,7 +1302,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_DEFAULT_TO_1X_SCALER
+		GF_DEFAULT_TO_1X_SCALER,
+		Common::DE_DEU,
+		Common::kPlatformPC,
 	},
 	// I Have No Mouth And I Must Scream - Sp CD version
 	{
@@ -1287,7 +1324,9 @@
 		NULL,
 		0,
 		NULL,
-		GF_DEFAULT_TO_1X_SCALER
+		GF_DEFAULT_TO_1X_SCALER,
+		Common::ES_ESP,
+		Common::kPlatformPC,
 	}
 
 };
@@ -1328,7 +1367,8 @@
 		game_n = detectGame(fslist, true, game_n);
 		if (game_n == -1)
 			break;
-		detectedGames.push_back(gameDescriptions[game_n].toGameSettings());
+		detectedGames.push_back(DetectedGame(gameDescriptions[game_n].toGameSettings(),
+					 gameDescriptions[game_n].language, gameDescriptions[game_n].platform));
 	}
 
 	return detectedGames;

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/gfx.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- gfx.cpp	11 Oct 2005 17:39:31 -0000	1.68
+++ gfx.cpp	14 Oct 2005 00:56:52 -0000	1.69
@@ -213,7 +213,7 @@
 	}
 
 	// Make 256th color black. See bug #1256368
-	if (_vm->getFeatures() & GF_MAC_RESOURCES && !_vm->_scene->isInIntro())
+	if ((_vm->getPlatform() == Common::kPlatformMacintosh) && !_vm->_scene->isInIntro())
 		memset(&_currentPal[255 * 4], 0, 4);
 
 	_system->setPalette(_currentPal, 0, PAL_ENTRIES);
@@ -318,7 +318,7 @@
 	}
 
 	// Make 256th color black. See bug #1256368
-	if (_vm->getFeatures() & GF_MAC_RESOURCES && !_vm->_scene->isInIntro())
+	if ((_vm->getPlatform() == Common::kPlatformMacintosh) && !_vm->_scene->isInIntro())
 		memset(&_currentPal[255 * 4], 0, 4);
 
 	_system->setPalette(_currentPal, 0, PAL_ENTRIES);
@@ -383,7 +383,7 @@
 	}
 
 	// Make 256th color black. See bug #1256368
-	if (_vm->getFeatures() & GF_MAC_RESOURCES && !_vm->_scene->isInIntro())
+	if ((_vm->getPlatform() == Common::kPlatformMacintosh) && !_vm->_scene->isInIntro())
 		memset(&_currentPal[255 * 4], 0, 4);
 
 	_system->setPalette(_currentPal, 0, PAL_ENTRIES);

Index: ite_introproc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/ite_introproc.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- ite_introproc.cpp	1 Oct 2005 11:09:49 -0000	1.69
+++ ite_introproc.cpp	14 Oct 2005 00:56:52 -0000	1.70
@@ -99,7 +99,7 @@
 	textEntry.useRect = true;
 	textEntry.rect.left = 0;
 	textEntry.rect.right = _vm->getDisplayWidth();
-	textEntry.rect.top = (_vm->getFeatures() & GF_LANG_DE) ? INTRO_DE_CAPTION_Y : INTRO_CAPTION_Y;
+	textEntry.rect.top = (_vm->getLanguage() == Common::DE_DEU) ? INTRO_DE_CAPTION_Y : INTRO_CAPTION_Y;
 	textEntry.rect.bottom = _vm->getDisplayHeight();
 	textEntry.fontId = kMediumFont;
 	textEntry.flags = (FontEffectFlags)(kFontOutline | kFontCentered);
@@ -168,15 +168,11 @@
 	// The assumption here is that all WyrmKeep versions have the same
 	// credits, regardless of which operating system they're for.
 
-	if (_vm->getFeatures() & GF_LANG_DE) {
-		lang = DE_DEU;
-	} else {
-		lang = EN_USA;
-	}
+	lang = _vm->getLanguage();
 
 	if (_vm->getFeatures() & GF_WYRMKEEP) {
 		game = kITEWyrmKeep;
-	} else if (_vm->getFeatures() & GF_MAC_RESOURCES) {
+	} else if (_vm->getPlatform() == Common::kPlatformMacintosh) {
 		game = kITEMac;
 	} else if (_vm->getGameId() == GID_ITE_CD_G) {
 		game = kITEPCCD;
@@ -317,13 +313,13 @@
 		int lastAnim;
 
 		if (_vm->getFeatures() & GF_WYRMKEEP) {
-			if (_vm->getFeatures() & GF_MAC_RESOURCES) {
+			if (_vm->getPlatform() == Common::kPlatformMacintosh) {
 				lastAnim = 3;
 			} else {
 				lastAnim = 2;
 			}
 		} else {
-			if (_vm->getFeatures() & GF_MAC_RESOURCES) {
+			if (_vm->getPlatform() == Common::kPlatformMacintosh) {
 				lastAnim = 4;
 			} else {
 				lastAnim = 5;
@@ -375,7 +371,7 @@
 int Scene::ITEIntroCave1Proc(int param) {
 	Event event;
 	Event *q_event;
-	int lang = _vm->getFeatures() & GF_LANG_DE ? 1 : 0;
+	int lang = (_vm->getLanguage() == Common::DE_DEU) ? 1 : 0;
 
 	static const IntroDialogue dialogue[][4] = {
 		{ { // English
@@ -463,7 +459,7 @@
 int Scene::ITEIntroCave2Proc(int param) {
 	Event event;
 	Event *q_event;
-	int lang = _vm->getFeatures() & GF_LANG_DE ? 1 : 0;
+	int lang = (_vm->getLanguage() == Common::DE_DEU) ? 1 : 0;
 
 	static const IntroDialogue dialogue[][3] = {
 		{ { // English
@@ -547,7 +543,7 @@
 int Scene::ITEIntroCave3Proc(int param) {
 	Event event;
 	Event *q_event;
-	int lang = _vm->getFeatures() & GF_LANG_DE ? 1 : 0;
+	int lang = (_vm->getLanguage() == Common::DE_DEU) ? 1 : 0;
 
 	static const IntroDialogue dialogue[][3] = {
 		{ { // English
@@ -631,7 +627,7 @@
 int Scene::ITEIntroCave4Proc(int param) {
 	Event event;
 	Event *q_event;
-	int lang = _vm->getFeatures() & GF_LANG_DE ? 1 : 0;
+	int lang = (_vm->getLanguage() == Common::DE_DEU) ? 1 : 0;
 
 	static const IntroDialogue dialogue[][4] = {
 		{ { // English

Index: puzzle.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/puzzle.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- puzzle.cpp	2 Oct 2005 13:49:58 -0000	1.16
+++ puzzle.cpp	14 Oct 2005 00:56:52 -0000	1.17
@@ -156,7 +156,7 @@
 };
 
 Puzzle::Puzzle(SagaEngine *vm) : _vm(vm), _solved(false), _active(false) {
-	_lang = _vm->getFeatures() & GF_LANG_DE ? 1 : 0;
+	_lang = (_vm->getLanguage() == Common::DE_DEU) ? 1 : 0;
 
 	_hintRqState = kRQNoHint;
 	_hintOffer = 0;

Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -d -r1.143 -r1.144
--- saga.cpp	11 Oct 2005 17:39:31 -0000	1.143
+++ saga.cpp	14 Oct 2005 00:56:52 -0000	1.144
@@ -404,7 +404,7 @@
 
 const char *SagaEngine::getTextString(int textStringId) {
 	const char *string;
-	int lang = getFeatures() & GF_LANG_DE ? 1 : 0;
+	int lang = (getLanguage() == Common::DE_DEU) ? 1 : 0;
 
 	string = ITEinterfaceTextStrings[lang][textStringId];
 	if (!string)

Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- saga.h	10 Oct 2005 02:02:58 -0000	1.131
+++ saga.h	14 Oct 2005 00:56:52 -0000	1.132
@@ -310,11 +310,9 @@
 
 enum GameFeatures {
 	GF_BIG_ENDIAN_DATA   = 1 << 0,
-	GF_MAC_RESOURCES     = 1 << 1,
-	GF_LANG_DE           = 1 << 2,
-	GF_WYRMKEEP          = 1 << 3,
-	GF_CD_FX             = 1 << 4,
-	GF_SCENE_SUBSTITUTES = 1 << 5
+	GF_WYRMKEEP          = 1 << 1,
+	GF_CD_FX             = 1 << 2,
+	GF_SCENE_SUBSTITUTES = 1 << 3
 };
 
 enum FontId {
@@ -490,6 +488,8 @@
 	int patchesCount;
 	GamePatchDescription *patchDescriptions;
 	uint32 features;
+	Common::Language language;
+	Common::Platform platform;
 
 	GameSettings toGameSettings() const {
 		GameSettings dummy = { name, title, features };
@@ -674,7 +674,7 @@
 public:
 	const GameDescription *getGameDescription() const { return _gameDescription; }
 	const bool isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }
-	const bool isMacResources() const { return (_gameDescription->features & GF_MAC_RESOURCES) != 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; }
@@ -689,6 +689,8 @@
 	int getGameId() const { return _gameDescription->gameId; }
 	int getGameType() const { return _gameDescription->gameType; }
 	uint32 getFeatures() const { return _gameDescription->features; }
+	Common::Language getLanguage() const { return _gameDescription->language; }
+	Common::Platform getPlatform() const { return _gameDescription->platform; }
 	int getGameNumber() const { return _gameNumber; }
 	int getStartSceneNumber() const { return _gameDescription->startSceneNumber; }
 





More information about the Scummvm-git-logs mailing list