aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/graphics.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2010-11-29 20:58:58 +0000
committerBastien Bouclet2010-11-29 20:58:58 +0000
commitfcc1dd6749ea33bf8c9fd6e15a004bfeb7b3a47e (patch)
tree6d011cf1cd5a3aab26c76686c419564988adf2a6 /engines/mohawk/graphics.cpp
parentf8a4190e756d7e47ffc3b3c0caffbfcd57395f63 (diff)
downloadscummvm-rg350-fcc1dd6749ea33bf8c9fd6e15a004bfeb7b3a47e.tar.gz
scummvm-rg350-fcc1dd6749ea33bf8c9fd6e15a004bfeb7b3a47e.tar.bz2
scummvm-rg350-fcc1dd6749ea33bf8c9fd6e15a004bfeb7b3a47e.zip
MOHAWK: Implement 4 types of animated updates for Myst
svn-id: r54629
Diffstat (limited to 'engines/mohawk/graphics.cpp')
-rw-r--r--engines/mohawk/graphics.cpp76
1 files changed, 64 insertions, 12 deletions
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp
index 0f2fb62cf3..66adf6e35b 100644
--- a/engines/mohawk/graphics.cpp
+++ b/engines/mohawk/graphics.cpp
@@ -304,26 +304,78 @@ void MystGraphics::animatedUpdate(uint16 type, Common::Rect rect, uint16 steps,
_dirtyRects.clear();
switch (type) {
- case 0:
- debugC(kDebugScript, "Left to Right");
+ case 0: {
+ debugC(kDebugScript, "Left to Right");
+
+ uint16 step = (rect.right - rect.left) / steps;
+ Common::Rect area = rect;
+ for (uint i = 0; i < steps; i++) {
+ area.left = rect.left + step * i;
+ area.right = area.left + step;
+
+ _vm->_system->delayMillis(delay);
+
+ _dirtyRects.push_back(area);
+ updateScreen();
+ }
+ }
break;
- case 1:
- debugC(kDebugScript, "Right to Left");
+ case 1: {
+ debugC(kDebugScript, "Right to Left");
+
+ uint16 step = (rect.right - rect.left) / steps;
+ Common::Rect area = rect;
+ for (uint i = 0; i < steps; i++) {
+ area.right = rect.right - step * i;
+ area.left = area.right - step;
+
+ _vm->_system->delayMillis(delay);
+
+ _dirtyRects.push_back(area);
+ updateScreen();
+ }
+ }
break;
- case 5:
- debugC(kDebugScript, "Top to Bottom");
+ case 5: {
+ debugC(kDebugScript, "Top to Bottom");
+
+ uint16 step = (rect.bottom - rect.top) / steps;
+ Common::Rect area = rect;
+ for (uint i = 0; i < steps; i++) {
+ area.top = rect.top + step * i;
+ area.bottom = area.top + step;
+
+ _vm->_system->delayMillis(delay);
+
+ _dirtyRects.push_back(area);
+ updateScreen();
+ }
+ }
break;
- case 6:
- debugC(kDebugScript, "Bottom to Top");
+ case 6: {
+ debugC(kDebugScript, "Bottom to Top");
+
+ uint16 step = (rect.bottom - rect.top) / steps;
+ Common::Rect area = rect;
+ for (uint i = 0; i < steps; i++) {
+ area.bottom = rect.bottom - step * i;
+ area.top = area.bottom - step;
+
+ _vm->_system->delayMillis(delay);
+
+ _dirtyRects.push_back(area);
+ updateScreen();
+ }
+ }
break;
default:
warning("Unknown Update Direction");
+
+ //TODO: Replace minimal implementation
+ _dirtyRects.push_back(rect);
+ updateScreen();
break;
}
-
- //TODO: Replace minimal implementation
- _dirtyRects.push_back(rect);
- updateScreen();
}
void MystGraphics::drawRect(Common::Rect rect, RectState state) {