From c3d75ced87cf7eaa1a46712348eea578dd5de73f Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Wed, 28 Oct 2009 15:15:18 +0000 Subject: SCI/newgui: another floodfill change, fixes sq3 this time (this is madness) svn-id: r45474 --- engines/sci/gui/gui_picture.cpp | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'engines/sci/gui') diff --git a/engines/sci/gui/gui_picture.cpp b/engines/sci/gui/gui_picture.cpp index fd60994606..e654b4db7c 100644 --- a/engines/sci/gui/gui_picture.cpp +++ b/engines/sci/gui/gui_picture.cpp @@ -602,6 +602,23 @@ void SciGuiPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, byte searchPriority = _screen->getPriority(p.x, p.y); byte searchControl = _screen->getControl(p.x, p.y); + // This logic was taken directly from sierra sci, floodfill will get aborted on various occations + if (screenMask & SCI_SCREEN_MASK_VISUAL) { + if (_resMan->isVGA()) { + if ((color == 255) || (searchColor != 0)) + return; + } else { + if ((color == 15) || (searchColor != 15)) + return; + } + } else if (screenMask & SCI_SCREEN_MASK_PRIORITY) { + if ((priority == 0) || (searchPriority != 0)) + return; + } else if (screenMask & SCI_SCREEN_MASK_CONTROL) { + if ((control == 0) || (searchControl != 0)) + return; + } + // Now remove screens, that already got the right color/priority/control if ((screenMask & SCI_SCREEN_MASK_VISUAL) && (searchColor == color)) screenMask ^= SCI_SCREEN_MASK_VISUAL; @@ -614,23 +631,11 @@ void SciGuiPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, if (!screenMask) return; - // This logic was taken directly from sierra sci, floodfill will get aborted on various occations if (screenMask & SCI_SCREEN_MASK_VISUAL) { - if (_resMan->isVGA()) { - if ((color == 255) || (searchColor != 0)) - return; - } else { - if ((color == 15) || (searchColor != 15)) - return; - } matchMask = SCI_SCREEN_MASK_VISUAL; } else if (screenMask & SCI_SCREEN_MASK_PRIORITY) { - if ((priority == 0) || (searchPriority != 0)) - return; matchMask = SCI_SCREEN_MASK_PRIORITY; - } else if (screenMask & SCI_SCREEN_MASK_CONTROL) { - if ((control == 0) || (searchControl != 0)) - return; + } else { matchMask = SCI_SCREEN_MASK_CONTROL; } -- cgit v1.2.3