diff options
author | Martin Kiewitz | 2009-10-09 12:10:17 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-09 12:10:17 +0000 |
commit | 0d5ba6ac6c865e42bb889ea607c1d0e9586dae17 (patch) | |
tree | a619f90b3e4ddece956d69e38ff797e668a0d77b /engines/sci | |
parent | 7bf181bf98b5cdb38251efac681277015ceaf2d5 (diff) | |
download | scummvm-rg350-0d5ba6ac6c865e42bb889ea607c1d0e9586dae17.tar.gz scummvm-rg350-0d5ba6ac6c865e42bb889ea607c1d0e9586dae17.tar.bz2 scummvm-rg350-0d5ba6ac6c865e42bb889ea607c1d0e9586dae17.zip |
SCI/newgui: SciGuiView now also locks resource
svn-id: r44823
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/gui/gui_view.cpp | 8 | ||||
-rw-r--r-- | engines/sci/gui/gui_view.h | 1 |
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; |