aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lab/anim.cpp63
-rw-r--r--engines/lab/anim.h3
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();