From 7b6c49033e70f730d09c36d9c96cd25717c80ad1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 30 Jul 2015 22:04:20 -0400 Subject: SHERLOCK: RT: Fix initialization of _lookupTable1 --- engines/sherlock/tattoo/tattoo_user_interface.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engines/sherlock/tattoo/tattoo_user_interface.cpp') diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp index b5ac998103..ef3a7d3741 100644 --- a/engines/sherlock/tattoo/tattoo_user_interface.cpp +++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp @@ -605,23 +605,23 @@ void TattooUserInterface::setupBGArea(const byte cMap[PALETTE_SIZE]) { int r, g, b; switch (scene._currentScene) { case 8: - r = cMap[idx * 3] * 4 / 5; + r = cMap[idx * 3] / 5; g = cMap[idx * 3 + 1] * 3 / 4; b = cMap[idx * 3 + 2] * 3 / 4; break; case 18: case 68: - r = cMap[idx * 3] * 4 / 3; - g = cMap[idx * 3 + 1] * 4 / 3; - b = cMap[idx * 3 + 2] * 4 / 3; + r = cMap[idx * 3] / 3; + g = cMap[idx * 3 + 1] / 3; + b = cMap[idx * 3 + 2] / 3; break; case 7: case 53: - r = cMap[idx * 3] * 4 / 3; - g = cMap[idx * 3 + 1] * 4 / 3; - b = cMap[idx * 3 + 2] * 4 / 3; + r = cMap[idx * 3] / 3; + g = cMap[idx * 3 + 1] / 3; + b = cMap[idx * 3 + 2] / 3; break; default: @@ -629,12 +629,12 @@ void TattooUserInterface::setupBGArea(const byte cMap[PALETTE_SIZE]) { break; } - byte c = 0; - int cd = (r - cMap[0]) * (r - cMap[0]) + (g - cMap[1]) * (g - cMap[1]) + (b - cMap[2]) * (b - cMap[2]); + byte c = 0xff; + int cd = 99999; for (int pal = 0; pal < PALETTE_COUNT; ++pal) { - int d = (r - cMap[pal * 3]) * (r - cMap[pal * 3]) + (g - cMap[pal * 3 + 1]) * (g - cMap[pal * 3 + 1]) - + (b - cMap[pal * 3 + 2])*(b - cMap[pal * 3 + 2]); + int d = (r - cMap[pal * 3] / 4) * (r - cMap[pal * 3] / 4) + (g - cMap[pal * 3 + 1] / 4) * (g - cMap[pal * 3 + 1] / 4) + + (b - cMap[pal * 3 + 2] / 4) * (b - cMap[pal * 3 + 2] / 4); if (d < cd) { c = pal; -- cgit v1.2.3