diff options
author | Filippos Karapetis | 2015-12-23 12:59:30 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:43:16 +0100 |
commit | 8de38a8d1094ed9cbf3f3377091981cbad6176a9 (patch) | |
tree | 84c04cc3754c56bb2a2a40e2e49f0fc4a89195c9 | |
parent | 7a81e03b254a6615290b2761ca6ea1c0e30e64c8 (diff) | |
download | scummvm-rg350-8de38a8d1094ed9cbf3f3377091981cbad6176a9.tar.gz scummvm-rg350-8de38a8d1094ed9cbf3f3377091981cbad6176a9.tar.bz2 scummvm-rg350-8de38a8d1094ed9cbf3f3377091981cbad6176a9.zip |
LAB: Greatly simplify doScrollBlack() using scrollDisplayY()
This also fixes a crash when crossing the street
-rw-r--r-- | engines/lab/dispman.cpp | 61 |
1 files changed, 8 insertions, 53 deletions
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index fda890dd19..f6705ff0a3 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -648,68 +648,23 @@ void DisplayMan::drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const void DisplayMan::doScrollBlack() { uint16 width = _vm->_utils->vgaScaleX(320); uint16 height = _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2); - byte *mem = new byte[width * height]; _vm->_event->mouseHide(); - Image img(_vm); - img._width = width; - img._height = height; - img._imageData = mem; - _vm->updateMusicAndEvents(); - img.readScreenImage(0, 0); - _vm->updateMusicAndEvents(); + byte *mem = new byte[width * height]; + int16 by = _vm->_utils->vgaScaleX(4); + int16 verticalScroll = height; - byte *baseAddr = getCurrentDrawingBuffer(); - uint16 by = _vm->_utils->vgaScaleX(4); - uint16 nheight = height; + while (verticalScroll > 0) { + scrollDisplayY(-by, 0, 0, width - 1, height - 1, mem); + verticalScroll -= by; - while (nheight) { _vm->updateMusicAndEvents(); - - if (!_vm->_isHiRes) - _vm->waitTOF(); - - baseAddr = getCurrentDrawingBuffer(); - - if (by > nheight) - by = nheight; - - mem += by * width; - nheight -= by; - uint32 copySize; - uint32 size = (int32)nheight * (int32)width; - byte *tempMem = mem; - - while (size) { - if (size > _screenBytesPerPage) - copySize = _screenBytesPerPage; - else - copySize = size; - - size -= copySize; - - memcpy(baseAddr, tempMem, copySize); - tempMem += copySize; - } - - setPen(0); - rectFill(0, nheight, width - 1, nheight + by - 1); - - screenUpdate(); - - if (!_vm->_isHiRes) { - if (nheight <= (height / 8)) - by = 1; - else if (nheight <= (height / 4)) - by = 2; - else if (nheight <= (height / 2)) - by = 3; - } + _vm->waitTOF(); } delete[] mem; - freePict(); + _vm->_event->mouseShow(); } |