From 1b3458e429035e1ca152bfddd7f7f174ae96cadd Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Thu, 17 May 2007 22:26:05 +0000 Subject: moved gfx related functions from various.cpp/.h to gfx.cpp/.h and fixed indentation of previous commit svn-id: r26863 --- engines/cine/gfx.cpp | 105 +++++++++++++++++++++++++++-------------------- engines/cine/gfx.h | 9 ++++ engines/cine/various.cpp | 19 --------- engines/cine/various.h | 11 ----- 4 files changed, 70 insertions(+), 74 deletions(-) diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index 4abd25c65d..eac8d6d39a 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -36,6 +36,7 @@ byte *screenBuffer; uint16 c_palette[256]; byte *page0; +byte *page0c; byte *page1; byte *page2; byte *page3; @@ -129,7 +130,7 @@ void setMouseCursor(int cursor) { } } -uint16 transformColor(uint16 baseColor, int8 r, int8 g, int8 b) { +static uint16 transformColor(uint16 baseColor, int8 r, int8 g, int8 b) { int8 oriR = (baseColor & 0x7); int8 oriG = (baseColor & 0x70) >> 4; int8 oriB = (baseColor & 0x700) >> 8; @@ -210,54 +211,54 @@ void gfxSpriteFunc1(byte *spritePtr, byte *maskPtr, uint16 width, uint16 height, // gfxUpdateSpriteMask void gfxSpriteFunc2(byte *spritePtr, byte *spriteMskPtr, int16 width, int16 height, byte *maskPtr, - int16 maskWidth, int16 maskHeight, byte *bufferSprPtr, byte *bufferMskPtr, int16 xs, int16 ys, int16 xm, int16 ym, byte maskIdx) { - int16 i, j, d, spritePitch, maskPitch; + int16 maskWidth, int16 maskHeight, byte *bufferSprPtr, byte *bufferMskPtr, int16 xs, int16 ys, int16 xm, int16 ym, byte maskIdx) { + int16 i, j, d, spritePitch, maskPitch; - width *= 8; - maskWidth *= 8; + width *= 8; + maskWidth *= 8; - spritePitch = width; - maskPitch = maskWidth; + spritePitch = width; + maskPitch = maskWidth; - if (maskIdx == 0) { - memcpy(bufferSprPtr, spritePtr, spritePitch * height); - memcpy(bufferMskPtr, spriteMskPtr, spritePitch * height); - } + if (maskIdx == 0) { + memcpy(bufferSprPtr, spritePtr, spritePitch * height); + memcpy(bufferMskPtr, spriteMskPtr, spritePitch * height); + } - if (ys > ym) { - d = ys - ym; - maskPtr += d * maskPitch; - maskHeight -= d; - } - if (maskHeight <= 0) { - return; - } - if (xs > xm) { - d = xs - xm; - maskPtr += d; - maskWidth -= d; - } - if (maskWidth <= 0) { - return; - } - if (ys < ym) { - d = ym - ys; - spriteMskPtr += d * spritePitch; - bufferMskPtr += d * spritePitch; - height -= d; - } - if (height <= 0) { - return; - } + if (ys > ym) { + d = ys - ym; + maskPtr += d * maskPitch; + maskHeight -= d; + } + if (maskHeight <= 0) { + return; + } + if (xs > xm) { + d = xs - xm; + maskPtr += d; + maskWidth -= d; + } + if (maskWidth <= 0) { + return; + } + if (ys < ym) { + d = ym - ys; + spriteMskPtr += d * spritePitch; + bufferMskPtr += d * spritePitch; + height -= d; + } + if (height <= 0) { + return; + } if (xs < xm) { - d = xm - xs; - spriteMskPtr += d; - bufferMskPtr += d; - width -= d; - } - if (width <= 0) { - return; - } + d = xm - xs; + spriteMskPtr += d; + bufferMskPtr += d; + width -= d; + } + if (width <= 0) { + return; + } for (j = 0; j < height; ++j) { for (i = 0; i < width; ++i) { bufferMskPtr[i] |= maskPtr[i] ^ 1; @@ -470,5 +471,21 @@ void fadeToBlack() { } } +void gfxFuncGen1(byte *param1, byte *param2, byte *param3, byte *param4, int16 param5) { +} + +void ptrGfxFunc13(void) { +} + +void gfxFuncGen2(void) { +} + +void blitRawScreen(byte *frontBuffer) { + gfxFlipRawPage(frontBuffer); +} + +void flip(void) { + blitRawScreen(page1Raw); +} } // End of namespace Cine diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h index a993568281..0673c342bc 100644 --- a/engines/cine/gfx.h +++ b/engines/cine/gfx.h @@ -30,6 +30,7 @@ namespace Cine { void gfxDrawSprite(byte *src4, uint16 sw, uint16 sh, byte *dst4, int16 sx, int16 sy); extern byte *page0; +extern byte *page0c; extern byte *page1; extern byte *page2; extern byte *page3; @@ -72,6 +73,14 @@ void drawSpriteRaw2(byte *spritePtr, byte transColor, int16 width, int16 height, void fadeToBlack(void); +void gfxFuncGen1(byte *param1, byte *param2, byte *param3, byte *param4, int16 param5); +void ptrGfxFunc13(void); +void gfxFuncGen2(void); + +void blitScreen(byte *frontBuffer, byte *backbuffer); +void blitRawScreen(byte *frontBuffer); +void flip(void); + } // End of namespace Cine #endif diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index 5479625eb1..17dcc23f26 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -56,10 +56,6 @@ int16 buildObjectListCommand(void); void drawString(const char *string, byte param) { } -void blitRawScreen(byte *frontBuffer) { - gfxFlipRawPage(frontBuffer); -} - Common::File *partFileHandleP = NULL; void waitPlayerInput(void) { @@ -74,17 +70,6 @@ void setTextWindow(uint16 param1, uint16 param2, uint16 param3, uint16 param4) { uint16 errorVar; byte menuVar; -void gfxFuncGen1(byte *param1, byte *param2, byte *param3, byte *param4, int16 param5) { -} - -byte *page0c; - -void ptrGfxFunc13(void) { -} - -void gfxFuncGen2(void) { -} - uint16 allowPlayerInput; uint16 checkForPendingDataLoadSwitch; @@ -2650,10 +2635,6 @@ void drawOverlays(void) { } } -void flip(void) { - blitRawScreen(page1Raw); -} - uint16 processKeyboard(uint16 param) { return 0; } diff --git a/engines/cine/various.h b/engines/cine/various.h index c50941d8e5..bb95657f1c 100644 --- a/engines/cine/various.h +++ b/engines/cine/various.h @@ -93,14 +93,6 @@ void setTextWindow(uint16 param1, uint16 param2, uint16 param3, uint16 param4); extern uint16 errorVar; extern byte menuVar; -void gfxFuncGen1(byte *param1, byte *param2, byte *param3, byte *param4, int16 param5); - -extern byte *page0; -extern byte *page0c; - -void ptrGfxFunc13(void); -void gfxFuncGen2(void); - extern uint16 allowPlayerInput; extern uint16 checkForPendingDataLoadSwitch; @@ -137,7 +129,6 @@ void mainLoopSub3(void); uint16 executePlayerInput(void); void drawOverlays(void); -void flip(void); extern uint16 mouseUpdateStatus; extern uint16 dummyU16; @@ -170,8 +161,6 @@ extern uint16 zoneData[NUM_MAX_ZONE]; void addMessage(byte param1, int16 param2, int16 param3, int16 param4, int16 param5); -void blitScreen(byte *frontBuffer, byte *backbuffer); - extern int16 additionalBgVScroll; void addSeqListElement(int16 param0, int16 param1, int16 param2, int16 param3, int16 param4, int16 param5, int16 param6, int16 param7, int16 param8); -- cgit v1.2.3