diff options
-rw-r--r-- | engines/saga/detection.cpp | 3 | ||||
-rw-r--r-- | engines/saga/detection_tables.h | 26 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 18 | ||||
-rw-r--r-- | engines/saga/resource.cpp | 2 | ||||
-rw-r--r-- | engines/saga/saga.h | 20 | ||||
-rw-r--r-- | engines/saga/sndres.cpp | 2 | ||||
-rw-r--r-- | engines/saga/sprite.h | 6 |
7 files changed, 41 insertions, 36 deletions
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 43b4957ebb..2d42ba336f 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -56,7 +56,7 @@ struct SAGAGameDescription { 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 @@ const GameSoundInfo *SagaEngine::getMusicInfo() const { static GameSoundInfo musicInfo; musicInfo.resourceType = kSoundPCM; musicInfo.sampleBits = 16; - musicInfo.isBigEndian = false; musicInfo.isSigned = true; return &musicInfo; diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h index 826d3900b1..6b1fc808ca 100644 --- a/engines/saga/detection_tables.h +++ b/engines/saga/detection_tables.h @@ -112,14 +112,14 @@ static const GameFontDescription IHNMDEMO_GameFonts[] = { {2}, {3}, {4} }; // 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 @@ static const SAGAGameDescription gameDescriptions[] = { 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 @@ static const SAGAGameDescription gameDescriptions[] = { 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 @@ static const SAGAGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GID_ITE, - GF_BIG_ENDIAN_DATA, + 0, ITE_DEFAULT_SCENE, &ITE_Resources, ARRAYSIZE(ITEWINDEMO_GameFonts), @@ -370,7 +370,7 @@ static const SAGAGameDescription gameDescriptions[] = { 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 @@ static const SAGAGameDescription gameDescriptions[] = { Common::ADGF_NO_FLAGS }, GID_IHNM, - 0, // GF_BIG_ENDIAN_DATA + 0, IHNM_DEFAULT_SCENE, &IHNM_Resources, ARRAYSIZE(IHNMCD_GameFonts), diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 4cd6cf4d7d..8d26e83fc2 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -166,13 +166,19 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) { 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) { diff --git a/engines/saga/resource.cpp b/engines/saga/resource.cpp index d1190fec79..459baf81ec 100644 --- a/engines/saga/resource.cpp +++ b/engines/saga/resource.cpp @@ -433,7 +433,7 @@ bool Resource::createContexts() { } 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; diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 0dce9df3cc..b06dd94833 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -116,16 +116,15 @@ enum GameFileTypes { }; 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 GameDisplayInfo; struct GameSoundInfo { GameSoundTypes resourceType; int sampleBits; - bool isBigEndian; bool isSigned; }; diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index 6121890e9b..80b9216418 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -270,7 +270,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff } - buffer.isBigEndian = soundInfo->isBigEndian; + buffer.isBigEndian = _vm->isMacResources(); buffer.soundType = resourceType; buffer.originalSize = 0; diff --git a/engines/saga/sprite.h b/engines/saga/sprite.h index 3d077f6389..26f92b7494 100644 --- a/engines/saga/sprite.h +++ b/engines/saga/sprite.h @@ -49,8 +49,10 @@ struct SpriteList { 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); |