aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/gui/gui_view.cpp8
-rw-r--r--engines/sci/gui/gui_view.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/gui/gui_view.cpp b/engines/sci/gui/gui_view.cpp
index ab42154950..cb7c9c5af2 100644
--- a/engines/sci/gui/gui_view.cpp
+++ b/engines/sci/gui/gui_view.cpp
@@ -49,14 +49,16 @@ SciGuiView::~SciGuiView() {
delete[] _loop[loopNum].cel;
}
delete[] _loop;
+
+ _resMan->unlockResource(_resource);
}
void SciGuiView::initData(GuiResourceId resourceId) {
- Resource *viewResource = _resMan->findResource(ResourceId(kResourceTypeView, resourceId), false);
- if (!viewResource) {
+ _resource = _resMan->findResource(ResourceId(kResourceTypeView, resourceId), true);
+ if (!_resource) {
error("view resource %d not found", resourceId);
}
- _resourceData = viewResource->data;
+ _resourceData = _resource->data;
byte *celData, *loopData;
uint16 celOffset;
diff --git a/engines/sci/gui/gui_view.h b/engines/sci/gui/gui_view.h
index df6b0e75e0..ffee17a026 100644
--- a/engines/sci/gui/gui_view.h
+++ b/engines/sci/gui/gui_view.h
@@ -71,6 +71,7 @@ private:
SciGuiPalette *_palette;
GuiResourceId _resourceId;
+ Resource *_resource;
byte *_resourceData;
uint16 _loopCount;