From d1b5d41005ea89e20ae449e6ea815b1dfb5997e6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 26 Dec 2015 12:45:48 +0200 Subject: LAB: Clean up sound effect looping, starting and stopping code --- engines/lab/anim.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/lab/anim.cpp') diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index eb825fb4c0..92ca49b95d 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -217,7 +217,9 @@ void Anim::diffNextFrame(bool onlyDiffData) { _sampleSpeed = _diffFile->readUint16LE(); _diffFile->skip(2); - _vm->_music->playSoundEffect(_sampleSpeed, _size, _diffFile); + // Sound effects embedded in animations are started here. These are + // usually animation-specific, like door opening sounds, and are not looped + _vm->_music->playSoundEffect(_sampleSpeed, _size, false, _diffFile); break; case 65535: -- cgit v1.2.3 From 07b554b847d9675d5d97b7ea36ac87ce17e6a1f3 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 26 Dec 2015 13:53:11 +0100 Subject: LAB: Add an access function to make _headerData a private member of Anim --- engines/lab/anim.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/lab/anim.cpp') diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index 92ca49b95d..ea7f568de3 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -80,6 +80,9 @@ void Anim::setOutputBuffer(byte *memoryBuffer) { _outputBuffer = memoryBuffer; } +uint16 Anim::getDIFFHeight() { + return _headerdata._height; +} void Anim::diffNextFrame(bool onlyDiffData) { if (_lastBlockHeader == 65535) @@ -90,7 +93,7 @@ void Anim::diffNextFrame(bool onlyDiffData) { byte *startOfBuf = _outputBuffer; int bufPitch = _vm->_graphics->_screenWidth; - if (!_outputBuffer) { + if (!startOfBuf) { startOfBuf = _vm->_graphics->getCurrentDrawingBuffer(); drawOnScreen = true; } -- cgit v1.2.3