aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/user_interface.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-27 22:36:51 -0400
committerPaul Gilbert2015-05-27 22:36:51 -0400
commit45b4989b55a043a9d2f1806db375d9f91476ed89 (patch)
treefd1cfcad421e08a19313e53a19cd735152ab3568 /engines/sherlock/user_interface.cpp
parent0d4163c6e932bed2b85843f6ab3b5066d0353df6 (diff)
downloadscummvm-rg350-45b4989b55a043a9d2f1806db375d9f91476ed89.tar.gz
scummvm-rg350-45b4989b55a043a9d2f1806db375d9f91476ed89.tar.bz2
scummvm-rg350-45b4989b55a043a9d2f1806db375d9f91476ed89.zip
SHERLOCK: Implement RT scrolling code
Diffstat (limited to 'engines/sherlock/user_interface.cpp')
-rw-r--r--engines/sherlock/user_interface.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp
index 06ec62b6a2..5858daffc5 100644
--- a/engines/sherlock/user_interface.cpp
+++ b/engines/sherlock/user_interface.cpp
@@ -2352,6 +2352,31 @@ void TattooUserInterface::doBgAnimRestoreUI() {
screen.restoreBackground(scene._activeCAnim._removeBounds);
}
+void TattooUserInterface::doScroll() {
+ Screen &screen = *_vm->_screen;
+ int oldScroll = screen._currentScroll;
+
+ // If we're already at the target scroll position, nothing needs to be done
+ if (screen._targetScroll == screen._currentScroll)
+ return;
+
+ screen._flushScreen = true;
+ if (screen._targetScroll > screen._currentScroll) {
+ screen._currentScroll += screen._scrollSpeed;
+ if (screen._currentScroll > screen._targetScroll)
+ screen._currentScroll = screen._targetScroll;
+ } else if (screen._targetScroll < screen._currentScroll) {
+ screen._currentScroll -= screen._scrollSpeed;
+ if (screen._currentScroll < screen._targetScroll)
+ screen._currentScroll = screen._targetScroll;
+ }
+
+ if (_menuBuffer != nullptr)
+ _menuBounds.translate(screen._currentScroll - oldScroll, 0);
+ if (_invMenuBuffer != nullptr)
+ _invMenuBounds.translate(screen._currentScroll - oldScroll, 0);
+}
+
} // End of namespace Tattoo
} // End of namespace Sherlock