diff options
author | Strangerke | 2015-12-22 20:03:50 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:35:34 +0100 |
commit | 8a3ff50d5c5f7a82c32f2b31ffc95a197acbf8d5 (patch) | |
tree | 2c95556029317937efd3c780069a287d11bf7fb3 /engines/lab/anim.cpp | |
parent | 8c9d65b8cbfad71c9751d982ee15ea4be856f6d9 (diff) | |
download | scummvm-rg350-8a3ff50d5c5f7a82c32f2b31ffc95a197acbf8d5.tar.gz scummvm-rg350-8a3ff50d5c5f7a82c32f2b31ffc95a197acbf8d5.tar.bz2 scummvm-rg350-8a3ff50d5c5f7a82c32f2b31ffc95a197acbf8d5.zip |
LAB: Remove _drawBitMap, make diffNextFrame a bit more readable
Diffstat (limited to 'engines/lab/anim.cpp')
-rw-r--r-- | engines/lab/anim.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index ee9fd64c89..dcf57184ce 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -68,7 +68,6 @@ Anim::Anim(LabEngine *vm) : _vm(vm) { _doBlack = false; _diffWidth = 0; _diffHeight = 0; - _drawBitMap = _vm->_graphics->_dispBitMap; for (int i = 0; i < 3 * 256; i++) _diffPalette[i] = 0; @@ -79,13 +78,14 @@ void Anim::diffNextFrame(bool onlyDiffData) { // Already done. return; - if (_vm->_graphics->_dispBitMap->_drawOnScreen) - _vm->_graphics->_dispBitMap->_planes[0] = _vm->_graphics->getCurrentDrawingBuffer(); + BitMap *disp = _vm->_graphics->_dispBitMap; + if (disp->_drawOnScreen) + disp->_planes[0] = _vm->_graphics->getCurrentDrawingBuffer(); - _vm->_graphics->_dispBitMap->_planes[1] = _vm->_graphics->_dispBitMap->_planes[0] + 0x10000; - _vm->_graphics->_dispBitMap->_planes[2] = _vm->_graphics->_dispBitMap->_planes[1] + 0x10000; - _vm->_graphics->_dispBitMap->_planes[3] = _vm->_graphics->_dispBitMap->_planes[2] + 0x10000; - _vm->_graphics->_dispBitMap->_planes[4] = _vm->_graphics->_dispBitMap->_planes[3] + 0x10000; + disp->_planes[1] = disp->_planes[0] + 0x10000; + disp->_planes[2] = disp->_planes[1] + 0x10000; + disp->_planes[3] = disp->_planes[2] + 0x10000; + disp->_planes[4] = disp->_planes[3] + 0x10000; _vm->_event->mouseHide(); @@ -123,7 +123,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { _isAnim = (_frameNum >= 3) && (!_playOnce); _curBit = 0; - if (_vm->_graphics->_dispBitMap->_drawOnScreen) + if (disp->_drawOnScreen) _vm->_graphics->screenUpdate(); // done with the next frame. @@ -145,14 +145,14 @@ void Anim::diffNextFrame(bool onlyDiffData) { case 10: if (onlyDiffData) warning("Boom"); - _diffFile->read(_drawBitMap->_planes[_curBit], _size); + _diffFile->read(disp->_planes[_curBit], _size); _curBit++; break; case 11: curPos = _diffFile->pos(); _diffFile->skip(4); - _vm->_utils->runLengthDecode(_drawBitMap->_planes[_curBit], _diffFile); + _vm->_utils->runLengthDecode(disp->_planes[_curBit], _diffFile); _curBit++; _diffFile->seek(curPos + _size, SEEK_SET); break; @@ -160,21 +160,21 @@ void Anim::diffNextFrame(bool onlyDiffData) { case 12: curPos = _diffFile->pos(); _diffFile->skip(4); - _vm->_utils->verticalRunLengthDecode(_drawBitMap->_planes[_curBit], _diffFile, _drawBitMap->_bytesPerRow); + _vm->_utils->verticalRunLengthDecode(disp->_planes[_curBit], _diffFile, disp->_bytesPerRow); _curBit++; _diffFile->seek(curPos + _size, SEEK_SET); break; case 20: curPos = _diffFile->pos(); - _vm->_utils->unDiff(_drawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap->_planes[_curBit], _diffFile, _drawBitMap->_bytesPerRow, false); + _vm->_utils->unDiff(disp->_planes[_curBit], disp->_planes[_curBit], _diffFile, disp->_bytesPerRow, false); _curBit++; _diffFile->seek(curPos + _size, SEEK_SET); break; case 21: curPos = _diffFile->pos(); - _vm->_utils->unDiff(_drawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap->_planes[_curBit], _diffFile, _drawBitMap->_bytesPerRow, true); + _vm->_utils->unDiff(disp->_planes[_curBit], disp->_planes[_curBit], _diffFile, disp->_bytesPerRow, true); _curBit++; _diffFile->seek(curPos + _size, SEEK_SET); break; @@ -214,7 +214,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { _vm->updateMusicAndEvents(); _vm->waitTOF(); - if (_vm->_graphics->_dispBitMap->_drawOnScreen) + if (disp->_drawOnScreen) didTOF = true; } } |