aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/gfxModule.cpp18
-rw-r--r--engines/cruise/gfxModule.h3
-rw-r--r--engines/cruise/mainDraw.cpp4
3 files changed, 20 insertions, 5 deletions
diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp
index cb73ff0ae2..05cc5ce3bf 100644
--- a/engines/cruise/gfxModule.cpp
+++ b/engines/cruise/gfxModule.cpp
@@ -276,13 +276,11 @@ static void mergeClipRects() {
}
}
-void flip() {
- RectList::iterator dr;
- int i;
+void gfxModuleData_updatePalette() {
byte paletteRGBA[256 * 4];
if (palDirtyMax != -1) {
- for (i = palDirtyMin; i <= palDirtyMax; i++) {
+ for (int i = palDirtyMin; i <= palDirtyMax; i++) {
paletteRGBA[i * 4 + 0] = lpalette[i].R;
paletteRGBA[i * 4 + 1] = lpalette[i].G;
paletteRGBA[i * 4 + 2] = lpalette[i].B;
@@ -292,6 +290,18 @@ void flip() {
palDirtyMin = 256;
palDirtyMax = -1;
}
+}
+
+void gfxModuleData_updateScreen() {
+ g_system->updateScreen();
+ g_system->delayMillis(20);
+}
+
+void flip() {
+ RectList::iterator dr;
+
+ // Update the palette
+ gfxModuleData_updatePalette();
// Make a copy of the prior frame's dirty rects, and then backup the current frame's rects
RectList tempList = _priorFrameRects;
diff --git a/engines/cruise/gfxModule.h b/engines/cruise/gfxModule.h
index 1048fa8296..724b327f35 100644
--- a/engines/cruise/gfxModule.h
+++ b/engines/cruise/gfxModule.h
@@ -52,6 +52,9 @@ void gfxModuleData_setPalColor(int idx, int r, int g, int b);
void gfxModuleData_field_90(void);
void gfxModuleData_gfxWaitVSync(void);
void gfxModuleData_flip(void);
+void gfxModuleData_updatePalette();
+void gfxModuleData_updateScreen();
+
void gfxCopyRect(const uint8 *sourceBuffer, int width, int height, byte *dest, int x, int y, int colour);
void gfxModuleData_gfxCopyScreen(const uint8 *sourcePtr, uint8 *destPtr);
void convertGfxFromMode4(const uint8 *sourcePtr, int width, int height, uint8 *destPtr);
diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp
index 5c4a089957..3f21a27831 100644
--- a/engines/cruise/mainDraw.cpp
+++ b/engines/cruise/mainDraw.cpp
@@ -107,7 +107,9 @@ void fadeIn() {
calcRGB(&palScreen[masterScreen][3*j], &workpal[3*j], offsetTable);
}
gfxModuleData_setPal256(workpal);
- gfxModuleData_flipScreen();
+
+ gfxModuleData_updatePalette();
+ gfxModuleData_updateScreen();
}
for (long int j = 0; j < 256; j++) {