diff options
author | Bastien Bouclet | 2010-11-29 20:59:30 +0000 |
---|---|---|
committer | Bastien Bouclet | 2010-11-29 20:59:30 +0000 |
commit | 056ebd43d46fe6a5b9bdb3a59c39c3db3ff18a04 (patch) | |
tree | 17c1e03b17c8692aa31b6d7f69d357858eab56f6 | |
parent | ed59b28d0bd8a7eb1f30357d48bbd26cb1b307ff (diff) | |
download | scummvm-rg350-056ebd43d46fe6a5b9bdb3a59c39c3db3ff18a04.tar.gz scummvm-rg350-056ebd43d46fe6a5b9bdb3a59c39c3db3ff18a04.tar.bz2 scummvm-rg350-056ebd43d46fe6a5b9bdb3a59c39c3db3ff18a04.zip |
MOHAWK: Complete drawing the animated rect if running the animation steps didn't draw the whole rect.
svn-id: r54631
-rw-r--r-- | engines/mohawk/graphics.cpp | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index 66adf6e35b..39737f5047 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -318,6 +318,13 @@ void MystGraphics::animatedUpdate(uint16 type, Common::Rect rect, uint16 steps, _dirtyRects.push_back(area); updateScreen(); } + if (area.right < rect.right) { + area.left = area.right; + area.right = rect.right; + + _dirtyRects.push_back(area); + updateScreen(); + } } break; case 1: { @@ -334,6 +341,13 @@ void MystGraphics::animatedUpdate(uint16 type, Common::Rect rect, uint16 steps, _dirtyRects.push_back(area); updateScreen(); } + if (area.left > rect.left) { + area.right = area.left; + area.left = rect.left; + + _dirtyRects.push_back(area); + updateScreen(); + } } break; case 5: { @@ -350,6 +364,13 @@ void MystGraphics::animatedUpdate(uint16 type, Common::Rect rect, uint16 steps, _dirtyRects.push_back(area); updateScreen(); } + if (area.top < rect.bottom) { + area.top = area.bottom; + area.bottom = rect.bottom; + + _dirtyRects.push_back(area); + updateScreen(); + } } break; case 6: { @@ -366,6 +387,13 @@ void MystGraphics::animatedUpdate(uint16 type, Common::Rect rect, uint16 steps, _dirtyRects.push_back(area); updateScreen(); } + if (area.bottom > rect.top) { + area.bottom = area.top; + area.top = rect.top; + + _dirtyRects.push_back(area); + updateScreen(); + } } break; default: @@ -383,16 +411,12 @@ void MystGraphics::drawRect(Common::Rect rect, RectState state) { if (rect.left < 0 || rect.top < 0 || rect.right > 544 || rect.bottom > 333 || !rect.isValidRect() || rect.width() == 0 || rect.height() == 0) return; - Graphics::Surface *screen = _vm->_system->lockScreen(); - if (state == kRectEnabled) - screen->frameRect(rect, _pixelFormat.RGBToColor(0, 255, 0)); + _mainScreen->frameRect(rect, _pixelFormat.RGBToColor(0, 255, 0)); else if (state == kRectUnreachable) - screen->frameRect(rect, _pixelFormat.RGBToColor(0, 0, 255)); + _mainScreen->frameRect(rect, _pixelFormat.RGBToColor(0, 0, 255)); else - screen->frameRect(rect, _pixelFormat.RGBToColor(255, 0, 0)); - - _vm->_system->unlockScreen(); + _mainScreen->frameRect(rect, _pixelFormat.RGBToColor(255, 0, 0)); } RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm) { |