aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/director/archive.cpp18
-rw-r--r--engines/director/archive.h1
-rw-r--r--engines/director/score.cpp5
3 files changed, 19 insertions, 5 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
diff --git a/engines/director/archive.h b/engines/director/archive.h
index 54d7086326..93f4ce7ee9 100644
--- a/engines/director/archive.h
+++ b/engines/director/archive.h
@@ -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
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 1345f4b912..7b03ca1a7d 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -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;