From e1b73e47f826ebf96db54567a4fade6e1f1c4484 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Thu, 13 Dec 2007 19:07:10 +0000 Subject: use CLIP template for clipping, made an array static const and renamed MAX_OBJECTDATA to MAX_VAR svn-id: r29853 --- engines/cine/gfx.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'engines/cine/gfx.cpp') 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); } -- cgit v1.2.3