mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
DIRECTOR: Fix RIFX resource loading
This commit is contained in:
@@ -447,4 +447,22 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
|
||||
return true;
|
||||
}
|
||||
|
||||
Common::SeekableSubReadStreamEndian *RIFXArchive::getResource(uint32 tag, uint16 id) {
|
||||
if (!_types.contains(tag))
|
||||
error("Archive does not contain '%s' %04x", tag2str(tag), id);
|
||||
|
||||
const ResourceMap &resMap = _types[tag];
|
||||
|
||||
if (!resMap.contains(id))
|
||||
error("Archive does not contain '%s' %04x", tag2str(tag), id);
|
||||
|
||||
const Resource &res = resMap[id];
|
||||
|
||||
uint32 offset = res.offset + 8;
|
||||
uint32 size = res.size;
|
||||
|
||||
return new Common::SeekableSubReadStreamEndian(_stream, offset, offset + size, true, DisposeAfterUse::NO);
|
||||
}
|
||||
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
@@ -102,6 +102,7 @@ public:
|
||||
~RIFXArchive() {}
|
||||
|
||||
bool openStream(Common::SeekableReadStream *stream, uint32 startOffset = 0);
|
||||
Common::SeekableSubReadStreamEndian *getResource(uint32 tag, uint16 id);
|
||||
};
|
||||
|
||||
} // End of namespace Director
|
||||
|
||||
@@ -365,11 +365,6 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream) {
|
||||
}
|
||||
|
||||
void Score::loadLabels(Common::SeekableSubReadStreamEndian &stream) {
|
||||
if (_vm->getVersion() >= 4) { // HACK: Skip the header. Why it is there?
|
||||
stream.readUint32LE();
|
||||
stream.readUint32LE();
|
||||
}
|
||||
|
||||
_labels = new Common::SortedArray<Label *>(compareLabels);
|
||||
uint16 count = stream.readUint16() + 1;
|
||||
uint16 offset = count * 4 + 2;
|
||||
|
||||
Reference in New Issue
Block a user