aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/voyeur/files.cpp17
-rw-r--r--engines/voyeur/files.h2
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();
};