aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/anim.cpp20
-rw-r--r--engines/lab/anim.h8
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);