aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/gfx.cpp
diff options
context:
space:
mode:
authorGregory Montoir2007-12-13 19:07:10 +0000
committerGregory Montoir2007-12-13 19:07:10 +0000
commite1b73e47f826ebf96db54567a4fade6e1f1c4484 (patch)
tree8c7bb861ccd0a0e45a189fb1ff02f2cae1b24b42 /engines/cine/gfx.cpp
parentee56120fcff9fdbc5a4e068f104c4d4658b43507 (diff)
downloadscummvm-rg350-e1b73e47f826ebf96db54567a4fade6e1f1c4484.tar.gz
scummvm-rg350-e1b73e47f826ebf96db54567a4fade6e1f1c4484.tar.bz2
scummvm-rg350-e1b73e47f826ebf96db54567a4fade6e1f1c4484.zip
use CLIP template for clipping, made an array static const and renamed MAX_OBJECTDATA to MAX_VAR
svn-id: r29853
Diffstat (limited to 'engines/cine/gfx.cpp')
-rw-r--r--engines/cine/gfx.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 4352f2eba4..40cbc1857d 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -133,19 +133,10 @@ void setMouseCursor(int cursor) {
}
}
-int8 clipColor(int8 color) {
- if (color < 0)
- color = 0;
- else if (color > 7)
- color = 7;
-
- return color;
-}
-
static uint16 transformColor(uint16 baseColor, int8 r, int8 g, int8 b) {
- int8 oriR = clipColor((baseColor & 0x7) + r);
- int8 oriG = clipColor(((baseColor & 0x70) >> 4) + g);
- int8 oriB = clipColor(((baseColor & 0x700) >> 8) + b);
+ int8 oriR = CLIP( (baseColor & 0x007) + r, 0, 7);
+ int8 oriG = CLIP(((baseColor & 0x070) >> 4) + g, 0, 7);
+ int8 oriB = CLIP(((baseColor & 0x700) >> 8) + b, 0, 7);
return oriR | (oriG << 4) | (oriB << 8);
}