aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sludge/backdrop.cpp7
-rw-r--r--engines/sludge/main_loop.cpp2
-rw-r--r--engines/sludge/sludger.cpp4
-rw-r--r--engines/sludge/sprites.cpp6
4 files changed, 10 insertions, 9 deletions
diff --git a/engines/sludge/backdrop.cpp b/engines/sludge/backdrop.cpp
index bd087766c9..1079b57d94 100644
--- a/engines/sludge/backdrop.cpp
+++ b/engines/sludge/backdrop.cpp
@@ -45,10 +45,12 @@
#include "graphics/palette.h"
#include "sludge.h"
#include "imgloader.h"
+#include "common/rect.h"
namespace Sludge {
extern inputType input;
+extern Graphics::Surface renderSurface;
bool freeze();
void unfreeze(bool); // Because FREEZE.H needs a load of other includes
@@ -536,10 +538,7 @@ inline int sortOutPCamera(int cX, int fX, int sceneMax, int boxMax) {
}
void drawBackDrop() {
- g_system->copyRectToScreen(backdropSurface.getPixels(),
- backdropSurface.pitch, 0, 0, backdropSurface.w,
- backdropSurface.h);
- g_system->updateScreen();
+ renderSurface.copyRectToSurface(backdropSurface, 0, 0, Common::Rect(0, 0, backdropSurface.w, backdropSurface.h));
#if 0
setPrimaryColor(1.0, 1.0, 1.0, 1.0);
diff --git a/engines/sludge/main_loop.cpp b/engines/sludge/main_loop.cpp
index 55e2fc6f6d..14ffed0595 100644
--- a/engines/sludge/main_loop.cpp
+++ b/engines/sludge/main_loop.cpp
@@ -100,6 +100,7 @@ extern int specialSettings;
extern inputType input;
extern variableStack *noStack;
extern Graphics::Surface backdropSurface;
+Graphics::Surface renderSurface;
int dialogValue = 0;
@@ -473,6 +474,7 @@ int main_loop(char *filename)
SDL_EnableUNICODE(1);
#endif
+ renderSurface.create(g_system->getWidth(), g_system->getHeight(), g_system->getScreenFormat());
weAreDoneSoQuit = 0;
while (!weAreDoneSoQuit) {
checkInput();
diff --git a/engines/sludge/sludger.cpp b/engines/sludge/sludger.cpp
index aca52728d5..9f802283dd 100644
--- a/engines/sludge/sludger.cpp
+++ b/engines/sludge/sludger.cpp
@@ -76,6 +76,7 @@ extern char *launchMe;
extern variable *launchResult;
extern bool reallyWantToQuit;
+extern Graphics::Surface renderSurface;
int numBIFNames = 0;
char * *allBIFNames = NULL;
@@ -715,7 +716,8 @@ void sludgeDisplay() {
viewSpeech();// ...and anything being said
drawStatusBar();
displayCursor();
-
+ g_system->copyRectToScreen((byte *)renderSurface.getPixels(), renderSurface.pitch, 0, 0, renderSurface.w, renderSurface.h);
+ g_system->updateScreen();
if (brightnessLevel < 255) fixBrightness();// This is for transitionLevel special effects
#if 0
glFlush();
diff --git a/engines/sludge/sprites.cpp b/engines/sludge/sprites.cpp
index baa10da783..ef6d5218e3 100644
--- a/engines/sludge/sprites.cpp
+++ b/engines/sludge/sprites.cpp
@@ -48,6 +48,7 @@ extern GLuint backdropTextureName;
extern inputType input;
extern int cameraX, cameraY;
extern float cameraZoom;
+extern Graphics::Surface renderSurface;
unsigned char currentBurnR = 0, currentBurnG = 0, currentBurnB = 0;
@@ -615,10 +616,7 @@ bool scaleSprite(sprite &single, const spritePalette &fontPal, onScreenPerson *t
// Use Transparent surface to scale and blit
Graphics::TransparentSurface tmp(single.surface, false);
- Graphics::Surface *screen = g_system->lockScreen();
- tmp.blit(*screen, x1, y1, (mirror? Graphics::FLIP_H : Graphics::FLIP_NONE), nullptr, TS_ARGB(255, 255, 255, 255), diffX, diffY);
- g_system->unlockScreen();
- g_system->updateScreen();
+ tmp.blit(renderSurface, x1, y1, (mirror? Graphics::FLIP_H : Graphics::FLIP_NONE), nullptr, TS_ARGB(255, 255, 255, 255), diffX, diffY);
#if 0
GLfloat z;