SCI/newgui: RestoreBits() now ignores empty handles

svn-id: r44801
This commit is contained in:
Martin Kiewitz 2009-10-08 21:00:21 +00:00
parent cc236d9799
commit 2ab906bafd

View file

@ -606,13 +606,17 @@ GuiMemoryHandle SciGuiGfx::SaveBits(const Common::Rect &rect, byte screenMask) {
} }
void SciGuiGfx::RestoreBits(GuiMemoryHandle memoryHandle) { void SciGuiGfx::RestoreBits(GuiMemoryHandle memoryHandle) {
byte *memoryPtr = kmem(_s->_segMan, memoryHandle);; byte *memoryPtr = NULL;
if (!memoryHandle.isNull()) {
memoryPtr = kmem(_s->_segMan, memoryHandle);;
if (memoryPtr) { if (memoryPtr) {
_screen->restoreBits(memoryPtr); _screen->restoreBits(memoryPtr);
kfree(_s->_segMan, memoryHandle); kfree(_s->_segMan, memoryHandle);
} }
} }
}
// Sierra's Bresenham line drawing // Sierra's Bresenham line drawing
// WARNING: Do not just blindly replace this with Graphics::drawLine(), as it seems to create issues with flood fill // WARNING: Do not just blindly replace this with Graphics::drawLine(), as it seems to create issues with flood fill