diff options
author | Martin Kiewitz | 2009-10-08 21:00:21 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-08 21:00:21 +0000 |
commit | 2ab906bafd7e154bb9e333d7e76fe2a714478efd (patch) | |
tree | a5d0edbdfd1ce7e6be21be009f489d9f6fb9748b /engines | |
parent | cc236d97990486bfe36a4f19fd01b139ea90d969 (diff) | |
download | scummvm-rg350-2ab906bafd7e154bb9e333d7e76fe2a714478efd.tar.gz scummvm-rg350-2ab906bafd7e154bb9e333d7e76fe2a714478efd.tar.bz2 scummvm-rg350-2ab906bafd7e154bb9e333d7e76fe2a714478efd.zip |
SCI/newgui: RestoreBits() now ignores empty handles
svn-id: r44801
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/gui/gui_gfx.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp index d4fc056308..056bbecdc8 100644 --- a/engines/sci/gui/gui_gfx.cpp +++ b/engines/sci/gui/gui_gfx.cpp @@ -606,11 +606,15 @@ GuiMemoryHandle SciGuiGfx::SaveBits(const Common::Rect &rect, byte screenMask) { } void SciGuiGfx::RestoreBits(GuiMemoryHandle memoryHandle) { - byte *memoryPtr = kmem(_s->_segMan, memoryHandle);; + byte *memoryPtr = NULL; - if (memoryPtr) { - _screen->restoreBits(memoryPtr); - kfree(_s->_segMan, memoryHandle); + if (!memoryHandle.isNull()) { + memoryPtr = kmem(_s->_segMan, memoryHandle);; + + if (memoryPtr) { + _screen->restoreBits(memoryPtr); + kfree(_s->_segMan, memoryHandle); + } } } |