aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Milburn2011-11-25 22:59:30 +0100
committerAlyssa Milburn2011-11-25 22:59:30 +0100
commit4d4c84fd824ac4a4bea355c2248e47655272ee8b (patch)
treeb82ff4a6dfc71b134609115bbcce2b8083605679
parentd5c50fe0b3f59ba0f0a34e89502a2190cf339e0d (diff)
downloadscummvm-rg350-4d4c84fd824ac4a4bea355c2248e47655272ee8b.tar.gz
scummvm-rg350-4d4c84fd824ac4a4bea355c2248e47655272ee8b.tar.bz2
scummvm-rg350-4d4c84fd824ac4a4bea355c2248e47655272ee8b.zip
MOHAWK: Load/unload LB proxies properly.
-rw-r--r--engines/mohawk/livingbooks.cpp14
-rw-r--r--engines/mohawk/livingbooks.h3
2 files changed, 15 insertions, 2 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 8b01489497..dafd1b02d7 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -3671,7 +3671,10 @@ LBProxyItem::~LBProxyItem() {
delete _page;
}
-void LBProxyItem::init() {
+void LBProxyItem::load() {
+ if (_loaded)
+ return;
+
Common::String leftover;
Common::String filename = _vm->getFileNameFromConfig("Proxies", _desc.c_str(), leftover);
if (!leftover.empty())
@@ -3690,6 +3693,15 @@ void LBProxyItem::init() {
error("failed to open archive '%s' (for proxy '%s')", filename.c_str(), _desc.c_str());
_page = new LBPage(_vm);
_page->open(pageArchive, baseId);
+
+ LBItem::load();
+}
+
+void LBProxyItem::unload() {
+ delete _page;
+ _page = NULL;
+
+ LBItem::unload();
}
} // End of namespace Mohawk
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index c76c4349ca..bbd11bd9c9 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -597,7 +597,8 @@ public:
LBProxyItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect);
~LBProxyItem();
- void init();
+ void load();
+ void unload();
protected:
class LBPage *_page;