diff options
author | Paul Gilbert | 2013-05-21 13:19:12 +1000 |
---|---|---|
committer | Paul Gilbert | 2013-05-21 13:19:12 +1000 |
commit | bff4076093554700e94c4db74a47adabb5f7c74e (patch) | |
tree | 4bd073e3e6c16598587a14c413004f403a6a6912 /engines/voyeur/files.cpp | |
parent | 4b638bc4b05ce42432979b8b06ad0afac31142a7 (diff) | |
download | scummvm-rg350-bff4076093554700e94c4db74a47adabb5f7c74e.tar.gz scummvm-rg350-bff4076093554700e94c4db74a47adabb5f7c74e.tar.bz2 scummvm-rg350-bff4076093554700e94c4db74a47adabb5f7c74e.zip |
VOYEUR: Fixes for loading group index
Diffstat (limited to 'engines/voyeur/files.cpp')
-rw-r--r-- | engines/voyeur/files.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index fa3d27e1d6..d6df3aa1ea 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -66,7 +66,7 @@ BoltFile::BoltFile() { int totalGroups = header[11] ? header[11] : 0x100; for (int i = 0; i < totalGroups; ++i) - _groups.push_back(BoltGroup(_curFd))); + _groups.push_back(BoltGroup(&_curFd)); } BoltFile::~BoltFile() { @@ -90,16 +90,14 @@ bool BoltFile::getBoltGroup(uint32 id) { if (_curGroupPtr->_callInitGro) initGro(); - if ((id >> 16) == 0) { - if (!_curGroupPtr->_loaded) { - _curGroupPtr->load(); - } else { - id &= 0xff00; - for (int idx = 0; idx < count; ++idx, ++id) { - byte *member = getBoltMember(id); - assert(member); - } + if ((id >> 16) != 0) { + id &= 0xff00; + for (int idx = 0; idx < count; ++idx, ++id) { + byte *member = getBoltMember(id); + assert(member); } + } else if (!_curGroupPtr->_loaded) { + _curGroupPtr->load(); } resolveAll(); @@ -139,6 +137,8 @@ byte *BoltFile::getBoltMember(uint32 id) { } //TODO + + return NULL; } /*------------------------------------------------------------------------*/ @@ -158,12 +158,8 @@ BoltGroup::BoltGroup(Common::SeekableReadStream *f): _file(f) { void BoltGroup::load() { _file->seek(_fileOffset); - byte header[4]; - _file->read(&header[0], 4); - // Read the entries - int count = _count ? _count : 256; - for (int i = 0; i < count; ++i) + for (int i = 0; i < _count; ++i) _entries.push_back(BoltEntry(_file)); _loaded = true; |