aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword1/animation.cpp4
-rw-r--r--graphics/dxa_player.cpp12
-rw-r--r--graphics/dxa_player.h1
3 files changed, 11 insertions, 6 deletions
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index 498f185f70..afe9a13bd1 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -348,9 +348,9 @@ void MoviePlayerDXA::processFrame(void) {
}
void MoviePlayerDXA::updateScreen(void) {
- // Using _scaledBuffer directly should work, as long as we don't do any
+ // Using _drawBuffer directly should work, as long as we don't do any
// post-processing of the frame.
- _sys->copyRectToScreen(_scaledBuffer, _frameWidth, _frameX, _frameY, _frameWidth, _frameHeight);
+ _sys->copyRectToScreen(_drawBuffer, _frameWidth, _frameX, _frameY, _frameWidth, _frameHeight);
_sys->updateScreen();
}
diff --git a/graphics/dxa_player.cpp b/graphics/dxa_player.cpp
index d4e216d27d..157b5ef24e 100644
--- a/graphics/dxa_player.cpp
+++ b/graphics/dxa_player.cpp
@@ -35,6 +35,7 @@ DXAPlayer::DXAPlayer() {
_frameBuffer1 = 0;
_frameBuffer2 = 0;
_scaledBuffer = 0;
+ _drawBuffer = 0;
_width = 0;
_height = 0;
@@ -146,7 +147,7 @@ void DXAPlayer::copyFrameToBuffer(byte *dst, uint x, uint y, uint pitch) {
uint h = _height;
uint w = _width;
- byte *src = _scaledBuffer;
+ byte *src = _drawBuffer;
dst += y * pitch + x;
do {
@@ -510,18 +511,21 @@ void DXAPlayer::decodeNextFrame() {
switch (_scaleMode) {
case S_INTERLACED:
- memset(_scaledBuffer, 0, _width * _height);
- for (int cy = 0; cy < _curHeight; cy++)
+ for (int cy = 0; cy < _curHeight; cy++) {
memcpy(&_scaledBuffer[2 * cy * _width], &_frameBuffer1[cy * _width], _width);
+ memset(&_scaledBuffer[((2 * cy) + 1) * _width], 0, _width);
+ }
+ _drawBuffer = _scaledBuffer;
break;
case S_DOUBLE:
for (int cy = 0; cy < _curHeight; cy++) {
memcpy(&_scaledBuffer[2 * cy * _width], &_frameBuffer1[cy * _width], _width);
memcpy(&_scaledBuffer[((2 * cy) + 1) * _width], &_frameBuffer1[cy * _width], _width);
}
+ _drawBuffer = _scaledBuffer;
break;
case S_NONE:
- memcpy(_scaledBuffer, _frameBuffer1, _width * _height);
+ _drawBuffer = _frameBuffer1;
break;
}
}
diff --git a/graphics/dxa_player.h b/graphics/dxa_player.h
index 09cfb021a9..a6e751c8a3 100644
--- a/graphics/dxa_player.h
+++ b/graphics/dxa_player.h
@@ -45,6 +45,7 @@ protected:
byte *_frameBuffer1;
byte *_frameBuffer2;
byte *_scaledBuffer;
+ byte *_drawBuffer;
uint16 _width;
uint16 _height, _curHeight;
uint16 _framesCount;