[Scummvm-cvs-logs] scummvm master -> 6cf0bfe6d52a9c0f02cad3076970f38818a22f06

dreammaster dreammaster at scummvm.org
Fri Jul 31 04:37:15 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6cf0bfe6d5 SHERLOCK: RT: Further fixes for _lookupTable1 init


Commit: 6cf0bfe6d52a9c0f02cad3076970f38818a22f06
    https://github.com/scummvm/scummvm/commit/6cf0bfe6d52a9c0f02cad3076970f38818a22f06
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-30T22:36:11-04:00

Commit Message:
SHERLOCK: RT: Further fixes for _lookupTable1 init

Changed paths:
    engines/sherlock/scene.cpp
    engines/sherlock/tattoo/tattoo_journal.cpp
    engines/sherlock/tattoo/tattoo_user_interface.cpp



diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index cca4184..eaca780 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 737593f..861f709 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 ef3a7d3..77f2dc6 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;






More information about the Scummvm-git-logs mailing list