From 49a4df3c8c3e51d88c03b8f6745c787fb0f6a47e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 15 Aug 2009 11:50:59 +0000 Subject: Added Dirty Rect handling functionality svn-id: r43406 --- engines/cruise/mainDraw.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/cruise/mainDraw.cpp') diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index 047f00ee90..61e8f8d85c 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -1121,6 +1121,8 @@ void mainDrawPolygons(int fileIndex, cellStruct *plWork, int X, int scale, int Y if (spriteY1 == spriteY2) return; + gfxModuleData_addDirtyRect(Common::Rect(spriteX2, spriteY2, spriteX1, spriteY1)); + var_8 = 0; memset(polygonMask, 0xFF, (320*200) / 8); @@ -1177,6 +1179,8 @@ void drawMessage(const gfxEntryStruct *pGfxPtr, int globalX, int globalY, int wi globalY = 198 - pGfxPtr->height; } + gfxModuleData_addDirtyRect(Common::Rect(globalX, globalY, globalX + width, globalY + height)); + initialOuput = ouputPtr + (globalY * 320) + globalX; for (yp = 0; yp < height; yp++) { @@ -1206,6 +1210,9 @@ void drawSprite(int width, int height, cellStruct *currentObjPtr, const uint8 *d int x = 0; int y = 0; + // Flag the given area as having been changed + gfxModuleData_addDirtyRect(Common::Rect(xs, ys, xs + width - 1, ys + height - 1)); + cellStruct* plWork = currentObjPtr; int workBufferSize = height * (width / 8); @@ -1406,6 +1413,10 @@ void mainDraw(int16 param) { if (bgPtr) { gfxModuleData_gfxCopyScreen(bgPtr, gfxModuleData.pPage10); + if (backgroundChanged[masterScreen]) { + backgroundChanged[masterScreen] = false; + gfxModuleData_addDirtyRect(Common::Rect(0, 0, 320, 200)); + } } autoCellHead.next = NULL; -- cgit v1.2.3