diff options
author | Filippos Karapetis | 2015-12-08 11:29:23 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:55 +0100 |
commit | 21fc36bfad679426f19e77c4d783ba809038735c (patch) | |
tree | 79dee21934ebe625b4dd5774336e7f75d6dc437b /engines/lab | |
parent | ae056a767ba8c983b7d38afd2532ba18fd3cb724 (diff) | |
download | scummvm-rg350-21fc36bfad679426f19e77c4d783ba809038735c.tar.gz scummvm-rg350-21fc36bfad679426f19e77c4d783ba809038735c.tar.bz2 scummvm-rg350-21fc36bfad679426f19e77c4d783ba809038735c.zip |
LAB: Get rid of _isBM
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/anim.cpp | 19 | ||||
-rw-r--r-- | engines/lab/anim.h | 7 | ||||
-rw-r--r-- | engines/lab/graphics.cpp | 4 | ||||
-rw-r--r-- | engines/lab/graphics.h | 2 | ||||
-rw-r--r-- | engines/lab/transitions.cpp | 4 |
5 files changed, 16 insertions, 20 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index 4927b25eae..fef1edfa4c 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -37,7 +37,6 @@ Anim::Anim(LabEngine *vm) : _vm(vm) { _header = 0; _curBit = 0; _numChunks = 1; - _isBM = false; _headerdata._width = 0; _headerdata._height = 0; _headerdata._fps = 0; @@ -78,7 +77,7 @@ void Anim::readBlock(void *Buffer, uint32 Size, byte **File) { (*File) += Size; } -void Anim::diffNextFrame() { +void Anim::diffNextFrame(bool onlyDiffData) { if (_header == 65535) /* Already done. */ return; @@ -96,7 +95,7 @@ void Anim::diffNextFrame() { if (_curBit >= _numChunks) { _vm->_event->mouseShow(); - if (!_isBM) { + if (!onlyDiffData) { if (_headerdata._fps) { _vm->waitForTime(_waitSec, _waitMicros); _vm->addCurTime(0L, _delayMicros, &_waitSec, &_waitMicros); @@ -110,7 +109,7 @@ void Anim::diffNextFrame() { _donePal = true; } - if (_isPal && !_noPalChange && !_isBM && !_donePal) { + if (_isPal && !_noPalChange && !onlyDiffData && !_donePal) { _vm->_graphics->setPalette(_diffPalette, 256); _isPal = false; } @@ -147,7 +146,7 @@ void Anim::diffNextFrame() { case 10L: _rawDiffBM._planes[_curBit] = _diffFile; - if (_isBM) + if (onlyDiffData) _diffFile += _size; else { readBlock(DrawBitMap->_planes[_curBit], _size, &_diffFile); @@ -246,7 +245,7 @@ void Anim::diffNextFrame() { /** * A separate task launched by readDiff. Plays the DIFF. */ -void Anim::playDiff(byte *buffer) { +void Anim::playDiff(byte *buffer, bool onlyDiffData) { _waitSec = 0L; _waitMicros = 0L; _delayMicros = 0L; @@ -325,9 +324,9 @@ void Anim::playDiff(byte *buffer) { if (_playOnce) { while (_header != 65535) - diffNextFrame(); + diffNextFrame(onlyDiffData); } else - diffNextFrame(); + diffNextFrame(onlyDiffData); } /** @@ -354,9 +353,9 @@ void Anim::stopDiffEnd() { /** * Reads in a DIFF file. */ -bool Anim::readDiff(byte *buffer, bool playOnce) { +bool Anim::readDiff(byte *buffer, bool playOnce, bool onlyDiffData) { _playOnce = playOnce; - playDiff(buffer); + playDiff(buffer, onlyDiffData); return true; } diff --git a/engines/lab/anim.h b/engines/lab/anim.h index 121edea20e..82732f063f 100644 --- a/engines/lab/anim.h +++ b/engines/lab/anim.h @@ -86,21 +86,20 @@ private: BitMap *DrawBitMap; void readBlock(void *Buffer, uint32 Size, byte **File); - void playDiff(byte *buffer); + void playDiff(byte *buffer, bool onlyDiffData = false); public: Anim(LabEngine *vm); DIFFHeader _headerdata; char _diffPalette[256 * 3]; - bool _isBM; /* Just fill in the RawDIFFBM structure */ bool _waitForEffect; /* Wait for each sound effect to finish before continuing. */ bool _doBlack; /* Black the screen before new picture */ bool _noPalChange; /* Don't change the palette. */ BitMap _rawDiffBM; - bool readDiff(byte *buffer, bool playOnce); - void diffNextFrame(); + bool readDiff(byte *buffer, bool playOnce, bool onlyDiffData = false); + void diffNextFrame(bool onlyDiffData = false); void stopDiff(); void stopDiffEnd(); }; diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp index 926dc7ce6d..0d4501ea52 100644 --- a/engines/lab/graphics.cpp +++ b/engines/lab/graphics.cpp @@ -77,7 +77,7 @@ void DisplayMan::loadPict(const char *filename) { /** * Reads in a picture into the dest bitmap. */ -void DisplayMan::readPict(const char *filename, bool playOnce) { +void DisplayMan::readPict(const char *filename, bool playOnce, bool onlyDiffData) { _vm->_anim->stopDiff(); loadPict(filename); @@ -91,7 +91,7 @@ void DisplayMan::readPict(const char *filename, bool playOnce) { _dispBitMap._rows = _screenHeight; _dispBitMap._flags = BITMAPF_VIDEO; - _vm->_anim->readDiff(_curBitmap, playOnce); + _vm->_anim->readDiff(_curBitmap, playOnce, onlyDiffData); } /** diff --git a/engines/lab/graphics.h b/engines/lab/graphics.h index 9c25295343..8798718529 100644 --- a/engines/lab/graphics.h +++ b/engines/lab/graphics.h @@ -75,7 +75,7 @@ public: virtual ~DisplayMan(); void loadPict(const char *filename); - void readPict(const char *filename, bool playOnce); + void readPict(const char *filename, bool playOnce, bool onlyDiffData = false); void freePict(); byte *readPictToMem(const char *filename, uint16 x, uint16 y); void doScrollBlack(); diff --git a/engines/lab/transitions.cpp b/engines/lab/transitions.cpp index 6f90718eda..c611266020 100644 --- a/engines/lab/transitions.cpp +++ b/engines/lab/transitions.cpp @@ -147,10 +147,8 @@ void DisplayMan::doScrollWipe(char *filename) { _vm->waitTOF(); } - _vm->_anim->_isBM = true; - readPict(filename, true); + readPict(filename, true, true); setPalette(_vm->_anim->_diffPalette, 256); - _vm->_anim->_isBM = false; byte *mem = _vm->_anim->_rawDiffBM._planes[0]; _vm->_music->updateMusic(); |