aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/anim.cpp27
-rw-r--r--engines/lab/dispman.cpp3
2 files changed, 18 insertions, 12 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp
index 9507e0a907..7f7e488e9e 100644
--- a/engines/lab/anim.cpp
+++ b/engines/lab/anim.cpp
@@ -80,17 +80,24 @@ void Anim::diffNextFrame(bool onlyDiffData) {
return;
BitMap *disp = _vm->_graphics->_dispBitMap;
- if (disp->_drawOnScreen)
- disp->_buffer = _vm->_graphics->getCurrentDrawingBuffer();
-
- byte *endOfBuf = disp->_buffer + (int)_diffWidth * _diffHeight;
+ bool drawOnScreen = disp->_drawOnScreen;
+ byte *startOfBuf = disp->_buffer;
+ int bufPitch = disp->_bytesPerRow;
+
+ if (drawOnScreen) {
+ startOfBuf = _vm->_graphics->getCurrentDrawingBuffer();
+ bufPitch = _vm->_graphics->_screenWidth;
+ } else {
+ assert(startOfBuf);
+ }
+ byte *endOfBuf = startOfBuf + (int)_diffWidth * _diffHeight;
_vm->_event->mouseHide();
int curBit = 0;
while (1) {
- byte *buf = disp->_buffer + 0x10000 * curBit;
+ byte *buf = startOfBuf + 0x10000 * curBit;
if (buf >= endOfBuf) {
_vm->_event->mouseShow();
@@ -124,7 +131,7 @@ void Anim::diffNextFrame(bool onlyDiffData) {
_isAnim = (_frameNum >= 3) && (!_playOnce);
- if (disp->_drawOnScreen)
+ if (drawOnScreen)
_vm->_graphics->screenUpdate();
// done with the next frame.
@@ -167,21 +174,21 @@ void Anim::diffNextFrame(bool onlyDiffData) {
case 12:
curPos = _diffFile->pos();
_diffFile->skip(4);
- _vm->_utils->verticalRunLengthDecode(buf, _diffFile, disp->_bytesPerRow);
+ _vm->_utils->verticalRunLengthDecode(buf, _diffFile, bufPitch);
curBit++;
_diffFile->seek(curPos + _size, SEEK_SET);
break;
case 20:
curPos = _diffFile->pos();
- _vm->_utils->unDiff(buf, buf, _diffFile, disp->_bytesPerRow, false);
+ _vm->_utils->unDiff(buf, buf, _diffFile, bufPitch, false);
curBit++;
_diffFile->seek(curPos + _size, SEEK_SET);
break;
case 21:
curPos = _diffFile->pos();
- _vm->_utils->unDiff(buf, buf, _diffFile, disp->_bytesPerRow, true);
+ _vm->_utils->unDiff(buf, buf, _diffFile, bufPitch, true);
curBit++;
_diffFile->seek(curPos + _size, SEEK_SET);
break;
@@ -218,7 +225,7 @@ void Anim::diffNextFrame(bool onlyDiffData) {
_vm->updateMusicAndEvents();
_vm->waitTOF();
- if (disp->_drawOnScreen)
+ if (drawOnScreen)
didTOF = true;
}
}
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
index 2f376ac473..7f581e720b 100644
--- a/engines/lab/dispman.cpp
+++ b/engines/lab/dispman.cpp
@@ -97,8 +97,7 @@ void DisplayMan::readPict(const Common::String filename, bool playOnce, bool onl
_dispBitMap->_bytesPerRow = _screenWidth;
_dispBitMap->_drawOnScreen = (memoryBuffer == nullptr);
- if (memoryBuffer)
- _dispBitMap->_buffer = memoryBuffer;
+ _dispBitMap->_buffer = memoryBuffer;
_vm->_anim->readDiff(_curBitmap, playOnce, onlyDiffData);
}