diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tinsel/actors.cpp | 4 | ||||
-rw-r--r-- | engines/tinsel/bmv.cpp | 4 | ||||
-rw-r--r-- | engines/tinsel/faders.cpp | 8 | ||||
-rw-r--r-- | engines/tinsel/palette.cpp | 20 | ||||
-rw-r--r-- | engines/tinsel/palette.h | 24 | ||||
-rw-r--r-- | engines/tinsel/tinlib.cpp | 2 |
6 files changed, 31 insertions, 31 deletions
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index 2eda96db95..4d4587bf8b 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -1283,9 +1283,9 @@ void storeActorAttr(int ano, int r1, int g1, int b1) { if (b1 > MAX_INTENSITY) b1 = MAX_INTENSITY; // } if (ano == -1) - defaultColour = RGB(r1, g1, b1); + defaultColour = TINSEL_RGB(r1, g1, b1); else - actorInfo[ano - 1].textColour = RGB(r1, g1, b1); + actorInfo[ano - 1].textColour = TINSEL_RGB(r1, g1, b1); } /** diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index 59f524f710..2607ed068b 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -439,7 +439,7 @@ static void MoviePalette(int paletteOffset) { r = bigBuffer + paletteOffset; for (i = 0; i < 256; i++, r += 3) { - moviePal[i] = RGB(*r, *(r + 1), *(r + 2)); + moviePal[i] = TINSEL_RGB(*r, *(r + 1), *(r + 2)); } UpdateDACqueue(1, 255, &moviePal[1]); @@ -610,7 +610,7 @@ static int MovieCommand(char cmd, int commandOffset) { PTALK_CMD pCmd; pCmd = (PTALK_CMD)(bigBuffer + commandOffset); - talkColour = RGB(pCmd->r, pCmd->g, pCmd->b); + talkColour = TINSEL_RGB(pCmd->r, pCmd->g, pCmd->b); MovieText(nullContext, (int16)READ_LE_UINT16(&pCmd->stringId), (int16)READ_LE_UINT16(&pCmd->x), diff --git a/engines/tinsel/faders.cpp b/engines/tinsel/faders.cpp index 3039e57bb2..271bc52da9 100644 --- a/engines/tinsel/faders.cpp +++ b/engines/tinsel/faders.cpp @@ -52,12 +52,12 @@ struct FADE { */ static COLORREF ScaleColour(COLORREF colour, uint32 colourMult) { // apply multiplier to RGB components - uint32 red = ((GetRValue(colour) * colourMult) << 8) >> 24; - uint32 green = ((GetGValue(colour) * colourMult) << 8) >> 24; - uint32 blue = ((GetBValue(colour) * colourMult) << 8) >> 24; + uint32 red = ((TINSEL_GetRValue(colour) * colourMult) << 8) >> 24; + uint32 green = ((TINSEL_GetGValue(colour) * colourMult) << 8) >> 24; + uint32 blue = ((TINSEL_GetBValue(colour) * colourMult) << 8) >> 24; // return new colour - return RGB(red, green, blue); + return TINSEL_RGB(red, green, blue); } /** diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index ede39341f3..91f3f46a24 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -486,9 +486,9 @@ void CreateTranslucentPalette(SCNHANDLE hPalette) { for (uint i = 0; i < FROM_LE_32(pPal->numColours); i++) { // get the RGB colour model values - uint8 red = GetRValue(pPal->palRGB[i]); - uint8 green = GetGValue(pPal->palRGB[i]); - uint8 blue = GetBValue(pPal->palRGB[i]); + uint8 red = TINSEL_GetRValue(pPal->palRGB[i]); + uint8 green = TINSEL_GetGValue(pPal->palRGB[i]); + uint8 blue = TINSEL_GetBValue(pPal->palRGB[i]); // calculate the Value field of the HSV colour model unsigned val = (red > green) ? red : green; @@ -514,9 +514,9 @@ void CreateGhostPalette(SCNHANDLE hPalette) { for (i = 0; i < (int)FROM_LE_32(pPal->numColours); i++) { // get the RGB colour model values - uint8 red = GetRValue(pPal->palRGB[i]); - uint8 green = GetGValue(pPal->palRGB[i]); - uint8 blue = GetBValue(pPal->palRGB[i]); + uint8 red = TINSEL_GetRValue(pPal->palRGB[i]); + uint8 green = TINSEL_GetGValue(pPal->palRGB[i]); + uint8 blue = TINSEL_GetBValue(pPal->palRGB[i]); // calculate the Value field of the HSV colour model unsigned val = (red > green) ? red : green; @@ -545,12 +545,12 @@ static COLORREF DimColour(COLORREF colour, int factor) { return 0; } else { // apply multiplier to RGB components - red = GetRValue(colour) * factor / 10; - green = GetGValue(colour) * factor / 10; - blue = GetBValue(colour) * factor / 10; + red = TINSEL_GetRValue(colour) * factor / 10; + green = TINSEL_GetGValue(colour) * factor / 10; + blue = TINSEL_GetBValue(colour) * factor / 10; // return new colour - return RGB(red, green, blue); + return TINSEL_RGB(red, green, blue); } } diff --git a/engines/tinsel/palette.h b/engines/tinsel/palette.h index 1d43e6d31f..90edfbb19a 100644 --- a/engines/tinsel/palette.h +++ b/engines/tinsel/palette.h @@ -33,11 +33,11 @@ namespace Tinsel { typedef uint32 COLORREF; -#define RGB(r,g,b) ((COLORREF)TO_LE_32(((uint8)(r)|((uint16)(g)<<8))|(((uint32)(uint8)(b))<<16))) +#define TINSEL_RGB(r,g,b) ((COLORREF)TO_LE_32(((uint8)(r)|((uint16)(g)<<8))|(((uint32)(uint8)(b))<<16))) -#define GetRValue(rgb) ((uint8)(FROM_LE_32(rgb))) -#define GetGValue(rgb) ((uint8)(((uint16)(FROM_LE_32(rgb))) >> 8)) -#define GetBValue(rgb) ((uint8)((FROM_LE_32(rgb))>>16)) +#define TINSEL_GetRValue(rgb) ((uint8)(FROM_LE_32(rgb))) +#define TINSEL_GetGValue(rgb) ((uint8)(((uint16)(FROM_LE_32(rgb))) >> 8)) +#define TINSEL_GetBValue(rgb) ((uint8)((FROM_LE_32(rgb))>>16)) enum { MAX_COLOURS = 256, //!< maximum number of colours - for VGA 256 @@ -57,14 +57,14 @@ enum { // some common colours -#define BLACK (RGB(0, 0, 0)) -#define WHITE (RGB(MAX_INTENSITY, MAX_INTENSITY, MAX_INTENSITY)) -#define RED (RGB(MAX_INTENSITY, 0, 0)) -#define GREEN (RGB(0, MAX_INTENSITY, 0)) -#define BLUE (RGB(0, 0, MAX_INTENSITY)) -#define YELLOW (RGB(MAX_INTENSITY, MAX_INTENSITY, 0)) -#define MAGENTA (RGB(MAX_INTENSITY, 0, MAX_INTENSITY)) -#define CYAN (RGB(0, MAX_INTENSITY, MAX_INTENSITY)) +#define BLACK (TINSEL_RGB(0, 0, 0)) +#define WHITE (TINSEL_RGB(MAX_INTENSITY, MAX_INTENSITY, MAX_INTENSITY)) +#define RED (TINSEL_RGB(MAX_INTENSITY, 0, 0)) +#define GREEN (TINSEL_RGB(0, MAX_INTENSITY, 0)) +#define BLUE (TINSEL_RGB(0, 0, MAX_INTENSITY)) +#define YELLOW (TINSEL_RGB(MAX_INTENSITY, MAX_INTENSITY, 0)) +#define MAGENTA (TINSEL_RGB(MAX_INTENSITY, 0, MAX_INTENSITY)) +#define CYAN (TINSEL_RGB(0, MAX_INTENSITY, MAX_INTENSITY)) #include "common/pack-start.h" // START STRUCT PACKING diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index 221dde1bb1..f7aefc5494 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -3528,7 +3528,7 @@ static void TalkAttr(int r1, int g1, int b1, bool escOn, int myEscape) { if (g1 > MAX_INTENSITY) g1 = MAX_INTENSITY; // } within limits if (b1 > MAX_INTENSITY) b1 = MAX_INTENSITY; // } - SetTextPal(RGB(r1, g1, b1)); + SetTextPal(TINSEL_RGB(r1, g1, b1)); } /** |