aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/macresman.cpp14
-rw-r--r--common/macresman.h7
2 files changed, 21 insertions, 0 deletions
diff --git a/common/macresman.cpp b/common/macresman.cpp
index f36f8b2fe3..fd17944fa9 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -381,6 +381,20 @@ Common::SeekableReadStream *MacResManager::getResource(uint32 typeID, uint16 res
return _stream->readStream(len);
}
+Common::SeekableReadStream *MacResManager::getResource(Common::String filename) {
+ for (uint32 i = 0; i < _resMap.numTypes; i++) {
+ for (uint32 j = 0; j < _resTypes[i].items; j++) {
+ if (_resLists[i][j].nameOffset != -1 && filename.equalsIgnoreCase(_resLists[i][j].name)) {
+ _stream->seek(_dataOffset + _resLists[i][j].dataOffset);
+ uint32 len = _stream->readUint32BE();
+ return _stream->readStream(len);
+ }
+ }
+ }
+
+ return 0;
+}
+
void MacResManager::readMap() {
_stream->seek(_mapOffset + 22);
diff --git a/common/macresman.h b/common/macresman.h
index 4afd2eebab..5cd39cae26 100644
--- a/common/macresman.h
+++ b/common/macresman.h
@@ -61,6 +61,13 @@ public:
*/
Common::SeekableReadStream *getResource(uint32 typeID, uint16 resID);
+ /**
+ * Read resource from the Mac Binary file
+ * @param filename filename of the resource
+ * @return Pointer to a SeekableReadStream with loaded resource
+ */
+ Common::SeekableReadStream *getResource(Common::String filename);
+
Common::SeekableReadStream *getDataFork();
Common::String getResName(uint32 typeID, uint16 resID);
uint32 getResForkSize();