aboutsummaryrefslogtreecommitdiff
path: root/engines/lab/anim.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-12-24 16:53:32 +0100
committerWillem Jan Palenstijn2015-12-24 16:53:32 +0100
commit60657f9fd22154d6e554a8e5516a489547c70a84 (patch)
treefad4cd5ca18f849e6b76d47d3f33bba237562fde /engines/lab/anim.cpp
parentd98d39c315bce9577093770c8b39d83bc0aa34ba (diff)
downloadscummvm-rg350-60657f9fd22154d6e554a8e5516a489547c70a84.tar.gz
scummvm-rg350-60657f9fd22154d6e554a8e5516a489547c70a84.tar.bz2
scummvm-rg350-60657f9fd22154d6e554a8e5516a489547c70a84.zip
LAB: Simplify Anim output to buffer
Diffstat (limited to 'engines/lab/anim.cpp')
-rw-r--r--engines/lab/anim.cpp20
1 files changed, 7 insertions, 13 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;