diff options
author | Filippos Karapetis | 2015-12-10 10:53:15 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:34:00 +0100 |
commit | 9c94d140dbf33e0cf29bc1d3791ecdc477e091c4 (patch) | |
tree | 7b161435dd9858dc84496607a9eef9ef82d2d321 /engines/lab | |
parent | 67b3960968b71d529236ab667bad0de5632fa5ea (diff) | |
download | scummvm-rg350-9c94d140dbf33e0cf29bc1d3791ecdc477e091c4.tar.gz scummvm-rg350-9c94d140dbf33e0cf29bc1d3791ecdc477e091c4.tar.bz2 scummvm-rg350-9c94d140dbf33e0cf29bc1d3791ecdc477e091c4.zip |
LAB: Simplify bitmap flags
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/anim.cpp | 8 | ||||
-rw-r--r-- | engines/lab/anim.h | 5 | ||||
-rw-r--r-- | engines/lab/dispman.cpp | 10 |
3 files changed, 10 insertions, 13 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index 563b5fe597..936c49223c 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -61,7 +61,7 @@ Anim::Anim(LabEngine *vm) : _vm(vm) { _diffFile = nullptr; _size = 0; _rawDiffBM._bytesPerRow = 0; - _rawDiffBM._flags = 0; + _rawDiffBM._drawOnScreen = false; for (int i = 0; i < 16; i++) _rawDiffBM._planes[i] = nullptr; _rawDiffBM._rows = 0; @@ -82,7 +82,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { // Already done. return; - if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO) { + if (_vm->_graphics->_dispBitMap->_drawOnScreen) { _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; @@ -125,7 +125,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { _isAnim = (_frameNum >= 3) && (!_playOnce); _curBit = 0; - if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO) + if (_vm->_graphics->_dispBitMap->_drawOnScreen) _vm->_graphics->screenUpdate(); // done with the next frame. @@ -218,7 +218,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { _vm->_music->updateMusic(); _vm->waitTOF(); - if (_vm->_graphics->_dispBitMap->_flags & BITMAPF_VIDEO) + if (_vm->_graphics->_dispBitMap->_drawOnScreen) didTOF = true; } } diff --git a/engines/lab/anim.h b/engines/lab/anim.h index 7669dc58da..797c5536f4 100644 --- a/engines/lab/anim.h +++ b/engines/lab/anim.h @@ -50,13 +50,10 @@ struct DIFFHeader { struct BitMap { uint16 _bytesPerRow; uint16 _rows; // unused - byte _flags; + bool _drawOnScreen; byte *_planes[16]; }; -#define BITMAPF_NONE 0 -#define BITMAPF_VIDEO (1<<7) - class Anim { private: LabEngine *_vm; diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index 13ffd07b59..ba2cfc846b 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -94,7 +94,7 @@ void DisplayMan::readPict(const char *filename, bool playOnce, bool onlyDiffData _dispBitMap->_bytesPerRow = _screenWidth; _dispBitMap->_rows = _screenHeight; - _dispBitMap->_flags = BITMAPF_VIDEO; + _dispBitMap->_drawOnScreen = true; _vm->_anim->readDiff(_curBitmap, playOnce, onlyDiffData); } @@ -102,7 +102,7 @@ void DisplayMan::readPict(const char *filename, bool playOnce, bool onlyDiffData /** * Reads in a picture into buffer memory. */ -byte *DisplayMan::readPictToMem(const char *filename, uint16 x, uint16 y) { +byte *DisplayMan::readPictToMem(const char *filename, uint16 width, uint16 height) { _vm->_anim->stopDiff(); loadPict(filename); @@ -112,9 +112,9 @@ 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->_bytesPerRow = width; + _dispBitMap->_rows = height; + _dispBitMap->_drawOnScreen = false; _dispBitMap->_planes[0] = _curBitmap; _dispBitMap->_planes[1] = _dispBitMap->_planes[0] + 0x10000; _dispBitMap->_planes[2] = _dispBitMap->_planes[1] + 0x10000; |