From b2934eb166ba5b442a93969ad8b4dfbbc6ef3314 Mon Sep 17 00:00:00 2001 From: johndoe123 Date: Mon, 19 Nov 2012 22:24:03 +0000 Subject: NEVERHOOD: Fix Klaymen "grow" animation after drinking the potion - Remove static sprite 0x50C027A8 Scene2803/Scene2803Small because the resource doesn't exist! - Remove some old comments - Fix resource extData handling which fixes some crashes - Enable reusing deleted sound/music slots in SoundMan (was disabled for debugging) --- engines/neverhood/resourceman.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines/neverhood/resourceman.cpp') diff --git a/engines/neverhood/resourceman.cpp b/engines/neverhood/resourceman.cpp index 3b67b26a06..c30e272eab 100644 --- a/engines/neverhood/resourceman.cpp +++ b/engines/neverhood/resourceman.cpp @@ -66,8 +66,10 @@ ResourceFileEntry *ResourceMan::findEntrySimple(uint32 fileHash) { return p != _entries.end() ? &(*p)._value : NULL; } -ResourceFileEntry *ResourceMan::findEntry(uint32 fileHash) { +ResourceFileEntry *ResourceMan::findEntry(uint32 fileHash, ResourceFileEntry **firstEntry) { ResourceFileEntry *entry = findEntrySimple(fileHash); + if (firstEntry) + *firstEntry = entry; for (; entry && entry->archiveEntry->comprType == 0x65; fileHash = entry->archiveEntry->diskSize) entry = findEntrySimple(fileHash); return entry; @@ -79,7 +81,9 @@ Common::SeekableReadStream *ResourceMan::createStream(uint32 fileHash) { } void ResourceMan::queryResource(uint32 fileHash, ResourceHandle &resourceHandle) { - resourceHandle._resourceFileEntry = findEntry(fileHash); + ResourceFileEntry *firstEntry; + resourceHandle._resourceFileEntry = findEntry(fileHash, &firstEntry); + resourceHandle._extData = firstEntry ? firstEntry->archiveEntry->extData : NULL; } void ResourceMan::loadResource(ResourceHandle &resourceHandle) { -- cgit v1.2.3