diff options
author | Filippos Karapetis | 2015-12-10 03:15:13 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:33:59 +0100 |
commit | e7a0e05301b0f08c0c3271d20fd24a2a4d0f2e71 (patch) | |
tree | c77bfd0de32b300d3efd1120985615080880859d | |
parent | b586f76f94a33627a2a578539001860a7ff62297 (diff) | |
download | scummvm-rg350-e7a0e05301b0f08c0c3271d20fd24a2a4d0f2e71.tar.gz scummvm-rg350-e7a0e05301b0f08c0c3271d20fd24a2a4d0f2e71.tar.bz2 scummvm-rg350-e7a0e05301b0f08c0c3271d20fd24a2a4d0f2e71.zip |
LAB: Merge playDiff() into readDiff()
-rw-r--r-- | engines/lab/anim.cpp | 63 | ||||
-rw-r--r-- | engines/lab/anim.h | 3 |
2 files changed, 29 insertions, 37 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index 5f7797493b..f60c1e1be7 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -251,9 +251,31 @@ void Anim::diffNextFrame(bool onlyDiffData) { } /** - * A separate task launched by readDiff. Plays the DIFF. + * Stops an animation from running. + */ +void Anim::stopDiff() { + if (_isPlaying && _isAnim) + _vm->_graphics->blackScreen(); +} + +/** + * Stops an animation from running. + */ +void Anim::stopDiffEnd() { + if (_isPlaying) { + _stopPlayingEnd = true; + while (_isPlaying) { + _vm->_music->updateMusic(); + diffNextFrame(); + } + } +} + +/** + * Reads in a DIFF file. */ -void Anim::playDiff(byte *buffer, bool onlyDiffData) { +void Anim::readDiff(byte *buffer, bool playOnce, bool onlyDiffData) { + _playOnce = playOnce; _waitSec = 0L; _waitMicros = 0L; _delayMicros = 0L; @@ -316,9 +338,9 @@ void Anim::playDiff(byte *buffer, bool onlyDiffData) { _diffHeight = _headerdata._height; _vm->_utils->setBytesPerRow(_diffWidth); - _numChunks = (((int32) _diffWidth) * _diffHeight) / 0x10000; + _numChunks = (((int32)_diffWidth) * _diffHeight) / 0x10000; - if ((uint32)(_numChunks * 0x10000) < (uint32)(((int32) _diffWidth) * _diffHeight)) + if ((uint32)(_numChunks * 0x10000) < (uint32)(((int32)_diffWidth) * _diffHeight)) _numChunks++; } else { return; @@ -333,38 +355,9 @@ void Anim::playDiff(byte *buffer, bool onlyDiffData) { if (_playOnce) { while (_header != 65535) diffNextFrame(onlyDiffData); - } else - diffNextFrame(onlyDiffData); -} - -/** - * Stops an animation from running. - */ -void Anim::stopDiff() { - if (_isPlaying && _isAnim) - _vm->_graphics->blackScreen(); -} - -/** - * Stops an animation from running. - */ -void Anim::stopDiffEnd() { - if (_isPlaying) { - _stopPlayingEnd = true; - while (_isPlaying) { - _vm->_music->updateMusic(); - diffNextFrame(); - } } -} - -/** - * Reads in a DIFF file. - */ -bool Anim::readDiff(byte *buffer, bool playOnce, bool onlyDiffData) { - _playOnce = playOnce; - playDiff(buffer, onlyDiffData); - return true; + else + diffNextFrame(onlyDiffData); } } // End of namespace Lab diff --git a/engines/lab/anim.h b/engines/lab/anim.h index 91bc0d724a..207b3e3e8a 100644 --- a/engines/lab/anim.h +++ b/engines/lab/anim.h @@ -84,7 +84,6 @@ private: BitMap *DrawBitMap; void readBlock(void *Buffer, uint32 Size, byte **File); - void playDiff(byte *buffer, bool onlyDiffData = false); public: Anim(LabEngine *vm); @@ -96,7 +95,7 @@ public: bool _noPalChange; // Don't change the palette. BitMap _rawDiffBM; - bool readDiff(byte *buffer, bool playOnce, bool onlyDiffData = false); + void readDiff(byte *buffer, bool playOnce, bool onlyDiffData = false); void diffNextFrame(bool onlyDiffData = false); void stopDiff(); void stopDiffEnd(); |