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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Dec 29 18:30:29 CET 2008


Revision: 35615
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35615&view=rev
Author:   thebluegr
Date:     2008-12-29 17:30:29 +0000 (Mon, 29 Dec 2008)

Log Message:
-----------
- IHNM Mac loads correctly again
- Removed isBigEndian from GameSoundInfo
- Removed GF_BIG_ENDIAN_DATA
- Stopped loading the options panel for non-interactive ITE demos (it doesn't exist)
- Fixed crash when exiting from non-interactive ITE demos

Modified Paths:
--------------
    scummvm/trunk/engines/saga/detection.cpp
    scummvm/trunk/engines/saga/detection_tables.h
    scummvm/trunk/engines/saga/interface.cpp
    scummvm/trunk/engines/saga/resource.cpp
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/saga/sndres.cpp
    scummvm/trunk/engines/saga/sprite.h

Modified: scummvm/trunk/engines/saga/detection.cpp
===================================================================
--- scummvm/trunk/engines/saga/detection.cpp	2008-12-29 16:58:48 UTC (rev 35614)
+++ scummvm/trunk/engines/saga/detection.cpp	2008-12-29 17:30:29 UTC (rev 35615)
@@ -56,7 +56,7 @@
 	const GamePatchDescription *patchDescriptions;
 };
 
-bool SagaEngine::isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }
+bool SagaEngine::isBigEndian() const { return isMacResources() && getGameId() == GID_ITE; }
 bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); }
 const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; }
 const GameSoundInfo *SagaEngine::getVoiceInfo() const { return _gameDescription->voiceInfo; }
@@ -65,7 +65,6 @@
 	static GameSoundInfo musicInfo;
 	musicInfo.resourceType = kSoundPCM;
 	musicInfo.sampleBits = 16;
-	musicInfo.isBigEndian = false;
 	musicInfo.isSigned = true;
 
 	return &musicInfo;

Modified: scummvm/trunk/engines/saga/detection_tables.h
===================================================================
--- scummvm/trunk/engines/saga/detection_tables.h	2008-12-29 16:58:48 UTC (rev 35614)
+++ scummvm/trunk/engines/saga/detection_tables.h	2008-12-29 17:30:29 UTC (rev 35615)
@@ -112,14 +112,14 @@
 // Font 6 is kIHNMFont8, font 8 is kIHNMMainFont
 static const GameFontDescription IHNMCD_GameFonts[]     = { {2}, {3}, {4}, {5}, {6}, {7}, {8} };
 
-//                                                         sampleBits, isBigEndian, isSigned
-static const GameSoundInfo ITEPC_GameSound       = { kSoundPCM,    16,  false,     true };
-static const GameSoundInfo ITEWINDEMO1_GameSound = { kSoundPCM,     8,  false,    false };
-static const GameSoundInfo ITEMACCD_G_GameSound  = { kSoundMacPCM,  8,  false,    false };
-static const GameSoundInfo ITEDISK_GameSound     = { kSoundVOC,    -1,  false,     true };
-static const GameSoundInfo ITEDEMO_GameVoice     = { kSoundVOX,    16,  false,     true };
-static const GameSoundInfo IHNM_GameSound        = { kSoundWAV,    -1,  false,     true };
-static const GameSoundInfo MAC_GameSound         = { kSoundPCM,    16,   true,     true };
+//                                                         sampleBits,  isSigned
+static const GameSoundInfo ITEPC_GameSound       = { kSoundPCM,    16,  true  };
+static const GameSoundInfo ITEWINDEMO1_GameSound = { kSoundPCM,     8,  false };
+static const GameSoundInfo ITEMACCD_G_GameSound  = { kSoundMacPCM,  8,  false };
+static const GameSoundInfo ITEDISK_GameSound     = { kSoundVOC,    -1,  true  };
+static const GameSoundInfo ITEDEMO_GameVoice     = { kSoundVOX,    16,  true  };
+static const GameSoundInfo IHNM_GameSound        = { kSoundWAV,    -1,  true  };
+static const GameSoundInfo MAC_GameSound         = { kSoundPCM,    16,  true  };
 
 // Patch files. Files not found will be ignored
 static const GamePatchDescription ITEPatch_Files[] = {
@@ -230,7 +230,7 @@
 			Common::ADGF_DEMO
 		},
 		GID_ITE,
-		GF_BIG_ENDIAN_DATA | GF_WYRMKEEP | GF_SCENE_SUBSTITUTES | GF_MONO_MUSIC,
+		GF_WYRMKEEP | GF_SCENE_SUBSTITUTES | GF_MONO_MUSIC,
 		ITE_DEFAULT_SCENE,
 		&ITE_Resources,
 		ARRAYSIZE(ITEWINDEMO_GameFonts),
@@ -257,7 +257,7 @@
 			Common::ADGF_DEMO
 		},
 		GID_ITE,
-		GF_BIG_ENDIAN_DATA | GF_WYRMKEEP | GF_NON_INTERACTIVE,
+		GF_WYRMKEEP | GF_NON_INTERACTIVE,
 		ITE_DEFAULT_SCENE,
 		&ITE_Resources,
 		ARRAYSIZE(ITEWINDEMO_GameFonts),
@@ -345,7 +345,7 @@
 			Common::ADGF_NO_FLAGS
 		},
 		GID_ITE,
-		GF_BIG_ENDIAN_DATA,
+		0,
 		ITE_DEFAULT_SCENE,
 		&ITE_Resources,
 		ARRAYSIZE(ITEWINDEMO_GameFonts),
@@ -370,7 +370,7 @@
 			Common::ADGF_NO_FLAGS
 		},
 		GID_ITE,
-		GF_BIG_ENDIAN_DATA | GF_WYRMKEEP,
+		GF_WYRMKEEP,
 		ITE_DEFAULT_SCENE,
 		&ITE_Resources,
 		ARRAYSIZE(ITEWINDEMO_GameFonts),
@@ -825,7 +825,7 @@
 			Common::ADGF_NO_FLAGS
 		},
 		GID_IHNM,
-		0, // GF_BIG_ENDIAN_DATA
+		0,
 		IHNM_DEFAULT_SCENE,
 		&IHNM_Resources,
 		ARRAYSIZE(IHNMCD_GameFonts),

Modified: scummvm/trunk/engines/saga/interface.cpp
===================================================================
--- scummvm/trunk/engines/saga/interface.cpp	2008-12-29 16:58:48 UTC (rev 35614)
+++ scummvm/trunk/engines/saga/interface.cpp	2008-12-29 17:30:29 UTC (rev 35615)
@@ -166,13 +166,19 @@
 	free(resource);
 
 	// Option panel
-	_optionPanel.buttons = _vm->getDisplayInfo().optionPanelButtons;
-	_optionPanel.buttonsCount = _vm->getDisplayInfo().optionPanelButtonsCount;
+	if (!(_vm->getFeatures() & GF_NON_INTERACTIVE)) {
+		_optionPanel.buttons = _vm->getDisplayInfo().optionPanelButtons;
+		_optionPanel.buttonsCount = _vm->getDisplayInfo().optionPanelButtonsCount;
 
-	_vm->_resource->loadResource(_interfaceContext, _vm->getResourceDescription()->optionPanelResourceId, resource, resourceLength);
-	_vm->decodeBGImage(resource, resourceLength, &_optionPanel.image,
-		&_optionPanel.imageLength, &_optionPanel.imageWidth, &_optionPanel.imageHeight);
-	free(resource);
+		_vm->_resource->loadResource(_interfaceContext, _vm->getResourceDescription()->optionPanelResourceId, resource, resourceLength);
+		_vm->decodeBGImage(resource, resourceLength, &_optionPanel.image,
+			&_optionPanel.imageLength, &_optionPanel.imageWidth, &_optionPanel.imageHeight);
+		free(resource);
+	} else {
+		_optionPanel.buttons = NULL;
+		_optionPanel.buttonsCount = 0;
+		_optionPanel.sprites.spriteCount = 0;
+	}
 
 	// Quit panel
 	if (_vm->getGameId() == GID_IHNM) {

Modified: scummvm/trunk/engines/saga/resource.cpp
===================================================================
--- scummvm/trunk/engines/saga/resource.cpp	2008-12-29 16:58:48 UTC (rev 35614)
+++ scummvm/trunk/engines/saga/resource.cpp	2008-12-29 17:30:29 UTC (rev 35615)
@@ -433,7 +433,7 @@
 		} else if (!soundFileInArray && i == soundFileIndex) {
 			context->fileName = soundFileName;
 			context->fileType = GAME_SOUNDFILE;
-		} else if (_vm->_voiceFilesExist && i == voicesFileIndex) {
+		} else if (_vm->_voiceFilesExist && i == voicesFileIndex && !(_vm->getGameId() == GID_IHNM && _vm->isMacResources())) {
 			context->fileName = _voicesFileName[0];
 			// can be GAME_VOICEFILE or GAME_SOUNDFILE | GAME_VOICEFILE or GAME_VOICEFILE | GAME_SWAPENDIAN
 			context->fileType = voiceFileType;

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2008-12-29 16:58:48 UTC (rev 35614)
+++ scummvm/trunk/engines/saga/saga.h	2008-12-29 17:30:29 UTC (rev 35615)
@@ -116,16 +116,15 @@
 };
 
 enum GameFeatures {
-	GF_BIG_ENDIAN_DATA   = 1 << 0,
-	GF_WYRMKEEP          = 1 << 1,
-	GF_ITE_FLOPPY        = 1 << 2,
-	GF_SCENE_SUBSTITUTES = 1 << 3,
-	GF_COMPRESSED_SOUNDS = 1 << 4,
-	GF_NON_INTERACTIVE   = 1 << 5,
-	GF_OLD_ITE_DOS       = 1 << 6,
-	GF_MONO_MUSIC		 = 1 << 7,
-	GF_EXTRA_ITE_CREDITS = 1 << 8,
-	GF_IHNM_DEMO         = 1 << 9
+	GF_WYRMKEEP          = 1 << 0,
+	GF_ITE_FLOPPY        = 1 << 1,
+	GF_SCENE_SUBSTITUTES = 1 << 2,
+	GF_COMPRESSED_SOUNDS = 1 << 3,
+	GF_NON_INTERACTIVE   = 1 << 4,
+	GF_OLD_ITE_DOS       = 1 << 5,
+	GF_MONO_MUSIC		 = 1 << 6,
+	GF_EXTRA_ITE_CREDITS = 1 << 7,
+	GF_IHNM_DEMO         = 1 << 8
 };
 
 enum VerbTypeIds {
@@ -293,7 +292,6 @@
 struct GameSoundInfo {
 	GameSoundTypes resourceType;
 	int sampleBits;
-	bool isBigEndian;
 	bool isSigned;
 };
 

Modified: scummvm/trunk/engines/saga/sndres.cpp
===================================================================
--- scummvm/trunk/engines/saga/sndres.cpp	2008-12-29 16:58:48 UTC (rev 35614)
+++ scummvm/trunk/engines/saga/sndres.cpp	2008-12-29 17:30:29 UTC (rev 35615)
@@ -270,7 +270,7 @@
 
 	}
 
-	buffer.isBigEndian = soundInfo->isBigEndian;
+	buffer.isBigEndian = _vm->isMacResources();
 	buffer.soundType = resourceType;
 	buffer.originalSize = 0;
 

Modified: scummvm/trunk/engines/saga/sprite.h
===================================================================
--- scummvm/trunk/engines/saga/sprite.h	2008-12-29 16:58:48 UTC (rev 35614)
+++ scummvm/trunk/engines/saga/sprite.h	2008-12-29 17:30:29 UTC (rev 35615)
@@ -49,8 +49,10 @@
 	SpriteInfo *infoList;
 
 	void freeMem() {
-		int i;
-		for (i = 0; i < spriteCount; i++) {
+		if (!spriteListResourceId)
+			return;
+
+		for (int i = 0; i < spriteCount; i++) {
 			free(infoList[i].decodedBuffer);
 		}
 		free(infoList);


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