diff options
author | Paul Gilbert | 2015-05-27 22:36:51 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-05-27 22:36:51 -0400 |
commit | 45b4989b55a043a9d2f1806db375d9f91476ed89 (patch) | |
tree | fd1cfcad421e08a19313e53a19cd735152ab3568 /engines/sherlock/user_interface.cpp | |
parent | 0d4163c6e932bed2b85843f6ab3b5066d0353df6 (diff) | |
download | scummvm-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.cpp | 25 |
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 |