diff options
author | Eugene Sandulenko | 2016-10-27 16:47:20 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-10-27 16:48:21 +0200 |
commit | 09d41af771edbb942eea78dcc89ab86c3d05abca (patch) | |
tree | 869acfadf4cd535a5e8acba0fcea25aa4e83f25e /engines/director/archive.cpp | |
parent | ba9eeded271cba1ae68d39e6bb7d81a32c51f73c (diff) | |
download | scummvm-rg350-09d41af771edbb942eea78dcc89ab86c3d05abca.tar.gz scummvm-rg350-09d41af771edbb942eea78dcc89ab86c3d05abca.tar.bz2 scummvm-rg350-09d41af771edbb942eea78dcc89ab86c3d05abca.zip |
DIRECTOR: Fix RIFX resource loading
Diffstat (limited to 'engines/director/archive.cpp')
-rw-r--r-- | engines/director/archive.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp index a96ffa908c..9122572a95 100644 --- a/engines/director/archive.cpp +++ b/engines/director/archive.cpp @@ -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 |