aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/drascula/graphics.cpp')
-rw-r--r--engines/drascula/graphics.cpp39
1 files changed, 25 insertions, 14 deletions
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index 7f1efa5d83..e6c5f69235 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -24,6 +24,7 @@
*/
#include "drascula/drascula.h"
+#include "graphics/surface.h"
namespace Drascula {
@@ -126,16 +127,18 @@ void DrasculaEngine::showFrame(bool firstFrame) {
}
byte *prevFrame = (byte *)malloc(64000);
- memcpy(prevFrame, VGA, 64000);
+ byte *screenBuffer = (byte *)_system->lockScreen()->pixels;
+ memcpy(prevFrame, screenBuffer, 64000);
- decodeRLE(pcxData, VGA);
+ decodeRLE(pcxData, screenBuffer);
free(pcxData);
if (!firstFrame)
- mixVideo(VGA, prevFrame);
+ mixVideo(screenBuffer, prevFrame);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ _system->unlockScreen();
_system->updateScreen();
+
if (firstFrame)
setPalette(cPal);
@@ -192,8 +195,9 @@ void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int width,
}
void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int width, int height, byte *buffer) {
- copyBackground(xorg, yorg, xdes, ydes, width, height, buffer, VGA);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ byte *screenBuffer = (byte *)_system->lockScreen()->pixels;
+ copyBackground(xorg, yorg, xdes, ydes, width, height, buffer, screenBuffer);
+ _system->unlockScreen();
_system->updateScreen();
}
@@ -421,6 +425,7 @@ void DrasculaEngine::screenSaver() {
int x1_, y1_, off1, off2;
+ byte *screenBuffer = (byte *)_system->lockScreen()->pixels;
for (int i = 0; i < 200; i++) {
for (int j = 0; j < 320; j++) {
x1_ = j + tempRow[i];
@@ -438,10 +443,11 @@ void DrasculaEngine::screenSaver() {
y1_ = checkWrapY(y1_);
off2 = 320 * y1_ + x1_;
- VGA[320 * i + j] = ghost[bgSurface[off2] + (copia[off1] << 8)];
+ screenBuffer[320 * i + j] = ghost[bgSurface[off2] + (copia[off1] << 8)];
}
}
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+
+ _system->unlockScreen();
_system->updateScreen();
_system->delayMillis(20);
@@ -534,11 +540,14 @@ int DrasculaEngine::playFrameSSN() {
decodeRLE(BufferSSN, screenSurface);
free(BufferSSN);
waitFrameSSN();
+
+ byte *screenBuffer = (byte *)_system->lockScreen()->pixels;
if (FrameSSN)
- mixVideo(VGA, screenSurface);
+ mixVideo(screenBuffer, screenSurface);
else
- memcpy(VGA, screenSurface, 64000);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ memcpy(screenBuffer, screenSurface, 64000);
+
+ _system->unlockScreen();
_system->updateScreen();
FrameSSN++;
} else {
@@ -553,11 +562,13 @@ int DrasculaEngine::playFrameSSN() {
decodeOffset(BufferSSN, screenSurface, length);
free(BufferSSN);
waitFrameSSN();
+ byte *screenBuffer = (byte *)_system->lockScreen()->pixels;
if (FrameSSN)
- mixVideo(VGA, screenSurface);
+ mixVideo(screenBuffer, screenSurface);
else
- memcpy(VGA, screenSurface, 64000);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ memcpy(screenBuffer, screenSurface, 64000);
+
+ _system->unlockScreen();
_system->updateScreen();
FrameSSN++;
}