aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/container.h
diff options
context:
space:
mode:
authorBorja Lorente2016-06-16 17:54:58 +0200
committerBorja Lorente2016-08-14 18:24:59 +0200
commitb024a24821eac6f3b0e4513c853ca845d608c198 (patch)
tree388ad508abdf8b1eaa2f7601486fa410ca990021 /engines/macventure/container.h
parent22db262d57b919a73dea71a353951cc9b0d63d53 (diff)
downloadscummvm-rg350-b024a24821eac6f3b0e4513c853ca845d608c198.tar.gz
scummvm-rg350-b024a24821eac6f3b0e4513c853ca845d608c198.tar.bz2
scummvm-rg350-b024a24821eac6f3b0e4513c853ca845d608c198.zip
MACVENTURE: Change container to return a stream
Diffstat (limited to 'engines/macventure/container.h')
-rw-r--r--engines/macventure/container.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/macventure/container.h b/engines/macventure/container.h
index a0028eecb3..e960ddb9c3 100644
--- a/engines/macventure/container.h
+++ b/engines/macventure/container.h
@@ -62,10 +62,10 @@ public:
_res->seek(_header, SEEK_SET);
_numObjs = _res->readUint16BE();
- for (int i = 0; i < 15; ++i)
+ for (uint i = 0; i < 15; ++i)
_huff[i] = _res->readUint16BE();
- for (int i = 0; i < 16; ++i)
+ for (uint i = 0; i < 16; ++i)
_lens[i] = _res->readByte();
// Read groups
@@ -167,12 +167,12 @@ public:
}
/**
- * Assumes storage is initialized.
+ * getItemByteSize should be called before this one
*/
- void getItem(uint32 id, void* storage) {
+ Common::SeekableReadStream *getItem(uint32 id) {
if (_simplified) {
_res->seek((id * _lenObjs) + sizeof(_header), SEEK_SET);
- _res->read(storage, _lenObjs);
+ return _res;
} else {
ContainerHeader subHead = _header & 0x7fffffff;
uint32 groupID = (id >> 6);
@@ -181,13 +181,13 @@ public:
_res->seek(subHead + (groupID * 6), SEEK_SET);
uint32 offset = 0;
- for (int i = 0; i < objectIndex; i++) {
+ for (uint i = 0; i < objectIndex; i++) {
offset += _groups[groupID].lengths[i];
}
_res->seek(offset, SEEK_CUR);
- _res->read(storage, _groups[groupID].lengths[objectIndex]);
+ return _res;
}
}