diff options
author | Paul Gilbert | 2009-10-02 13:13:47 +0000 |
---|---|---|
committer | Paul Gilbert | 2009-10-02 13:13:47 +0000 |
commit | 78578a042fd40f836c7e25acdf8a86cfc6b71f6b (patch) | |
tree | bd3d1a055ed19c99140e69ae28e0f163f080263e /engines/cruise | |
parent | 14c58b73e95d0beec58ae44a652453da766b1bbd (diff) | |
download | scummvm-rg350-78578a042fd40f836c7e25acdf8a86cfc6b71f6b.tar.gz scummvm-rg350-78578a042fd40f836c7e25acdf8a86cfc6b71f6b.tar.bz2 scummvm-rg350-78578a042fd40f836c7e25acdf8a86cfc6b71f6b.zip |
Bugfix for dirty rects getting lost during room fade-ins
svn-id: r44536
Diffstat (limited to 'engines/cruise')
-rw-r--r-- | engines/cruise/gfxModule.cpp | 18 | ||||
-rw-r--r-- | engines/cruise/gfxModule.h | 3 | ||||
-rw-r--r-- | engines/cruise/mainDraw.cpp | 4 |
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++) { |