diff options
author | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
commit | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch) | |
tree | f29541d55309487a94bd1d38e8b53bb3dde9aec6 /common/macresman.cpp | |
parent | 48ee83b88957dab86bc763e9ef21a70179fa8679 (diff) | |
parent | e9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff) | |
download | scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2 scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip |
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend
changes into the branch. I suppose the gp2x backend and probably all new
backends, i.e. gph, dingux etc., might not compile anymore.
Since I have no way of testing those it would be nice if porters could look
into getting those up to speed in this branch.
svn-id: r53399
Diffstat (limited to 'common/macresman.cpp')
-rw-r--r-- | common/macresman.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/common/macresman.cpp b/common/macresman.cpp index eb6a5939b6..641702b5ec 100644 --- a/common/macresman.cpp +++ b/common/macresman.cpp @@ -110,6 +110,7 @@ bool MacResManager::open(Common::String filename) { _baseFileName = filename; return true; } + delete macResForkRawStream; #endif @@ -169,6 +170,7 @@ bool MacResManager::open(Common::FSNode path, Common::String filename) { _baseFileName = filename; return true; } + delete macResForkRawStream; #endif @@ -466,6 +468,28 @@ Common::SeekableReadStream *MacResManager::getResource(const Common::String &fil return 0; } +Common::SeekableReadStream *MacResManager::getResource(uint32 typeID, const Common::String &filename) { + for (uint32 i = 0; i < _resMap.numTypes; i++) { + if (_resTypes[i].id != typeID) + continue; + + 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(); + + // Ignore resources with 0 length + if (!len) + return 0; + + return _stream->readStream(len); + } + } + } + + return 0; +} + void MacResManager::readMap() { _stream->seek(_mapOffset + 22); |