From 3a64d35dfd9126d7912c4d4496030f7ed120d660 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Thu, 4 Jun 2009 01:05:47 +0000 Subject: Add 16bit color support for later HE games. svn-id: r41153 --- engines/scumm/he/script_v90he.cpp | 44 ++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'engines/scumm/he/script_v90he.cpp') diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index cdfef1a5e5..212ba69bdc 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -1253,7 +1253,7 @@ void ScummEngine_v90he::o90_setSpriteGroupInfo() { void ScummEngine_v90he::o90_getWizData() { byte filename[4096]; - int state, resId; + int resId, state, type; int32 w, h; int32 x, y; @@ -1317,9 +1317,10 @@ void ScummEngine_v90he::o90_getWizData() { push(computeWizHistogram(resId, state, x, y, w, h)); break; case 139: - pop(); - pop(); - push(0); + type = pop(); + state = pop(); + resId = pop(); + push(_wiz->getWizImageData(resId, state, type)); break; case 141: pop(); @@ -2099,7 +2100,8 @@ void ScummEngine_v90he::o90_getObjectData() { } void ScummEngine_v90he::o90_getPaletteData() { - int b, c, d, e; + int c, d, e; + int r, g, b; int palSlot, color; byte subOp = fetchScriptByte(); @@ -2109,10 +2111,10 @@ void ScummEngine_v90he::o90_getPaletteData() { e = pop(); d = pop(); palSlot = pop(); - pop(); - c = pop(); b = pop(); - push(getHEPaletteSimilarColor(palSlot, b, c, d, e)); + g = pop(); + r = pop(); + push(getHEPaletteSimilarColor(palSlot, r, g, d, e)); break; case 52: c = pop(); @@ -2128,17 +2130,31 @@ void ScummEngine_v90he::o90_getPaletteData() { case 132: c = pop(); b = pop(); - push(getHEPaletteColorComponent(1, b, c)); + if (_game.features & GF_16BIT_COLOR) + push(getHEPalette16BitColorComponent(b, c)); + else + push(getHEPaletteColorComponent(1, b, c)); break; case 217: - pop(); - c = pop(); - c = MAX(0, c); - c = MIN(c, 255); b = pop(); b = MAX(0, b); b = MIN(b, 255); - push(getHEPaletteSimilarColor(1, b, c, 10, 245)); + g = pop(); + g = MAX(0, g); + g = MIN(g, 255); + r = pop(); + r = MAX(0, r); + r = MIN(r, 255); + + if (_game.features & GF_16BIT_COLOR) { + uint32 ar = ((r >> 3) << 10) & 0xFFFF; + uint32 ag = ((g >> 3) << 5) & 0xFFFF; + uint32 ab = ((b >> 3) << 0) & 0xFFFF; + uint32 col = ar | ag | ab; + push(col); + } else { + push(getHEPaletteSimilarColor(1, r, g, 10, 245)); + } break; default: error("o90_getPaletteData: Unknown case %d", subOp); -- cgit v1.2.3 From fdbc49ab5f4b9320e4cdac8edd427304910d8235 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Thu, 4 Jun 2009 11:03:45 +0000 Subject: Fix the color of Poodles Galore's finger nails in Spy Fox 3. svn-id: r41162 --- engines/scumm/he/script_v90he.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'engines/scumm/he/script_v90he.cpp') diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp index 212ba69bdc..c6b919f554 100644 --- a/engines/scumm/he/script_v90he.cpp +++ b/engines/scumm/he/script_v90he.cpp @@ -2147,11 +2147,7 @@ void ScummEngine_v90he::o90_getPaletteData() { r = MIN(r, 255); if (_game.features & GF_16BIT_COLOR) { - uint32 ar = ((r >> 3) << 10) & 0xFFFF; - uint32 ag = ((g >> 3) << 5) & 0xFFFF; - uint32 ab = ((b >> 3) << 0) & 0xFFFF; - uint32 col = ar | ag | ab; - push(col); + push(get16BitColor(r, g, b)); } else { push(getHEPaletteSimilarColor(1, r, g, 10, 245)); } -- cgit v1.2.3