diff options
author | Filippos Karapetis | 2015-12-23 21:29:58 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:43:17 +0100 |
commit | 9dae9eb811dfafaf109dd9d17cc12ffba128428a (patch) | |
tree | b3395360269de1e45a3a4dbec5cd7ea07b55bf79 /engines/lab/anim.cpp | |
parent | c9049f232902e7856cb1e27cf6fa333374d46e6f (diff) | |
download | scummvm-rg350-9dae9eb811dfafaf109dd9d17cc12ffba128428a.tar.gz scummvm-rg350-9dae9eb811dfafaf109dd9d17cc12ffba128428a.tar.bz2 scummvm-rg350-9dae9eb811dfafaf109dd9d17cc12ffba128428a.zip |
LAB: Implement the scroll buffer of doScrollWipe() and doScrollBounce()
This was left out from previous refactoring. Also, simplify
doScrollBounce()
Diffstat (limited to 'engines/lab/anim.cpp')
-rw-r--r-- | engines/lab/anim.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index 9444a8f9bc..5f469d8188 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -58,10 +58,7 @@ Anim::Anim(LabEngine *vm) : _vm(vm) { _diffFile = nullptr; _diffFileStart = 0; _size = 0; - _rawDiffBM._bytesPerRow = 0; - _rawDiffBM._drawOnScreen = false; - for (int i = 0; i < 16; i++) - _rawDiffBM._planes[i] = nullptr; + _scrollScreenBuffer = nullptr; _waitForEffect = false; _stopPlayingEnd = false; _sampleSpeed = 0; @@ -73,6 +70,11 @@ Anim::Anim(LabEngine *vm) : _vm(vm) { _diffPalette[i] = 0; } +Anim::~Anim() { + delete[] _vm->_anim->_scrollScreenBuffer; + _vm->_anim->_scrollScreenBuffer = nullptr; +} + void Anim::diffNextFrame(bool onlyDiffData) { if (_lastBlockHeader == 65535) // Already done. @@ -143,9 +145,15 @@ void Anim::diffNextFrame(bool onlyDiffData) { break; case 10: - if (onlyDiffData) - warning("Boom"); - _diffFile->read(disp->_planes[_curBit], _size); + if (onlyDiffData) { + if (_curBit > 0) + error("diffNextFrame: attempt to read screen to non-zero plane (%d)", _curBit); + delete[] _scrollScreenBuffer; + _scrollScreenBuffer = new byte[_headerdata._width * _headerdata._height]; + _diffFile->read(_scrollScreenBuffer, _size); + } else { + _diffFile->read(disp->_planes[_curBit], _size); + } _curBit++; break; @@ -325,8 +333,8 @@ void Anim::readDiff(Common::File *diffFile, bool playOnce, bool onlyDiffData) { assert(_numChunks < 16); - for (int i = 0; i < 8; i++) - _rawDiffBM._planes[i] = nullptr; + delete[] _scrollScreenBuffer; + _scrollScreenBuffer = nullptr; if (_headerdata._fps) _delayMicros = 1000 / _headerdata._fps; |