aboutsummaryrefslogtreecommitdiff
path: root/engines/prince
diff options
context:
space:
mode:
authorEugene Sandulenko2015-11-27 22:17:09 +0100
committerEugene Sandulenko2015-11-27 22:34:26 +0100
commit1f1c9803a7debcc09dba0959ce5457eb592dbd49 (patch)
tree2c2ebf7e8dc59cfb5d016746bf49b4ad916560a1 /engines/prince
parent9389126534be78bc8dbd211bebefe5609af0cc63 (diff)
downloadscummvm-rg350-1f1c9803a7debcc09dba0959ce5457eb592dbd49.tar.gz
scummvm-rg350-1f1c9803a7debcc09dba0959ce5457eb592dbd49.tar.bz2
scummvm-rg350-1f1c9803a7debcc09dba0959ce5457eb592dbd49.zip
PRINCE: Fix color clipping logic
Diffstat (limited to 'engines/prince')
-rw-r--r--engines/prince/graphics.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp
index f556d81eab..3482d79f69 100644
--- a/engines/prince/graphics.cpp
+++ b/engines/prince/graphics.cpp
@@ -375,30 +375,30 @@ byte GraphicsMan::getBlendTableColor(byte pixelColor, byte backgroundPixelColor,
const byte *originalPalette = _vm->_roomBmp->getPalette();
int redFirstOrg = originalPalette[pixelColor * 3] * _vm->_mst_shadow / 256;
- CLIP(redFirstOrg, 0, 255);
+ redFirstOrg = CLIP(redFirstOrg, 0, 255);
if (_vm->_mst_shadow <= 256) {
int redFirstBack = originalPalette[backgroundPixelColor * 3] * (256 - _vm->_mst_shadow) / 256;
- CLIP(redFirstBack, 0, 255);
+ redFirstBack = CLIP(redFirstBack, 0, 255);
redFirstOrg += redFirstBack;
- CLIP(redFirstOrg, 0, 255);
+ redFirstOrg = CLIP(redFirstOrg, 0, 255);
}
int greenFirstOrg = originalPalette[pixelColor * 3 + 1] * _vm->_mst_shadow / 256;
- CLIP(greenFirstOrg, 0, 255);
+ greenFirstOrg = CLIP(greenFirstOrg, 0, 255);
if (_vm->_mst_shadow <= 256) {
int greenFirstBack = originalPalette[backgroundPixelColor * 3 + 1] * (256 - _vm->_mst_shadow) / 256;
- CLIP(greenFirstBack, 0, 255);
+ greenFirstBack = CLIP(greenFirstBack, 0, 255);
greenFirstOrg += greenFirstBack;
- CLIP(greenFirstOrg, 0, 255);
+ greenFirstOrg = CLIP(greenFirstOrg, 0, 255);
}
int blueFirstOrg = originalPalette[pixelColor * 3 + 2] * _vm->_mst_shadow / 256;
- CLIP(blueFirstOrg, 0, 255);
+ blueFirstOrg = CLIP(blueFirstOrg, 0, 255);
if (_vm->_mst_shadow <= 256) {
int blueFirstBack = originalPalette[backgroundPixelColor * 3 + 2] * (256 - _vm->_mst_shadow) / 256;
- CLIP(blueFirstBack, 0, 255);
+ blueFirstBack = CLIP(blueFirstBack, 0, 255);
blueFirstOrg += blueFirstBack;
- CLIP(blueFirstOrg, 0, 255);
+ blueFirstOrg = CLIP(blueFirstOrg, 0, 255);
}
int bigValue = PrinceEngine::kIntMax; // infinity