aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2003-05-25 22:01:19 +0000
committerMax Horn2003-05-25 22:01:19 +0000
commit35f8c2202f6118b092fc8cde3251a6ff6b74aca2 (patch)
tree79e4100b28c77d0439a8dfc6ef044c26e20faf70 /common
parent867e42c6fa58c55da6e16f04db4741f2e821123e (diff)
downloadscummvm-rg350-35f8c2202f6118b092fc8cde3251a6ff6b74aca2.tar.gz
scummvm-rg350-35f8c2202f6118b092fc8cde3251a6ff6b74aca2.tar.bz2
scummvm-rg350-35f8c2202f6118b092fc8cde3251a6ff6b74aca2.zip
cleanup / added some more const qualifiers
svn-id: r7975
Diffstat (limited to 'common')
-rw-r--r--common/scaler.cpp594
1 files changed, 287 insertions, 307 deletions
diff --git a/common/scaler.cpp b/common/scaler.cpp
index ef9cc68cce..a00c85dce9 100644
--- a/common/scaler.cpp
+++ b/common/scaler.cpp
@@ -106,395 +106,375 @@ static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D) {
return x + y;
}
-#define BLUE_MASK565 0x001F001F
-#define RED_MASK565 0xF800F800
-#define GREEN_MASK565 0x07E007E0
-
-#define BLUE_MASK555 0x001F001F
-#define RED_MASK555 0x7C007C00
-#define GREEN_MASK555 0x03E003E0
-
void Super2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
const uint16 *bP;
uint8 *dP;
- uint32 inc_bP;
-
- {
- uint32 Nextline = srcPitch >> 1;
- inc_bP = 1;
+ const uint32 inc_bP = 1;
+ const uint32 Nextline = srcPitch >> 1;
- while (height--) {
- bP = (const uint16 *)srcPtr;
- dP = (uint8 *)dstPtr;
+ while (height--) {
+ bP = (const uint16 *)srcPtr;
+ dP = (uint8 *)dstPtr;
- for (uint32 finish = width; finish; finish -= inc_bP) {
- uint32 color4, color5, color6;
- uint32 color1, color2, color3;
- uint32 colorA0, colorA1, colorA2, colorA3, colorB0, colorB1, colorB2, colorB3, colorS1, colorS2;
- uint32 product1a, product1b, product2a, product2b;
+ for (uint32 finish = width; finish; finish -= inc_bP) {
+ uint32 color4, color5, color6;
+ uint32 color1, color2, color3;
+ uint32 colorA0, colorA1, colorA2, colorA3;
+ uint32 colorB0, colorB1, colorB2, colorB3;
+ uint32 colorS1, colorS2;
+ uint32 product1a, product1b, product2a, product2b;
//--------------------------------------- B1 B2
// 4 5 6 S2
// 1 2 3 S1
// A1 A2
- colorB0 = *(bP - Nextline - 1);
- colorB1 = *(bP - Nextline);
- colorB2 = *(bP - Nextline + 1);
- colorB3 = *(bP - Nextline + 2);
+ colorB0 = *(bP - Nextline - 1);
+ colorB1 = *(bP - Nextline);
+ colorB2 = *(bP - Nextline + 1);
+ colorB3 = *(bP - Nextline + 2);
- color4 = *(bP - 1);
- color5 = *(bP);
- color6 = *(bP + 1);
- colorS2 = *(bP + 2);
+ color4 = *(bP - 1);
+ color5 = *(bP);
+ color6 = *(bP + 1);
+ colorS2 = *(bP + 2);
- color1 = *(bP + Nextline - 1);
- color2 = *(bP + Nextline);
- color3 = *(bP + Nextline + 1);
- colorS1 = *(bP + Nextline + 2);
+ color1 = *(bP + Nextline - 1);
+ color2 = *(bP + Nextline);
+ color3 = *(bP + Nextline + 1);
+ colorS1 = *(bP + Nextline + 2);
- colorA0 = *(bP + Nextline + Nextline - 1);
- colorA1 = *(bP + Nextline + Nextline);
- colorA2 = *(bP + Nextline + Nextline + 1);
- colorA3 = *(bP + Nextline + Nextline + 2);
+ colorA0 = *(bP + Nextline + Nextline - 1);
+ colorA1 = *(bP + Nextline + Nextline);
+ colorA2 = *(bP + Nextline + Nextline + 1);
+ colorA3 = *(bP + Nextline + Nextline + 2);
//--------------------------------------
- if (color2 == color6 && color5 != color3) {
- product2b = product1b = color2;
- } else if (color5 == color3 && color2 != color6) {
+ if (color2 == color6 && color5 != color3) {
+ product2b = product1b = color2;
+ } else if (color5 == color3 && color2 != color6) {
+ product2b = product1b = color5;
+ } else if (color5 == color3 && color2 == color6) {
+ register int r = 0;
+
+ r += GetResult(color6, color5, color1, colorA1);
+ r += GetResult(color6, color5, color4, colorB1);
+ r += GetResult(color6, color5, colorA2, colorS1);
+ r += GetResult(color6, color5, colorB2, colorS2);
+
+ if (r > 0)
+ product2b = product1b = color6;
+ else if (r < 0)
product2b = product1b = color5;
- } else if (color5 == color3 && color2 == color6) {
- register int r = 0;
-
- r += GetResult(color6, color5, color1, colorA1);
- r += GetResult(color6, color5, color4, colorB1);
- r += GetResult(color6, color5, colorA2, colorS1);
- r += GetResult(color6, color5, colorB2, colorS2);
-
- if (r > 0)
- product2b = product1b = color6;
- else if (r < 0)
- product2b = product1b = color5;
- else {
- product2b = product1b = INTERPOLATE(color5, color6);
- }
- } else {
- if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0)
- product2b = Q_INTERPOLATE(color3, color3, color3, color2);
- else if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3)
- product2b = Q_INTERPOLATE(color2, color2, color2, color3);
- else
- product2b = INTERPOLATE(color2, color3);
-
- if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0)
- product1b = Q_INTERPOLATE(color6, color6, color6, color5);
- else if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3)
- product1b = Q_INTERPOLATE(color6, color5, color5, color5);
- else
- product1b = INTERPOLATE(color5, color6);
+ else {
+ product2b = product1b = INTERPOLATE(color5, color6);
}
-
- if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2)
- product2a = INTERPOLATE(color2, color5);
- else if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0)
- product2a = INTERPOLATE(color2, color5);
+ } else {
+ if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0)
+ product2b = Q_INTERPOLATE(color3, color3, color3, color2);
+ else if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3)
+ product2b = Q_INTERPOLATE(color2, color2, color2, color3);
else
- product2a = color2;
+ product2b = INTERPOLATE(color2, color3);
- if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2)
- product1a = INTERPOLATE(color2, color5);
- else if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0)
- product1a = INTERPOLATE(color2, color5);
+ if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0)
+ product1b = Q_INTERPOLATE(color6, color6, color6, color5);
+ else if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3)
+ product1b = Q_INTERPOLATE(color6, color5, color5, color5);
else
- product1a = color5;
+ product1b = INTERPOLATE(color5, color6);
+ }
+
+ if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2)
+ product2a = INTERPOLATE(color2, color5);
+ else if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0)
+ product2a = INTERPOLATE(color2, color5);
+ else
+ product2a = color2;
+
+ if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2)
+ product1a = INTERPOLATE(color2, color5);
+ else if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0)
+ product1a = INTERPOLATE(color2, color5);
+ else
+ product1a = color5;
#ifdef SCUMM_LITTLE_ENDIAN
- product1a = product1a | (product1b << 16);
- product2a = product2a | (product2b << 16);
+ product1a = product1a | (product1b << 16);
+ product2a = product2a | (product2b << 16);
#endif
#ifdef SCUMM_BIG_ENDIAN
- product1a = product1b | (product1a << 16);
- product2a = product2b | (product2a << 16);
+ product1a = product1b | (product1a << 16);
+ product2a = product2b | (product2a << 16);
#endif
- *((uint32 *)dP) = product1a;
- *((uint32 *)(dP + dstPitch)) = product2a;
+ *((uint32 *)dP) = product1a;
+ *((uint32 *)(dP + dstPitch)) = product2a;
- bP += inc_bP;
- dP += sizeof(uint32);
- } // end of for ( finish= width etc..)
+ bP += inc_bP;
+ dP += sizeof(uint32);
+ } // end of for ( finish= width etc..)
- srcPtr += srcPitch;
- dstPtr += dstPitch * 2;
- } // while (height--)
- }
+ srcPtr += srcPitch;
+ dstPtr += dstPitch * 2;
+ } // while (height--)
}
void SuperEagle(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint8 *dP;
const uint16 *bP;
- uint32 inc_bP;
+ const uint32 inc_bP = 1;
+ const uint32 Nextline = srcPitch >> 1;
- {
- inc_bP = 1;
-
- uint32 Nextline = srcPitch >> 1;
+ while (height--) {
+ bP = (const uint16 *)srcPtr;
+ dP = dstPtr;
+ for (uint32 finish = width; finish; finish -= inc_bP) {
+ uint32 color4, color5, color6;
+ uint32 color1, color2, color3;
+ uint32 colorA1, colorA2, colorB1, colorB2, colorS1, colorS2;
+ uint32 product1a, product1b, product2a, product2b;
+
+ colorB1 = *(bP - Nextline);
+ colorB2 = *(bP - Nextline + 1);
+
+ color4 = *(bP - 1);
+ color5 = *(bP);
+ color6 = *(bP + 1);
+ colorS2 = *(bP + 2);
+
+ color1 = *(bP + Nextline - 1);
+ color2 = *(bP + Nextline);
+ color3 = *(bP + Nextline + 1);
+ colorS1 = *(bP + Nextline + 2);
+
+ colorA1 = *(bP + Nextline + Nextline);
+ colorA2 = *(bP + Nextline + Nextline + 1);
+
+ // --------------------------------------
+ if (color2 == color6 && color5 != color3) {
+ product1b = product2a = color2;
+ if ((color1 == color2) || (color6 == colorB2)) {
+ product1a = INTERPOLATE(color2, color5);
+ product1a = INTERPOLATE(color2, product1a);
+ } else {
+ product1a = INTERPOLATE(color5, color6);
+ }
- while (height--) {
- bP = (const uint16 *)srcPtr;
- dP = dstPtr;
- for (uint32 finish = width; finish; finish -= inc_bP) {
- uint32 color4, color5, color6;
- uint32 color1, color2, color3;
- uint32 colorA1, colorA2, colorB1, colorB2, colorS1, colorS2;
- uint32 product1a, product1b, product2a, product2b;
+ if ((color6 == colorS2) || (color2 == colorA1)) {
+ product2b = INTERPOLATE(color2, color3);
+ product2b = INTERPOLATE(color2, product2b);
+ } else {
+ product2b = INTERPOLATE(color2, color3);
+ }
+ } else if (color5 == color3 && color2 != color6) {
+ product2b = product1a = color5;
- colorB1 = *(bP - Nextline);
- colorB2 = *(bP - Nextline + 1);
+ if ((colorB1 == color5) || (color3 == colorS1)) {
+ product1b = INTERPOLATE(color5, color6);
+ product1b = INTERPOLATE(color5, product1b);
+ } else {
+ product1b = INTERPOLATE(color5, color6);
+ }
- color4 = *(bP - 1);
- color5 = *(bP);
- color6 = *(bP + 1);
- colorS2 = *(bP + 2);
+ if ((color3 == colorA2) || (color4 == color5)) {
+ product2a = INTERPOLATE(color5, color2);
+ product2a = INTERPOLATE(color5, product2a);
+ } else {
+ product2a = INTERPOLATE(color2, color3);
+ }
- color1 = *(bP + Nextline - 1);
- color2 = *(bP + Nextline);
- color3 = *(bP + Nextline + 1);
- colorS1 = *(bP + Nextline + 2);
+ } else if (color5 == color3 && color2 == color6) {
+ register int r = 0;
- colorA1 = *(bP + Nextline + Nextline);
- colorA2 = *(bP + Nextline + Nextline + 1);
+ r += GetResult(color6, color5, color1, colorA1);
+ r += GetResult(color6, color5, color4, colorB1);
+ r += GetResult(color6, color5, colorA2, colorS1);
+ r += GetResult(color6, color5, colorB2, colorS2);
- // --------------------------------------
- if (color2 == color6 && color5 != color3) {
+ if (r > 0) {
product1b = product2a = color2;
- if ((color1 == color2) || (color6 == colorB2)) {
- product1a = INTERPOLATE(color2, color5);
- product1a = INTERPOLATE(color2, product1a);
- } else {
- product1a = INTERPOLATE(color5, color6);
- }
-
- if ((color6 == colorS2) || (color2 == colorA1)) {
- product2b = INTERPOLATE(color2, color3);
- product2b = INTERPOLATE(color2, product2b);
- } else {
- product2b = INTERPOLATE(color2, color3);
- }
- } else if (color5 == color3 && color2 != color6) {
+ product1a = product2b = INTERPOLATE(color5, color6);
+ } else if (r < 0) {
product2b = product1a = color5;
-
- if ((colorB1 == color5) || (color3 == colorS1)) {
- product1b = INTERPOLATE(color5, color6);
- product1b = INTERPOLATE(color5, product1b);
- } else {
- product1b = INTERPOLATE(color5, color6);
- }
-
- if ((color3 == colorA2) || (color4 == color5)) {
- product2a = INTERPOLATE(color5, color2);
- product2a = INTERPOLATE(color5, product2a);
- } else {
- product2a = INTERPOLATE(color2, color3);
- }
-
- } else if (color5 == color3 && color2 == color6) {
- register int r = 0;
-
- r += GetResult(color6, color5, color1, colorA1);
- r += GetResult(color6, color5, color4, colorB1);
- r += GetResult(color6, color5, colorA2, colorS1);
- r += GetResult(color6, color5, colorB2, colorS2);
-
- if (r > 0) {
- product1b = product2a = color2;
- product1a = product2b = INTERPOLATE(color5, color6);
- } else if (r < 0) {
- product2b = product1a = color5;
- product1b = product2a = INTERPOLATE(color5, color6);
- } else {
- product2b = product1a = color5;
- product1b = product2a = color2;
- }
+ product1b = product2a = INTERPOLATE(color5, color6);
} else {
- product2b = product1a = INTERPOLATE(color2, color6);
- product2b = Q_INTERPOLATE(color3, color3, color3, product2b);
- product1a = Q_INTERPOLATE(color5, color5, color5, product1a);
-
- product2a = product1b = INTERPOLATE(color5, color3);
- product2a = Q_INTERPOLATE(color2, color2, color2, product2a);
- product1b = Q_INTERPOLATE(color6, color6, color6, product1b);
+ product2b = product1a = color5;
+ product1b = product2a = color2;
}
+ } else {
+ product2b = product1a = INTERPOLATE(color2, color6);
+ product2b = Q_INTERPOLATE(color3, color3, color3, product2b);
+ product1a = Q_INTERPOLATE(color5, color5, color5, product1a);
+
+ product2a = product1b = INTERPOLATE(color5, color3);
+ product2a = Q_INTERPOLATE(color2, color2, color2, product2a);
+ product1b = Q_INTERPOLATE(color6, color6, color6, product1b);
+ }
#ifdef SCUMM_LITTLE_ENDIAN
- product1a = product1a | (product1b << 16);
- product2a = product2a | (product2b << 16);
+ product1a = product1a | (product1b << 16);
+ product2a = product2a | (product2b << 16);
#endif
#ifdef SCUMM_BIG_ENDIAN
- product1a = product1b | (product1a << 16);
- product2a = product2b | (product2a << 16);
+ product1a = product1b | (product1a << 16);
+ product2a = product2b | (product2a << 16);
#endif
- *((uint32 *)dP) = product1a;
- *((uint32 *)(dP + dstPitch)) = product2a;
+ *((uint32 *)dP) = product1a;
+ *((uint32 *)(dP + dstPitch)) = product2a;
- bP += inc_bP;
- dP += sizeof(uint32);
- } // end of for ( finish= width etc..)
+ bP += inc_bP;
+ dP += sizeof(uint32);
+ } // end of for ( finish= width etc..)
- srcPtr += srcPitch;
- dstPtr += dstPitch * 2;
- } // endof: while (height--)
- }
+ srcPtr += srcPitch;
+ dstPtr += dstPitch * 2;
+ } // endof: while (height--)
}
void _2xSaI(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint8 *dP;
const uint16 *bP;
- uint32 inc_bP;
-
- {
- inc_bP = 1;
+ const uint32 inc_bP = 1;
+ const uint32 Nextline = srcPitch >> 1;
- uint32 Nextline = srcPitch >> 1;
-
- while (height--) {
- bP = (const uint16 *)srcPtr;
- dP = dstPtr;
+ while (height--) {
+ bP = (const uint16 *)srcPtr;
+ dP = dstPtr;
- for (uint32 finish = width; finish; finish -= inc_bP) {
+ for (uint32 finish = width; finish; finish -= inc_bP) {
- register uint32 colorA, colorB;
- uint32 colorC, colorD,
- colorE, colorF, colorG, colorH, colorI, colorJ, colorK, colorL, colorM, colorN, colorO, colorP;
- uint32 product, product1, product2;
+ register uint32 colorA, colorB;
+ uint32 colorC, colorD,
+ colorE, colorF, colorG, colorH, colorI, colorJ, colorK, colorL, colorM, colorN, colorO, colorP;
+ uint32 product, product1, product2;
//---------------------------------------
// Map of the pixels: I|E F|J
// G|A B|K
// H|C D|L
// M|N O|P
- colorI = *(bP - Nextline - 1);
- colorE = *(bP - Nextline);
- colorF = *(bP - Nextline + 1);
- colorJ = *(bP - Nextline + 2);
-
- colorG = *(bP - 1);
- colorA = *(bP);
- colorB = *(bP + 1);
- colorK = *(bP + 2);
-
- colorH = *(bP + Nextline - 1);
- colorC = *(bP + Nextline);
- colorD = *(bP + Nextline + 1);
- colorL = *(bP + Nextline + 2);
-
- colorM = *(bP + Nextline + Nextline - 1);
- colorN = *(bP + Nextline + Nextline);
- colorO = *(bP + Nextline + Nextline + 1);
- colorP = *(bP + Nextline + Nextline + 2);
-
- if ((colorA == colorD) && (colorB != colorC)) {
- if (((colorA == colorE) && (colorB == colorL)) || ((colorA == colorC) && (colorA == colorF)
- && (colorB != colorE)
- && (colorB == colorJ))) {
- product = colorA;
- } else {
- product = INTERPOLATE(colorA, colorB);
- }
+ colorI = *(bP - Nextline - 1);
+ colorE = *(bP - Nextline);
+ colorF = *(bP - Nextline + 1);
+ colorJ = *(bP - Nextline + 2);
+
+ colorG = *(bP - 1);
+ colorA = *(bP);
+ colorB = *(bP + 1);
+ colorK = *(bP + 2);
+
+ colorH = *(bP + Nextline - 1);
+ colorC = *(bP + Nextline);
+ colorD = *(bP + Nextline + 1);
+ colorL = *(bP + Nextline + 2);
+
+ colorM = *(bP + Nextline + Nextline - 1);
+ colorN = *(bP + Nextline + Nextline);
+ colorO = *(bP + Nextline + Nextline + 1);
+ colorP = *(bP + Nextline + Nextline + 2);
+
+ if ((colorA == colorD) && (colorB != colorC)) {
+ if (((colorA == colorE) && (colorB == colorL)) || ((colorA == colorC) && (colorA == colorF)
+ && (colorB != colorE)
+ && (colorB == colorJ))) {
+ product = colorA;
+ } else {
+ product = INTERPOLATE(colorA, colorB);
+ }
- if (((colorA == colorG) && (colorC == colorO)) || ((colorA == colorB) && (colorA == colorH)
- && (colorG != colorC)
- && (colorC == colorM))) {
- product1 = colorA;
- } else {
- product1 = INTERPOLATE(colorA, colorC);
- }
+ if (((colorA == colorG) && (colorC == colorO)) || ((colorA == colorB) && (colorA == colorH)
+ && (colorG != colorC)
+ && (colorC == colorM))) {
+ product1 = colorA;
+ } else {
+ product1 = INTERPOLATE(colorA, colorC);
+ }
+ product2 = colorA;
+ } else if ((colorB == colorC) && (colorA != colorD)) {
+ if (((colorB == colorF) && (colorA == colorH)) || ((colorB == colorE) && (colorB == colorD)
+ && (colorA != colorF)
+ && (colorA == colorI))) {
+ product = colorB;
+ } else {
+ product = INTERPOLATE(colorA, colorB);
+ }
+
+ if (((colorC == colorH) && (colorA == colorF)) || ((colorC == colorG) && (colorC == colorD)
+ && (colorA != colorH)
+ && (colorA == colorI))) {
+ product1 = colorC;
+ } else {
+ product1 = INTERPOLATE(colorA, colorC);
+ }
+ product2 = colorB;
+ } else if ((colorA == colorD) && (colorB == colorC)) {
+ if (colorA == colorB) {
+ product = colorA;
+ product1 = colorA;
product2 = colorA;
- } else if ((colorB == colorC) && (colorA != colorD)) {
- if (((colorB == colorF) && (colorA == colorH)) || ((colorB == colorE) && (colorB == colorD)
- && (colorA != colorF)
- && (colorA == colorI))) {
- product = colorB;
- } else {
- product = INTERPOLATE(colorA, colorB);
- }
+ } else {
+ register int r = 0;
- if (((colorC == colorH) && (colorA == colorF)) || ((colorC == colorG) && (colorC == colorD)
- && (colorA != colorH)
- && (colorA == colorI))) {
- product1 = colorC;
- } else {
- product1 = INTERPOLATE(colorA, colorC);
- }
- product2 = colorB;
- } else if ((colorA == colorD) && (colorB == colorC)) {
- if (colorA == colorB) {
- product = colorA;
- product1 = colorA;
+ product1 = INTERPOLATE(colorA, colorC);
+ product = INTERPOLATE(colorA, colorB);
+
+ r += GetResult(colorA, colorB, colorG, colorE);
+ r -= GetResult(colorB, colorA, colorK, colorF);
+ r -= GetResult(colorB, colorA, colorH, colorN);
+ r += GetResult(colorA, colorB, colorL, colorO);
+
+ if (r > 0)
product2 = colorA;
- } else {
- register int r = 0;
-
- product1 = INTERPOLATE(colorA, colorC);
- product = INTERPOLATE(colorA, colorB);
-
- r += GetResult(colorA, colorB, colorG, colorE);
- r -= GetResult(colorB, colorA, colorK, colorF);
- r -= GetResult(colorB, colorA, colorH, colorN);
- r += GetResult(colorA, colorB, colorL, colorO);
-
- if (r > 0)
- product2 = colorA;
- else if (r < 0)
- product2 = colorB;
- else {
- product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD);
- }
+ else if (r < 0)
+ product2 = colorB;
+ else {
+ product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD);
}
+ }
+ } else {
+ product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD);
+
+ if ((colorA == colorC) && (colorA == colorF)
+ && (colorB != colorE) && (colorB == colorJ)) {
+ product = colorA;
+ } else if ((colorB == colorE) && (colorB == colorD)
+ && (colorA != colorF) && (colorA == colorI)) {
+ product = colorB;
} else {
- product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD);
-
- if ((colorA == colorC) && (colorA == colorF)
- && (colorB != colorE) && (colorB == colorJ)) {
- product = colorA;
- } else if ((colorB == colorE) && (colorB == colorD)
- && (colorA != colorF) && (colorA == colorI)) {
- product = colorB;
- } else {
- product = INTERPOLATE(colorA, colorB);
- }
+ product = INTERPOLATE(colorA, colorB);
+ }
- if ((colorA == colorB) && (colorA == colorH)
- && (colorG != colorC) && (colorC == colorM)) {
- product1 = colorA;
- } else if ((colorC == colorG) && (colorC == colorD)
- && (colorA != colorH) && (colorA == colorI)) {
- product1 = colorC;
- } else {
- product1 = INTERPOLATE(colorA, colorC);
- }
+ if ((colorA == colorB) && (colorA == colorH)
+ && (colorG != colorC) && (colorC == colorM)) {
+ product1 = colorA;
+ } else if ((colorC == colorG) && (colorC == colorD)
+ && (colorA != colorH) && (colorA == colorI)) {
+ product1 = colorC;
+ } else {
+ product1 = INTERPOLATE(colorA, colorC);
}
+ }
#ifdef SCUMM_LITTLE_ENDIAN
- product = colorA | (product << 16);
- product1 = product1 | (product2 << 16);
+ product = colorA | (product << 16);
+ product1 = product1 | (product2 << 16);
#endif
#ifdef SCUMM_BIG_ENDIAN
- product = (colorA << 16) | product;
- product1 = (product1 << 16) | product2;
+ product = (colorA << 16) | product;
+ product1 = (product1 << 16) | product2;
#endif
- *((int32 *)dP) = product;
- *((uint32 *)(dP + dstPitch)) = product1;
+ *((int32 *)dP) = product;
+ *((uint32 *)(dP + dstPitch)) = product1;
- bP += inc_bP;
- dP += sizeof(uint32);
- } // end of for ( finish= width etc..)
+ bP += inc_bP;
+ dP += sizeof(uint32);
+ } // end of for ( finish= width etc..)
- srcPtr += srcPitch;
- dstPtr += dstPitch * 2;
- } // endof: while (height--)
- }
+ srcPtr += srcPitch;
+ dstPtr += dstPitch * 2;
+ } // endof: while (height--)
}
void AdvMame2x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,