diff options
author | Paul Gilbert | 2013-06-08 15:49:44 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-06-08 15:49:44 -0400 |
commit | b1eeefaab1c0ac5b7fa3513bbe5415e2a08d23ca (patch) | |
tree | 27b6a03e042fa30201f7e252f3494bc3d61518c1 /engines/voyeur | |
parent | 11a4fef956dc955c44fc323bdb28580bcb8888e5 (diff) | |
download | scummvm-rg350-b1eeefaab1c0ac5b7fa3513bbe5415e2a08d23ca.tar.gz scummvm-rg350-b1eeefaab1c0ac5b7fa3513bbe5415e2a08d23ca.tar.bz2 scummvm-rg350-b1eeefaab1c0ac5b7fa3513bbe5415e2a08d23ca.zip |
VOYEUR: Implement freeBoltGroup and related logic
Diffstat (limited to 'engines/voyeur')
-rw-r--r-- | engines/voyeur/files.cpp | 17 | ||||
-rw-r--r-- | engines/voyeur/files.h | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 383523e149..3bbea7a5d1 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -255,7 +255,11 @@ bool BoltFile::getBoltGroup(uint32 id) { } void BoltFile::freeBoltGroup(uint32 id) { - warning("TODO: freeBoltGroup"); + _state._curLibPtr = this; + _state._curGroupPtr = &_groups[(id >> 8) & 0xff]; + + // Unload the group + _state._curGroupPtr->unload(); } BoltEntry &BoltFile::getBoltEntry(uint32 id) { @@ -460,6 +464,9 @@ BoltGroup::BoltGroup(Common::SeekableReadStream *f): _file(f) { _fileOffset = READ_LE_UINT32(&buffer[8]); } +BoltGroup::~BoltGroup() { +} + void BoltGroup::load() { _file->seek(_fileOffset); @@ -470,6 +477,14 @@ void BoltGroup::load() { _loaded = true; } +void BoltGroup::unload() { + if (!_loaded) + return; + + _entries.clear(); + _loaded = false; +} + /*------------------------------------------------------------------------*/ BoltEntry::BoltEntry(Common::SeekableReadStream *f): _file(f) { diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 816813769f..996dc2b3a0 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -151,8 +151,10 @@ public: Common::Array<BoltEntry> _entries; public: BoltGroup(Common::SeekableReadStream *f); + virtual ~BoltGroup(); void load(); + void unload(); }; |