[Scummvm-cvs-logs] scummvm master -> deada3e30d1b897191dd2a97ac74999a1f967578

dreammaster dreammaster at scummvm.org
Sun Jun 21 16:13:30 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:
deada3e30d SHERLOCK: RT: Beginnings of journal display


Commit: deada3e30d1b897191dd2a97ac74999a1f967578
    https://github.com/scummvm/scummvm/commit/deada3e30d1b897191dd2a97ac74999a1f967578
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-21T10:11:43-04:00

Commit Message:
SHERLOCK: RT: Beginnings of journal display

Changed paths:
    engines/sherlock/tattoo/tattoo_journal.cpp
    engines/sherlock/tattoo/tattoo_journal.h
    engines/sherlock/tattoo/tattoo_scene.cpp
    engines/sherlock/tattoo/tattoo_scene.h
    engines/sherlock/tattoo/tattoo_user_interface.cpp
    engines/sherlock/tattoo/tattoo_user_interface.h



diff --git a/engines/sherlock/tattoo/tattoo_journal.cpp b/engines/sherlock/tattoo/tattoo_journal.cpp
index ff4f6b3..380f6ef 100644
--- a/engines/sherlock/tattoo/tattoo_journal.cpp
+++ b/engines/sherlock/tattoo/tattoo_journal.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "sherlock/tattoo/tattoo_journal.h"
+#include "sherlock/tattoo/tattoo_scene.h"
+#include "sherlock/tattoo/tattoo_user_interface.h"
 #include "sherlock/sherlock.h"
 
 namespace Sherlock {
@@ -28,6 +30,25 @@ namespace Sherlock {
 namespace Tattoo {
 
 TattooJournal::TattooJournal(SherlockEngine *vm) : Journal(vm) {
+	_journalImages = nullptr;
+}
+
+void TattooJournal::show() {
+	Resources &res = *_vm->_res;
+	Screen &screen = *_vm->_screen;
+	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
+
+	// Load journal images
+	_journalImages = new ImageFile("journal.vgs");
+
+	// Load palette
+	Common::SeekableReadStream *stream = res.load("journal.pal");
+	stream->read(screen._tMap, PALETTE_SIZE);
+	screen.translatePalette(screen._tMap);
+	ui.setupBGArea(screen._tMap);
+
+
+	delete _journalImages;
 }
 
 void TattooJournal::synchronize(Serializer &s) {
diff --git a/engines/sherlock/tattoo/tattoo_journal.h b/engines/sherlock/tattoo/tattoo_journal.h
index ebfcd46..db70c29 100644
--- a/engines/sherlock/tattoo/tattoo_journal.h
+++ b/engines/sherlock/tattoo/tattoo_journal.h
@@ -24,17 +24,25 @@
 #define SHERLOCK_TATTOO_JOURNAL_H
 
 #include "sherlock/journal.h"
+#include "sherlock/image_file.h"
 
 namespace Sherlock {
 
 namespace Tattoo {
 
 class TattooJournal : public Journal {
+private:
+	ImageFile *_journalImages;
 public:
 	TattooJournal(SherlockEngine *vm);
 	virtual ~TattooJournal() {}
 
 	/**
+	 * Show the journal
+	 */
+	void show();
+
+	/**
 	 * Synchronize the data for a savegame
 	 */
 	virtual void synchronize(Serializer &s);
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index 1c39890..81ae50c 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -50,11 +50,7 @@ static bool sortImagesY(const ShapeEntry &s1, const ShapeEntry &s2) {
 /*----------------------------------------------------------------*/
 
 TattooScene::TattooScene(SherlockEngine *vm) : Scene(vm) {
-	Common::fill(&_lookupTable[0], &_lookupTable[PALETTE_COUNT], 0);
-	Common::fill(&_lookupTable1[0], &_lookupTable1[PALETTE_COUNT], 0);
 	_arrowZone = -1;
-	_mask = _mask1 = nullptr;
-	_maskCounter = 0;
 	_labTableScene = false;
 }
 
@@ -263,7 +259,7 @@ void TattooScene::paletteLoaded() {
 	Screen &screen = *_vm->_screen;
 	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
 
-	setupBGArea(screen._cMap);
+	ui.setupBGArea(screen._cMap);
 	ui.initScrollVars();
 }
 
@@ -326,7 +322,7 @@ void TattooScene::doBgAnimEraseBackground() {
 	
 	static const int16 OFFSETS[16] = { -1, -2, -3, -3, -2, -1, -1, 0, 1, 2, 3, 3, 2, 1, 0, 0 };
 
-	if (_mask != nullptr) {
+	if (ui._mask != nullptr) {
 		if (screen._backBuffer1.w() > screen.w())
 			screen.blitFrom(screen._backBuffer1, Common::Point(0, 0), Common::Rect(ui._currentScroll.x, 0,
 			ui._currentScroll.x + screen.w(), screen.h()));
@@ -335,33 +331,33 @@ void TattooScene::doBgAnimEraseBackground() {
 
 		switch (_currentScene) {
 		case 7:
-			if (++_maskCounter == 2) {
-				_maskCounter = 0;
-				if (--_maskOffset.x < 0)
-					_maskOffset.x = SHERLOCK_SCREEN_WIDTH - 1;
+			if (++ui._maskCounter == 2) {
+				ui._maskCounter = 0;
+				if (--ui._maskOffset.x < 0)
+					ui._maskOffset.x = SHERLOCK_SCREEN_WIDTH - 1;
 			}
 			break;
 
 		case 8:
-			_maskOffset.x += 2;
-			if (_maskOffset.x >= SHERLOCK_SCREEN_WIDTH)
-				_maskOffset.x = 0;
+			ui._maskOffset.x += 2;
+			if (ui._maskOffset.x >= SHERLOCK_SCREEN_WIDTH)
+				ui._maskOffset.x = 0;
 			break;
 
 		case 18:
 		case 68:
-			++_maskCounter;
-			if (_maskCounter / 4 >= 16)
-				_maskCounter = 0;
+			++ui._maskCounter;
+			if (ui._maskCounter / 4 >= 16)
+				ui._maskCounter = 0;
 
-			_maskOffset.x = OFFSETS[_maskCounter / 4];
+			ui._maskOffset.x = OFFSETS[ui._maskCounter / 4];
 			break;
 
 		case 53:
-			if (++_maskCounter == 2) {
-				_maskCounter = 0;
-				if (++_maskOffset.x == screen._backBuffer1.w())
-					_maskOffset.x = 0;
+			if (++ui._maskCounter == 2) {
+				ui._maskCounter = 0;
+				if (++ui._maskOffset.x == screen._backBuffer1.w())
+					ui._maskOffset.x = 0;
 			}
 			break;
 
@@ -501,36 +497,36 @@ void TattooScene::doBgAnimUpdateBgObjectsAndAnim() {
 	drawAllShapes();
 
 
-	if (_mask != nullptr) {
+	if (ui._mask != nullptr) {
 		switch (_currentScene) {
 		case 7:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x - SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x, 110), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x + SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x - SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x + SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
 			break;
 
 		case 8:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x - SHERLOCK_SCREEN_WIDTH, 180), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x, 180), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x + SHERLOCK_SCREEN_WIDTH, 180), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x - SHERLOCK_SCREEN_WIDTH, 180), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x, 180), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x + SHERLOCK_SCREEN_WIDTH, 180), ui._currentScroll.x);
 			if (!_vm->readFlags(880))
-				screen._backBuffer1.maskArea((*_mask1)[0], Common::Point(940, 300), ui._currentScroll.x);
+				screen._backBuffer1.maskArea((*ui._mask1)[0], Common::Point(940, 300), ui._currentScroll.x);
 			break;
 
 		case 18:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x, 203), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x, 203), ui._currentScroll.x);
 			if (!_vm->readFlags(189))
-				screen._backBuffer1.maskArea((*_mask1)[0], Common::Point(124 + _maskOffset.x, 239), ui._currentScroll.x);
+				screen._backBuffer1.maskArea((*ui._mask1)[0], Common::Point(124 + ui._maskOffset.x, 239), ui._currentScroll.x);
 			break;
 
 		case 53:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x, 110), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x - SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x - SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
 			break;
 
 		case 68:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x, 203), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask1)[0], Common::Point(124 + _maskOffset.x, 239), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x, 203), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask1)[0], Common::Point(124 + ui._maskOffset.x, 239), ui._currentScroll.x);
 			break;
 		}
 	}
@@ -543,35 +539,35 @@ void TattooScene::updateBackground() {
 
 	Scene::updateBackground();
 
-	if (_mask != nullptr) {
+	if (ui._mask != nullptr) {
 		switch (_currentScene) {
 		case 7:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x - SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x, 110), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x + SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x - SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x + SHERLOCK_SCREEN_WIDTH, 110), ui._currentScroll.x);
 			break;
 
 		case 8:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x - SHERLOCK_SCREEN_WIDTH, 180), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x, 180), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x + SHERLOCK_SCREEN_WIDTH, 180), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x - SHERLOCK_SCREEN_WIDTH, 180), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x, 180), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x + SHERLOCK_SCREEN_WIDTH, 180), ui._currentScroll.x);
 			if (!_vm->readFlags(880))
-				screen._backBuffer1.maskArea((*_mask1)[0], Common::Point(940, 300), ui._currentScroll.x);
+				screen._backBuffer1.maskArea((*ui._mask1)[0], Common::Point(940, 300), ui._currentScroll.x);
 			break;
 
 		case 18:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(0, 203), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(0, 203), ui._currentScroll.x);
 			if (!_vm->readFlags(189))
-				screen._backBuffer1.maskArea((*_mask1)[0], Common::Point(124, 239), ui._currentScroll.x);
+				screen._backBuffer1.maskArea((*ui._mask1)[0], Common::Point(124, 239), ui._currentScroll.x);
 			break;
 
 		case 53:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(_maskOffset.x, 110), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(ui._maskOffset.x, 110), ui._currentScroll.x);
 			break;
 
 		case 68:
-			screen._backBuffer1.maskArea((*_mask)[0], Common::Point(0, 203), ui._currentScroll.x);
-			screen._backBuffer1.maskArea((*_mask1)[0], Common::Point(124, 239), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask)[0], Common::Point(0, 203), ui._currentScroll.x);
+			screen._backBuffer1.maskArea((*ui._mask1)[0], Common::Point(124, 239), ui._currentScroll.x);
 			break;
 
 		default:
@@ -751,64 +747,6 @@ int TattooScene::getScaleVal(const Point32 &pt) {
 	return result;
 }
 
-void TattooScene::setupBGArea(const byte cMap[PALETTE_SIZE]) {
-	// This requires that there is a 16 grayscale palette sequence in the palette that goes from lighter 
-	// 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] * 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) {
-		p = &_lookupTable1[0];
-
-		for (int idx = 0; idx < PALETTE_COUNT; ++idx) {
-			int r, g, b;
-			switch (_currentScene) {
-			case 8:
-				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] * 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] * 4 / 3;
-				g = cMap[idx * 3 + 1] * 4 / 3;
-				b = cMap[idx * 3 + 2] * 4 / 3;
-				break;
-			
-			default:
-				r = g = b = 0;
-				break;
-			}
-
-			byte c = 0;
-			int cd = (r - cMap[0]) * (r - cMap[0]) + (g - cMap[1]) * (g - cMap[1]) + (b - cMap[2]) * (b - cMap[2]);
-
-			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]);
-
-				if (d < cd) {
-					c = pal;
-					cd = d;
-					if (!d)
-						break;
-				}
-			}
-			*p++ = c;
-		}
-	}
-}
-
 #define ADJUST_COORD(COORD) \
 	if (COORD.x != -1) \
 		COORD.x *= FIXED_INT_MULTIPLIER; \
diff --git a/engines/sherlock/tattoo/tattoo_scene.h b/engines/sherlock/tattoo/tattoo_scene.h
index 58a73ec..0118a9d 100644
--- a/engines/sherlock/tattoo/tattoo_scene.h
+++ b/engines/sherlock/tattoo/tattoo_scene.h
@@ -47,10 +47,6 @@ struct SceneTripEntry {
 class TattooScene : public Scene {
 private:
 	int _arrowZone;
-	int _maskCounter;
-	Common::Point _maskOffset;
-	byte _lookupTable[PALETTE_COUNT];
-	byte _lookupTable1[PALETTE_COUNT];
 private:
 	void doBgAnimCheckCursor();
 
@@ -64,11 +60,6 @@ private:
 	void doBgAnimDrawSprites();
 
 	/**
-	 * Makes a greyscale translation table for each palette entry in the table
-	 */
-	void setupBGArea(const byte cMap[PALETTE_SIZE]);
-
-	/**
 	 * Resets the NPC path information when entering a new scene.
 	 * @remarks		The default talk file for the given NPC is set to WATS##A, where ## is
 	 *		the scene number being entered
@@ -108,7 +99,6 @@ protected:
 	 */
 	virtual void synchronize(Serializer &s);
 public:
-	ImageFile *_mask, *_mask1;
 	CAnimStream _activeCAnim;
 	Common::Array<SceneTripEntry> _sceneTripCounters;
 	bool _labTableScene;
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index 462eccc..a324eba 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "sherlock/tattoo/tattoo_user_interface.h"
+#include "sherlock/tattoo/tattoo_journal.h"
 #include "sherlock/tattoo/tattoo_scene.h"
 #include "sherlock/tattoo/tattoo.h"
 
@@ -30,6 +31,8 @@ namespace Tattoo {
 
 TattooUserInterface::TattooUserInterface(SherlockEngine *vm): UserInterface(vm),
 		_inventoryWidget(vm),  _tooltipWidget(vm), _verbsWidget(vm), _textWidget(vm) {
+	Common::fill(&_lookupTable[0], &_lookupTable[PALETTE_COUNT], 0);
+	Common::fill(&_lookupTable1[0], &_lookupTable1[PALETTE_COUNT], 0);
 	_menuBuffer = nullptr;
 	_invMenuBuffer = nullptr;
 	_invGraphic = nullptr;
@@ -46,6 +49,8 @@ TattooUserInterface::TattooUserInterface(SherlockEngine *vm): UserInterface(vm),
 	_cAnimFramePause = 0;
 	_widget = nullptr;
 	_scrollHighlight = 0;
+	_mask = _mask1 = nullptr;
+	_maskCounter = 0;
 }
 
 void TattooUserInterface::initScrollVars() {
@@ -186,7 +191,10 @@ void TattooUserInterface::printObjectDesc(const Common::String &str, bool firstT
 }
 
 void TattooUserInterface::doJournal() {
-	// TODO
+	TattooJournal &journal = *(TattooJournal *)_vm->_journal;
+	
+	_menuMode = JOURNAL_MODE;
+	journal.show();	
 }
 
 void TattooUserInterface::reset() {
@@ -261,7 +269,6 @@ void TattooUserInterface::handleInput() {
 }
 
 void TattooUserInterface::drawInterface(int bufferNum) {
-	TattooScene &scene = *(TattooScene *)_vm->_scene;
 	Screen &screen = *_vm->_screen;
 	TattooEngine &vm = *(TattooEngine *)_vm;
 	
@@ -298,7 +305,7 @@ void TattooUserInterface::drawInterface(int bufferNum) {
 		vm.drawCredits();
 
 	// Bring the widgets to the screen
-	if (scene._mask != nullptr)
+	if (_mask != nullptr)
 		screen._flushScreen = true;
 
 	if (screen._flushScreen)
@@ -648,6 +655,66 @@ void TattooUserInterface::putMessage(const Common::String &str) {
 	// TODO
 }
 
+void TattooUserInterface::setupBGArea(const byte cMap[PALETTE_SIZE]) {
+	Scene &scene = *_vm->_scene;
+
+	// This requires that there is a 16 grayscale palette sequence in the palette that goes from lighter 
+	// 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] * 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) {
+		p = &_lookupTable1[0];
+
+		for (int idx = 0; idx < PALETTE_COUNT; ++idx) {
+			int r, g, b;
+			switch (scene._currentScene) {
+			case 8:
+				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] * 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] * 4 / 3;
+				g = cMap[idx * 3 + 1] * 4 / 3;
+				b = cMap[idx * 3 + 2] * 4 / 3;
+				break;
+			
+			default:
+				r = g = b = 0;
+				break;
+			}
+
+			byte c = 0;
+			int cd = (r - cMap[0]) * (r - cMap[0]) + (g - cMap[1]) * (g - cMap[1]) + (b - cMap[2]) * (b - cMap[2]);
+
+			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]);
+
+				if (d < cd) {
+					c = pal;
+					cd = d;
+					if (!d)
+						break;
+				}
+			}
+			*p++ = c;
+		}
+	}
+}
+
 } // End of namespace Tattoo
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.h b/engines/sherlock/tattoo/tattoo_user_interface.h
index 935e076..49f7c1f 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.h
+++ b/engines/sherlock/tattoo/tattoo_user_interface.h
@@ -25,6 +25,7 @@
 
 #include "common/scummsys.h"
 #include "sherlock/saveload.h"
+#include "sherlock/screen.h"
 #include "sherlock/user_interface.h"
 #include "sherlock/tattoo/widget_inventory.h"
 #include "sherlock/tattoo/widget_text.h"
@@ -60,6 +61,8 @@ private:
 	WidgetSceneTooltip _tooltipWidget;
 	WidgetVerbs _verbsWidget;
 	WidgetBase *_widget;
+	byte _lookupTable[PALETTE_COUNT];
+	byte _lookupTable1[PALETTE_COUNT];
 private:
 	/**
 	 * Draws designated areas of the screen that are meant to be grayed out using grayscale colors
@@ -138,6 +141,9 @@ public:
 	Common::KeyState _keyState;
 	Common::Point _lookPos;
 	int _scrollHighlight;
+	ImageFile *_mask, *_mask1;
+	Common::Point _maskOffset;
+	int _maskCounter;
 public:
 	TattooUserInterface(SherlockEngine *vm);
 	virtual ~TattooUserInterface() {}
@@ -190,6 +196,11 @@ public:
 	void pickUpObject(int objNum);
 
 	void putMessage(const Common::String &str);
+
+	/**
+	 * Makes a greyscale translation table for each palette entry in the table
+	 */
+	void setupBGArea(const byte cMap[PALETTE_SIZE]);
 public:
 	/**
 	 * Resets the user interface






More information about the Scummvm-git-logs mailing list