diff options
author | Filippos Karapetis | 2015-12-07 11:25:13 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:54 +0100 |
commit | 320e658cb1e1d266cb3bf91ad9202ff83f88a9ad (patch) | |
tree | 19af3fd90c2ff5f102c3fb5174c6691619cf3b79 /engines | |
parent | b6397c0af78e6cfecd1f1f7fe9c0686cd6e27daa (diff) | |
download | scummvm-rg350-320e658cb1e1d266cb3bf91ad9202ff83f88a9ad.tar.gz scummvm-rg350-320e658cb1e1d266cb3bf91ad9202ff83f88a9ad.tar.bz2 scummvm-rg350-320e658cb1e1d266cb3bf91ad9202ff83f88a9ad.zip |
LAB: Get rid of the intermediate display bitmap pointer
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lab/anim.cpp | 22 | ||||
-rw-r--r-- | engines/lab/graphics.cpp | 24 | ||||
-rw-r--r-- | engines/lab/graphics.h | 3 |
3 files changed, 23 insertions, 26 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index b28222c4b4..6e12e92197 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -70,7 +70,7 @@ Anim::Anim(LabEngine *vm) : _vm(vm) { _diffWidth = 0; _diffHeight = 0; _dataBytesPerRow = 0; - DrawBitMap = &_vm->_graphics->bit1; + DrawBitMap = &_vm->_graphics->_dispBitMap; for (int i = 0; i < 3 * 256; i++) _diffPalette[i] = 0; @@ -389,12 +389,12 @@ void Anim::diffNextFrame() { if (_header == 65535) /* Already done. */ return; - if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO) { - _vm->_graphics->_dispBitMap->_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; + if (_vm->_graphics->_dispBitMap._flags & BITMAPF_VIDEO) { + _vm->_graphics->_dispBitMap._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; } _vm->_event->mouseHide(); @@ -432,7 +432,7 @@ void Anim::diffNextFrame() { _isAnim = (_frameNum >= 3) && (!_playOnce); _curBit = 0; - if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO) + if (_vm->_graphics->_dispBitMap._flags & BITMAPF_VIDEO) _vm->_graphics->screenUpdate(); return; /* done with the next frame. */ @@ -478,13 +478,13 @@ void Anim::diffNextFrame() { break; case 20L: - unDiff(DrawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap->_planes[_curBit], _diffFile, DrawBitMap->_bytesPerRow, false); + unDiff(DrawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap._planes[_curBit], _diffFile, DrawBitMap->_bytesPerRow, false); _curBit++; _diffFile += _size; break; case 21L: - unDiff(DrawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap->_planes[_curBit], _diffFile, DrawBitMap->_bytesPerRow, true); + unDiff(DrawBitMap->_planes[_curBit], _vm->_graphics->_dispBitMap._planes[_curBit], _diffFile, DrawBitMap->_bytesPerRow, true); _curBit++; _diffFile += _size; break; @@ -525,7 +525,7 @@ void Anim::diffNextFrame() { _vm->_music->updateMusic(); _vm->waitTOF(); - if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO) + if (_vm->_graphics->_dispBitMap._flags & BITMAPF_VIDEO) didTOF = true; } } diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp index 95551040c2..9dd23073b9 100644 --- a/engines/lab/graphics.cpp +++ b/engines/lab/graphics.cpp @@ -55,8 +55,6 @@ DisplayMan::DisplayMan(LabEngine *vm) : _vm(vm) { _screenWidth = 0; _screenHeight = 0; - _dispBitMap = &bit1; - for (int i = 0; i < 256 * 3; i++) _curvgapal[i] = 0; } @@ -139,9 +137,9 @@ void DisplayMan::readPict(const char *filename, bool playOnce) { if (!_vm->_music->_doNotFilestopSoundEffect) _vm->_music->stopSoundEffect(); - _dispBitMap->_bytesPerRow = _screenWidth; - _dispBitMap->_rows = _screenHeight; - _dispBitMap->_flags = BITMAPF_VIDEO; + _dispBitMap._bytesPerRow = _screenWidth; + _dispBitMap._rows = _screenHeight; + _dispBitMap._flags = BITMAPF_VIDEO; _vm->_anim->readDiff(_curBitmap, playOnce); } @@ -159,14 +157,14 @@ byte *DisplayMan::readPictToMem(const char *filename, uint16 x, uint16 y) { if (!_vm->_music->_doNotFilestopSoundEffect) _vm->_music->stopSoundEffect(); - _dispBitMap->_bytesPerRow = x; - _dispBitMap->_rows = y; - _dispBitMap->_flags = BITMAPF_NONE; - _dispBitMap->_planes[0] = _curBitmap; - _dispBitMap->_planes[1] = _dispBitMap->_planes[0] + 0x10000; - _dispBitMap->_planes[2] = _dispBitMap->_planes[1] + 0x10000; - _dispBitMap->_planes[3] = _dispBitMap->_planes[2] + 0x10000; - _dispBitMap->_planes[4] = _dispBitMap->_planes[3] + 0x10000; + _dispBitMap._bytesPerRow = x; + _dispBitMap._rows = y; + _dispBitMap._flags = BITMAPF_NONE; + _dispBitMap._planes[0] = _curBitmap; + _dispBitMap._planes[1] = _dispBitMap._planes[0] + 0x10000; + _dispBitMap._planes[2] = _dispBitMap._planes[1] + 0x10000; + _dispBitMap._planes[3] = _dispBitMap._planes[2] + 0x10000; + _dispBitMap._planes[4] = _dispBitMap._planes[3] + 0x10000; _vm->_anim->readDiff(_curBitmap, true); diff --git a/engines/lab/graphics.h b/engines/lab/graphics.h index 9011b22c83..9975cf39c1 100644 --- a/engines/lab/graphics.h +++ b/engines/lab/graphics.h @@ -164,8 +164,7 @@ public: byte *_currentDisplayBuffer; bool _doNotDrawMessage; uint16 *FadePalette; - BitMap bit1; - BitMap *_dispBitMap; + BitMap _dispBitMap; }; } // End of namespace Lab |