diff options
author | Willem Jan Palenstijn | 2015-12-24 16:53:32 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-24 16:53:32 +0100 |
commit | 60657f9fd22154d6e554a8e5516a489547c70a84 (patch) | |
tree | fad4cd5ca18f849e6b76d47d3f33bba237562fde /engines | |
parent | d98d39c315bce9577093770c8b39d83bc0aa34ba (diff) | |
download | scummvm-rg350-60657f9fd22154d6e554a8e5516a489547c70a84.tar.gz scummvm-rg350-60657f9fd22154d6e554a8e5516a489547c70a84.tar.bz2 scummvm-rg350-60657f9fd22154d6e554a8e5516a489547c70a84.zip |
LAB: Simplify Anim output to buffer
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lab/anim.cpp | 20 | ||||
-rw-r--r-- | engines/lab/anim.h | 8 |
2 files changed, 8 insertions, 20 deletions
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp index 6e9b04f7f1..eb825fb4c0 100644 --- a/engines/lab/anim.cpp +++ b/engines/lab/anim.cpp @@ -68,9 +68,7 @@ Anim::Anim(LabEngine *vm) : _vm(vm) { for (int i = 0; i < 3 * 256; i++) _diffPalette[i] = 0; - _dispBitMap._bytesPerRow = _vm->_graphics->_screenWidth; - _dispBitMap._drawOnScreen = true; - _dispBitMap._buffer = nullptr; + _outputBuffer = nullptr; // output to screen } Anim::~Anim() { @@ -79,9 +77,7 @@ Anim::~Anim() { } void Anim::setOutputBuffer(byte *memoryBuffer) { - _dispBitMap._bytesPerRow = _vm->_graphics->_screenWidth; - _dispBitMap._drawOnScreen = (memoryBuffer == nullptr); - _dispBitMap._buffer = memoryBuffer; + _outputBuffer = memoryBuffer; } @@ -90,15 +86,13 @@ void Anim::diffNextFrame(bool onlyDiffData) { // Already done. return; - bool drawOnScreen = _dispBitMap._drawOnScreen; - byte *startOfBuf = _dispBitMap._buffer; - int bufPitch = _dispBitMap._bytesPerRow; + bool drawOnScreen = false; + byte *startOfBuf = _outputBuffer; + int bufPitch = _vm->_graphics->_screenWidth; - if (drawOnScreen) { + if (!_outputBuffer) { startOfBuf = _vm->_graphics->getCurrentDrawingBuffer(); - bufPitch = _vm->_graphics->_screenWidth; - } else { - assert(startOfBuf); + drawOnScreen = true; } byte *endOfBuf = startOfBuf + (int)_diffWidth * _diffHeight; diff --git a/engines/lab/anim.h b/engines/lab/anim.h index f9f72bbd20..1979aa5979 100644 --- a/engines/lab/anim.h +++ b/engines/lab/anim.h @@ -43,12 +43,6 @@ struct DIFFHeader { uint32 _flags; }; -struct BitMap { - uint16 _bytesPerRow; - bool _drawOnScreen; - byte *_buffer; -}; - class Anim { private: LabEngine *_vm; @@ -71,7 +65,7 @@ private: uint32 _diffWidth; uint32 _diffHeight; - BitMap _dispBitMap; + byte *_outputBuffer; public: Anim(LabEngine *vm); |