From 89d4e44281b7bf05b9ad234bdf242de32a47c688 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sat, 4 Sep 2010 08:51:10 +0000 Subject: SCI: doing detectDoSoundType() properly sci0early checking, if sound resources are sci0early or late for sci0early games instead of hardcoding lsl2 svn-id: r52514 --- engines/sci/resource.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'engines/sci/resource.cpp') diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 3b787cc673..4aff273610 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -2148,6 +2148,19 @@ bool ResourceManager::detectForPaletteMergingForSci11() { return false; } +// is called on SCI0EARLY games to make sure that sound resources are in fact also SCI0EARLY +bool ResourceManager::detectEarlySound() { + Resource *res = findResource(ResourceId(kResourceTypeSound, 1), 0); + if (res) { + if (res->size >= 0x22) { + if (READ_LE_UINT16(res->data + 0x1f) == 0) // channel 15 voice count + play mask is 0 in SCI0LATE + if (res->data[0x21] == 0) // last byte right before actual data is 0 as well + return false; // these 2 bytes are + } + } + return true; +} + // Functions below are based on PD code by Brian Provinciano (SCI Studio) bool ResourceManager::hasOldScriptHeader() { Resource *res = findResource(ResourceId(kResourceTypeScript, 0), 0); -- cgit v1.2.3