aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/scene.cpp3
-rw-r--r--engines/sherlock/tattoo/tattoo_journal.cpp2
-rw-r--r--engines/sherlock/tattoo/tattoo_user_interface.cpp21
3 files changed, 12 insertions, 14 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index cca4184207..eaca780d40 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -363,9 +363,8 @@ bool Scene::loadScene(const Common::String &filename) {
// Handle initializing the palette
screen.initPaletteFade(bgHeader._bytesWritten);
rrmStream->read(screen._cMap, PALETTE_SIZE);
- screen.translatePalette(screen._cMap);
-
paletteLoaded();
+ screen.translatePalette(screen._cMap);
// Read in background
if (_compressed) {
diff --git a/engines/sherlock/tattoo/tattoo_journal.cpp b/engines/sherlock/tattoo/tattoo_journal.cpp
index 737593fa74..861f7099df 100644
--- a/engines/sherlock/tattoo/tattoo_journal.cpp
+++ b/engines/sherlock/tattoo/tattoo_journal.cpp
@@ -59,8 +59,8 @@ void TattooJournal::show() {
// Load palette
Common::SeekableReadStream *stream = res.load("journal.pal");
stream->read(palette, PALETTE_SIZE);
- screen.translatePalette(palette);
ui.setupBGArea(palette);
+ screen.translatePalette(palette);
delete stream;
// Set screen to black, and set background
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index ef3a7d3741..77f2dc60df 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -594,8 +594,7 @@ void TattooUserInterface::setupBGArea(const byte cMap[PALETTE_SIZE]) {
// to darker as the palette numbers go up. The last palette entry in that run is specified by _bgColor
byte *p = &_lookupTable[0];
for (int idx = 0; idx < PALETTE_COUNT; ++idx)
- *p++ = BG_GREYSCALE_RANGE_END - ((cMap[idx * 3] / 4) * 30 + (cMap[idx * 3 + 1] / 4) * 59 +
- (cMap[idx * 3 + 2] / 4) * 11) / 480;
+ *p++ = BG_GREYSCALE_RANGE_END - (cMap[idx * 3] * 30 + cMap[idx * 3 + 1] * 59 + cMap[idx * 3 + 2] * 11) / 480;
// If we're going to a scene with a haze special effect, initialize the translate table to lighten the colors
if (_mask != nullptr) {
@@ -605,23 +604,23 @@ void TattooUserInterface::setupBGArea(const byte cMap[PALETTE_SIZE]) {
int r, g, b;
switch (scene._currentScene) {
case 8:
- r = cMap[idx * 3] / 5;
+ r = cMap[idx * 3] * 4 / 5;
g = cMap[idx * 3 + 1] * 3 / 4;
b = cMap[idx * 3 + 2] * 3 / 4;
break;
case 18:
case 68:
- r = cMap[idx * 3] / 3;
- g = cMap[idx * 3 + 1] / 3;
- b = cMap[idx * 3 + 2] / 3;
+ r = cMap[idx * 3] * 4 / 3;
+ g = cMap[idx * 3 + 1] * 4 / 3;
+ b = cMap[idx * 3 + 2] * 4 / 3;
break;
case 7:
case 53:
- r = cMap[idx * 3] / 3;
- g = cMap[idx * 3 + 1] / 3;
- b = cMap[idx * 3 + 2] / 3;
+ r = cMap[idx * 3] * 4 / 3;
+ g = cMap[idx * 3 + 1] * 4 / 3;
+ b = cMap[idx * 3 + 2] * 4 / 3;
break;
default:
@@ -633,8 +632,8 @@ void TattooUserInterface::setupBGArea(const byte cMap[PALETTE_SIZE]) {
int cd = 99999;
for (int pal = 0; pal < PALETTE_COUNT; ++pal) {
- 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);
+ 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]);
if (d < cd) {
c = pal;