[Scummvm-git-logs] scummvm master -> fac330bec43ce31706063c8ec8a0f16fed64d3b3
djsrv
noreply at scummvm.org
Wed Aug 10 04:19:16 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
28b7b0b297 DIRECTOR: Handle collisions between movie and cast member IDs
fac330bec4 DIRECTOR: Don't fall back to getFirstResource if chunk not in KEY*
Commit: 28b7b0b2970f5fd0583628acf53889c92cc36cf5
https://github.com/scummvm/scummvm/commit/28b7b0b2970f5fd0583628acf53889c92cc36cf5
Author: djsrv (dservilla at gmail.com)
Date: 2022-08-10T00:11:20-04:00
Commit Message:
DIRECTOR: Handle collisions between movie and cast member IDs
Changed paths:
engines/director/archive.cpp
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 40db6ffd854..0095d503728 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -862,11 +862,19 @@ void RIFXArchive::readKeyTable(Common::SeekableReadStreamEndian &keyStream) {
uint32 childTag = keyStream.readUint32();
debugC(2, kDebugLoading, "KEY*: childIndex: %d parentIndex: %d childTag: %s", childIndex, parentIndex, tag2str(childTag));
+
+ // Link cast members to their resources.
if (castResMap.contains(parentIndex)) {
castResMap[parentIndex].children.push_back(_types[childTag][childIndex]);
} else if (castResMap.contains(childIndex)) { // sometimes parent and child index are reversed...
castResMap[childIndex].children.push_back(_types[childTag][parentIndex]);
- } else if (parentIndex == 1024) {
+ }
+
+ // Link the movie to its resources.
+ // The movie has the hardcoded ID 1024, which may collide with a cast member's ID
+ // when there are many chunks. This is not a problem since cast members and
+ // movies use different resource types, so we can tell them apart.
+ if (parentIndex == 1024) {
_movieChunks.setVal(childTag, childIndex);
}
}
Commit: fac330bec43ce31706063c8ec8a0f16fed64d3b3
https://github.com/scummvm/scummvm/commit/fac330bec43ce31706063c8ec8a0f16fed64d3b3
Author: djsrv (dservilla at gmail.com)
Date: 2022-08-10T00:18:04-04:00
Commit Message:
DIRECTOR: Don't fall back to getFirstResource if chunk not in KEY*
There doesn't seem to be any case in which we should fall back to
getFirstResource in D4 as found in #4172. So we can remove that fallback
and the associated warning.
Changed paths:
engines/director/archive.cpp
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 0095d503728..f37173cf2b7 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -172,11 +172,10 @@ Common::String Archive::getName(uint32 tag, uint16 id) const {
}
Common::SeekableReadStreamEndian *Archive::getMovieResourceIfPresent(uint32 tag) {
- if (g_director->getVersion() >= 400 && (_movieChunks.contains(tag) && hasResource(tag, _movieChunks[tag])))
- return getResource(tag, _movieChunks[tag]);
-
- if (hasResource(tag, -1)) {
- warning("Archive::getMovieResourceIfPresent(): KEY* to reference tag %d not found, returning first occurence of this resource", tag);
+ if (g_director->getVersion() >= 400) {
+ if (_movieChunks.contains(tag) && hasResource(tag, _movieChunks[tag]))
+ return getResource(tag, _movieChunks[tag]);
+ } else if (hasResource(tag, -1)) {
return getFirstResource(tag);
}
More information about the Scummvm-git-logs
mailing list