diff options
author | Filippos Karapetis | 2015-12-23 21:29:58 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:43:17 +0100 |
commit | 9dae9eb811dfafaf109dd9d17cc12ffba128428a (patch) | |
tree | b3395360269de1e45a3a4dbec5cd7ea07b55bf79 /engines/lab/dispman.cpp | |
parent | c9049f232902e7856cb1e27cf6fa333374d46e6f (diff) | |
download | scummvm-rg350-9dae9eb811dfafaf109dd9d17cc12ffba128428a.tar.gz scummvm-rg350-9dae9eb811dfafaf109dd9d17cc12ffba128428a.tar.bz2 scummvm-rg350-9dae9eb811dfafaf109dd9d17cc12ffba128428a.zip |
LAB: Implement the scroll buffer of doScrollWipe() and doScrollBounce()
This was left out from previous refactoring. Also, simplify
doScrollBounce()
Diffstat (limited to 'engines/lab/dispman.cpp')
-rw-r--r-- | engines/lab/dispman.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index 2e133500e8..cbf7575ff2 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -704,7 +704,7 @@ void DisplayMan::doScrollWipe(const Common::String filename) { readPict(filename, true, true); setPalette(_vm->_anim->_diffPalette, 256); - byte *mem = _vm->_anim->_rawDiffBM._planes[0]; + byte *mem = _vm->_anim->_scrollScreenBuffer; _vm->updateMusicAndEvents(); uint16 by = _vm->_utils->vgaScaleX(3); @@ -744,42 +744,28 @@ void DisplayMan::doScrollWipe(const Common::String filename) { } void DisplayMan::doScrollBounce() { - const uint16 *newby, *newby1; - - const uint16 newbyd[5] = {5, 4, 3, 2, 1}, newby1d[8] = {3, 3, 2, 2, 2, 1, 1, 1}; - const uint16 newbyw[5] = {10, 8, 6, 4, 2}, newby1w[8] = {6, 6, 4, 4, 4, 2, 2, 2}; - - if (_vm->getPlatform() != Common::kPlatformWindows) { - newby = newbyd; - newby1 = newby1d; - } else { - newby = newbyw; - newby1 = newby1w; - } + const uint16 offsets[8] = { 3, 3, 2, 2, 2, 1, 1, 1 }; + const int multiplier = (_vm->_isHiRes) ? 2 : 1; _vm->_event->mouseHide(); int width = _vm->_utils->vgaScaleX(320); int height = _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2); - byte *mem = _vm->_anim->_rawDiffBM._planes[0]; + byte *mem = _vm->_anim->_scrollScreenBuffer; _vm->updateMusicAndEvents(); int startLine = _vm->_anim->_headerdata._height - height - 1; for (int i = 0; i < 5; i++) { _vm->updateMusicAndEvents(); - startLine -= newby[i]; + startLine -= (5 - i) * multiplier; copyPage(width, height, 0, startLine, mem); - - screenUpdate(); _vm->waitTOF(); } for (int i = 8; i > 0; i--) { _vm->updateMusicAndEvents(); - startLine += newby1[i - 1]; + startLine += offsets[i - 1] * multiplier; copyPage(width, height, 0, startLine, mem); - - screenUpdate(); _vm->waitTOF(); } |