[Scummvm-cvs-logs] scummvm master -> 9eb168583fb1a6b2464cf856adc4888d6b396f35

dreammaster dreammaster at scummvm.org
Sat Jun 27 03:35:39 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:
9eb168583f SHERLOCK: Split FixedText into separate descendents for each game


Commit: 9eb168583fb1a6b2464cf856adc4888d6b396f35
    https://github.com/scummvm/scummvm/commit/9eb168583fb1a6b2464cf856adc4888d6b396f35
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-26T21:34:37-04:00

Commit Message:
SHERLOCK: Split FixedText into separate descendents for each game

Changed paths:
  A engines/sherlock/scalpel/scalpel_fixed_text.cpp
  A engines/sherlock/scalpel/scalpel_fixed_text.h
  A engines/sherlock/tattoo/tattoo_fixed_text.cpp
  A engines/sherlock/tattoo/tattoo_fixed_text.h
    engines/sherlock/fixed_text.cpp
    engines/sherlock/fixed_text.h
    engines/sherlock/journal.cpp
    engines/sherlock/module.mk
    engines/sherlock/scalpel/scalpel.cpp
    engines/sherlock/scalpel/scalpel_inventory.cpp
    engines/sherlock/scalpel/scalpel_journal.cpp
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/sherlock.cpp
    engines/sherlock/tattoo/widget_verbs.cpp



diff --git a/engines/sherlock/fixed_text.cpp b/engines/sherlock/fixed_text.cpp
index 09e38bf..cbee944 100644
--- a/engines/sherlock/fixed_text.cpp
+++ b/engines/sherlock/fixed_text.cpp
@@ -22,359 +22,17 @@
 
 #include "sherlock/sherlock.h"
 #include "sherlock/fixed_text.h"
+#include "sherlock/scalpel/scalpel_fixed_text.h"
+#include "sherlock/tattoo/tattoo_fixed_text.h"
 
 namespace Sherlock {
 
-static const char *const fixedTextEN[] = {
-	// SH1: Window buttons
-	"Exit",
-	"Up",
-	"Down",
-	// SH1: Inventory buttons
-	"Exit",
-	"Look",
-	"Use",
-	"Give",
-	// SH1: Journal text
-	"Watson's Journal",
-	"Page %d",
-	// SH1: Journal buttons
-	"Exit",
-	"Back 10",
-	"Up",
-	"Down",
-	"Ahead 10",
-	"Search",
-	"First Page",
-	"Last Page",
-	"Print Text",
-	// SH1: Journal search
-	"Exit",
-	"Backward",
-	"Forward",
-	"Text Not Found !",
-	// SH1: Initial Inventory
-	"A message requesting help",
-	"A number of business cards",
-	"Opera Tickets",
-	"Cuff Link",
-	"Wire Hook",
-	"Note",
-	"An open pocket watch",
-	"A piece of paper with numbers on it",
-	"A letter folded many times",
-	"Tarot Cards",
-	"An ornate key",
-	"A pawn ticket",
-	// SH2: Verbs
-	"Open",
-	"Look",
-	"Talk",
-	"Journal"
-};
-
-// sharp-s       : 0xE1 / octal 341
-// small a-umlaut: 0x84 / octal 204
-// small o-umlaut: 0x94 / octal 224
-// small u-umlaut: 0x81 / octal 201
-static const char *const fixedTextDE[] = {
-	// SH1: Window buttons
-	"Zur\201ck",
-	"Hoch",
-	"Runter",
-	// SH1: Inventory buttons
-	"Zur\201ck",
-	"Schau",
-	"Benutze",
-	"Gib",
-	// SH1: Journal text
-	"Watsons Tagebuch",
-	"Seite %d",
-	// SH1: Journal buttons
-	"Zur\201ck",
-	"10 hoch",
-	"Hoch",
-	"Runter",
-	"10 runter",
-	"Suche",
-	"Erste Seite",
-	"Letzte Seite",
-	"Drucke Text",
-	// SH1: Journal search
-	"Zur\201ck",
-	"R\201ckw\204rts", // original: "Backward"
-	"Vorw\204rts", // original: "Forward"
-	"Text nicht gefunden!",
-	// SH1: Initial Inventory
-	"Ein Hilferuf von Lestrade",
-	"Holmes' Visitenkarten",
-	"Karten f\201rs Opernhaus",
-	"Manschettenkn\224pfe",
-	"Zum Haken verbogener Drahtkorb",
-	"Mitteilung am Epstein",
-	"Eine offene Taschenuhr",
-	"Ein Zettel mit Zahlen drauf",
-	"Ein mehrfach gefalteter Briefbogen",
-	"Ein Tarock-Kartenspiel", // [sic]
-	"Ein verzierter Schl\201ssel",
-	"Ein Pfandschein",
-	// SH2: Verbs
-	"\231ffne",
-	"Schau",
-	"Rede",
-	"Tagebuch"
-};
-
-// up-side down exclamation mark - 0xAD / octal 255
-// up-side down question mark - 0xA8 / octal 250
-// n with a wave on top - 0xA4 / octal 244
-static const char *const fixedTextES[] = {
-	// SH1: Window buttons
-	"Exit",
-	"Subir",
-	"Bajar",
-	// SH1: Inventory buttons
-	"Exit",
-	"Mirar",
-	"Usar",
-	"Dar",
-	// SH1: Journal text
-	"Diario de Watson",
-	"Pagina %d",
-	// SH1: Journal buttons
-	"Exit",
-	"Retroceder",
-	"Subir",
-	"baJar",
-	"Adelante",
-	"Buscar",
-	"1a pagina",
-	"Ult pagina",
-	"Imprimir",
-	// SH1: Journal search
-	"Exit",
-	"Retroceder",
-	"Avanzar",
-	"Texto no encontrado!",
-	// SH1: Initial Inventory
-	"Un mensaje solicitando ayuda",
-	"Unas cuantas tarjetas de visita",
-	"Entradas para la opera",
-	"Unos gemelos",
-	"Un gancho de alambre",
-	"Una nota",
-	"Un reloj de bolsillo abierto",
-	"Un trozo de papel con unos numeros",
-	"Un carta muy plegada",
-	"Unas cartas de Tarot",
-	"Una llave muy vistosa",
-	"Una papeleta de empe\244o",
-	// SH2: Verbs --- TODO: not known at the moment
-	"Open",
-	"Look",
-	"Talk",
-	"Journal"
-};
-
-// =========================================
-
-// === Sherlock Holmes 1: Serrated Scalpel ===
-static const char *const fixedTextEN_ActionOpen[] = {
-	"This cannot be opened",
-	"It is already open",
-	"It is locked",
-	"Wait for Watson",
-	" ",
-	"."
-};
-
-static const char *const fixedTextDE_ActionOpen[] = {
-	"Das kann man nicht \224ffnen",
-	"Ist doch schon offen!",
-	"Leider verschlossen",
-	"Warte auf Watson",
-	" ",
-	"."
-};
-
-static const char *const fixedTextES_ActionOpen[] = {
-	"No puede ser abierto",
-	"Ya esta abierto",
-	"Esta cerrado",
-	"Espera a Watson",
-	" ",
-	"."
-};
-
-static const char *const fixedTextEN_ActionClose[] = {
-	"This cannot be closed",
-	"It is already closed",
-	"The safe door is in the way"
-};
-
-static const char *const fixedTextDE_ActionClose[] = {
-	"Das kann man nicht schlie\341en",
-	"Ist doch schon zu!",
-	"Die safet\201r ist Weg"
-};
-
-static const char *const fixedTextES_ActionClose[] = {
-	"No puede ser cerrado",
-	"Ya esta cerrado",
-	"La puerta de seguridad esta entre medias"
-};
-
-static const char *const fixedTextEN_ActionMove[] = {
-	"This cannot be moved",
-	"It is bolted to the floor",
-	"It is too heavy",
-	"The other crate is in the way"
-};
-
-
-static const char *const fixedTextDE_ActionMove[] = {
-	"L\204\341t sich nicht bewegen",
-	"Festged\201belt in der Erde...",
-	"Oha, VIEL zu schwer",
-	"Der andere Kiste ist im Weg" // [sic]
-};
-
-static const char *const fixedTextES_ActionMove[] = {
-	"No puede moverse",
-	"Esta sujeto a la pared",
-	"Es demasiado pesado",
-	"El otro cajon esta en mitad"
-};
-
-static const char *const fixedTextEN_ActionPick[] = {
-	"Nothing of interest here",
-	"It is bolted down",
-	"It is too big to carry",
-	"It is too heavy",
-	"I think a girl would be more your type",
-	"Those flowers belong to Penny",
-	"She's far too young for you!",
-	"I think a girl would be more your type!",
-	"Government property for official use only"
-};
-
-static const char *const fixedTextDE_ActionPick[] = {
-	"Nichts Interessantes da",
-	"Zu gut befestigt",
-	"Ist ja wohl ein bi\341chen zu gro\341, oder ?",
-	"Oha, VIEL zu schwer",
-	"Ich denke, Du stehst mehr auf M\204dchen ?",
-	"Diese Blumen geh\224ren Penny",
-	"Sie ist doch viel zu jung f\201r Dich!",
-	"Ich denke, Du stehst mehr auf M\204dchen ?",
-	"Staatseigentum - Nur für den Dienstgebrauch !"
-};
-
-static const char *const fixedTextES_ActionPick[] = {
-	"No hay nada interesante",
-	"Esta anclado al suelo",
-	"Es muy grande para llevarlo",
-	"Pesa demasiado",
-	"Creo que una chica sera mas tu tipo",
-	"Esas flores pertenecen a Penny",
-	"\255Es demasiado joven para ti!"
-	"\255Creo que una chica sera mas tu tipo!",
-	"Propiedad del gobierno para uso oficial"
-};
-
-static const char *const fixedTextEN_ActionUse[] = {
-	"You can't do that",
-	"It had no effect",
-	"You can't reach it",
-	"OK, the door looks bigger! Happy?"
-	"Doors don't smoke"
-};
-
-static const char *const fixedTextDE_ActionUse[] = {
-	"Nein, das geht wirklich nicht",
-	"Tja keinerlei Wirkung",
-	"Da kommst du nicht dran",
-	"Na gut, die Tür sieht jetzt gr\224\341er aus. Zufrieden?"
-	"Türen sind Nichtraucher!"
-};
-
-static const char *const fixedTextES_ActionUse[] = {
-	"No puedes hacerlo",
-	"No tuvo ningun efecto",
-	"No puedes alcanzarlo",
-	"Bien, \255es enorme! \250Feliz?"
-	"Las puertas no fuman"
-};
-
-#define FIXEDTEXT_GETCOUNT(_name_) sizeof(_name_) / sizeof(byte *)
-#define FIXEDTEXT_ENTRY(_name_)    _name_, FIXEDTEXT_GETCOUNT(_name_)
-
-static const FixedTextActionEntry fixedTextEN_Actions[] = {
-	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionOpen) },
-	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionClose) },
-	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionMove) },
-	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionPick) },
-	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionUse) }
-};
-
-static const FixedTextActionEntry fixedTextDE_Actions[] = {
-	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionOpen) },
-	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionClose) },
-	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionMove) },
-	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionPick) },
-	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionUse) }
-};
-
-static const FixedTextActionEntry fixedTextES_Actions[] = {
-	{ FIXEDTEXT_ENTRY(fixedTextES_ActionOpen) },
-	{ FIXEDTEXT_ENTRY(fixedTextES_ActionClose) },
-	{ FIXEDTEXT_ENTRY(fixedTextES_ActionMove) },
-	{ FIXEDTEXT_ENTRY(fixedTextES_ActionPick) },
-	{ FIXEDTEXT_ENTRY(fixedTextES_ActionUse) }
-};
-
-// =========================================
-
-// TODO:
-// It seems there was a French version of Sherlock Holmes 2
-static const FixedTextLanguageEntry fixedTextLanguages[] = {
-	{ Common::DE_DEU,   fixedTextDE, fixedTextDE_Actions },
-	{ Common::ES_ESP,   fixedTextES, fixedTextES_Actions },
-	{ Common::EN_ANY,   fixedTextEN, fixedTextEN_Actions },
-	{ Common::UNK_LANG, fixedTextEN, fixedTextEN_Actions }
-};
-
-// =========================================
-
-// =========================================
-
-// TODO: split this class up into 2 classes. One for each Sherlock Holmes game
-// We definitely do not want to share fixed text between both, simply because translations may not be the same
-FixedText::FixedText(SherlockEngine *vm) : _vm(vm) {
-	// Figure out which fixed texts to use
-	Common::Language curLanguage = _vm->getLanguage();
-
-	const FixedTextLanguageEntry *curLanguageEntry = fixedTextLanguages;
-
-	while (curLanguageEntry->language != Common::UNK_LANG) {
-		if (curLanguageEntry->language == curLanguage)
-			break; // found current language
-		curLanguageEntry++;
-	}
-	_curLanguageEntry = curLanguageEntry;
+FixedText *FixedText::init(SherlockEngine *vm) {
+	if (vm->getGameID() == GType_SerratedScalpel)
+		return new Scalpel::ScalpelFixedText(vm);
+	else
+		return new Tattoo::TattooFixedText(vm);
 }
 
-const Common::String FixedText::getText(FixedTextId fixedTextId) {
-	return Common::String(_curLanguageEntry->fixedTextArray[fixedTextId]);
-}
-
-const Common::String FixedText::getActionMessage(FixedTextActionId actionId, int messageIndex) {
-	assert(actionId >= 0);
-	assert(messageIndex >= 0);
-	const FixedTextActionEntry *curActionEntry = &_curLanguageEntry->actionArray[actionId];
-
-	assert(messageIndex < curActionEntry->fixedTextArrayCount);
-	return Common::String(curActionEntry->fixedTextArray[messageIndex]);
-}
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/fixed_text.h b/engines/sherlock/fixed_text.h
index 50b0d5b..dcc1d69 100644
--- a/engines/sherlock/fixed_text.h
+++ b/engines/sherlock/fixed_text.h
@@ -28,54 +28,6 @@
 
 namespace Sherlock {
 
-enum FixedTextId {
-	// Window buttons
-	kFixedText_Window_Exit = 0,
-	kFixedText_Window_Up,
-	kFixedText_Window_Down,
-	// Inventory buttons
-	kFixedText_Inventory_Exit,
-	kFixedText_Inventory_Look,
-	kFixedText_Inventory_Use,
-	kFixedText_Inventory_Give,
-	// Journal text
-	kFixedText_Journal_WatsonsJournal,
-	kFixedText_Journal_Page,
-	// Journal buttons
-	kFixedText_Journal_Exit,
-	kFixedText_Journal_Back10,
-	kFixedText_Journal_Up,
-	kFixedText_Journal_Down,
-	kFixedText_Journal_Ahead10,
-	kFixedText_Journal_Search,
-	kFixedText_Journal_FirstPage,
-	kFixedText_Journal_LastPage,
-	kFixedText_Journal_PrintText,
-	// Journal search
-	kFixedText_JournalSearch_Exit,
-	kFixedText_JournalSearch_Backward,
-	kFixedText_JournalSearch_Forward,
-	kFixedText_JournalSearch_NotFound,
-	// Initial inventory
-	kFixedText_InitInventory_Message,
-	kFixedText_InitInventory_HolmesCard,
-	kFixedText_InitInventory_Tickets,
-	kFixedText_InitInventory_CuffLink,
-	kFixedText_InitInventory_WireHook,
-	kFixedText_InitInventory_Note,
-	kFixedText_InitInventory_OpenWatch,
-	kFixedText_InitInventory_Paper,
-	kFixedText_InitInventory_Letter,
-	kFixedText_InitInventory_Tarot,
-	kFixedText_InitInventory_OrnateKey,
-	kFixedText_InitInventory_PawnTicket,
-	// Verbs
-	kFixedText_Verb_Open,
-	kFixedText_Verb_Look,
-	kFixedText_Verb_Talk,
-	kFixedText_Verb_Journal
-};
-
 enum FixedTextActionId {
 	kFixedTextAction_Invalid = -1,
 	kFixedTextAction_Open = 0,
@@ -85,33 +37,26 @@ enum FixedTextActionId {
 	kFixedTextAction_Use
 };
 
-struct FixedTextActionEntry {
-	const char *const *fixedTextArray;
-	int   fixedTextArrayCount;
-};
-
-struct FixedTextLanguageEntry {
-	Common::Language language;
-	const char *const *fixedTextArray;
-	const FixedTextActionEntry *actionArray;
-};
+class SherlockEngine;
 
 class FixedText {
-private:
+protected:
 	SherlockEngine *_vm;
 
-	const FixedTextLanguageEntry *_curLanguageEntry;
-
+	FixedText(SherlockEngine *vm) : _vm(vm) {}
 public:
-	FixedText(SherlockEngine *vm);
-	~FixedText() {}
+	static FixedText *init(SherlockEngine *vm);
+	virtual ~FixedText() {}
 
 	/**
-	 * Gets hardcoded text
+	 * Gets text
 	 */
-	const Common::String getText(FixedTextId fixedTextId);
+	virtual const Common::String getText(int fixedTextId) = 0;
 
-	const Common::String getActionMessage(FixedTextActionId actionId, int messageIndex);
+	/**
+	 * Get action message
+	 */
+	virtual const Common::String getActionMessage(FixedTextActionId actionId, int messageIndex) = 0;
 };
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 77b63d1..ec912af 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -22,6 +22,7 @@
 
 #include "sherlock/journal.h"
 #include "sherlock/scalpel/scalpel.h"
+#include "sherlock/scalpel/scalpel_fixed_text.h"
 #include "sherlock/scalpel/scalpel_journal.h"
 #include "sherlock/tattoo/tattoo.h"
 #include "sherlock/tattoo/tattoo_journal.h"
@@ -197,7 +198,7 @@ bool Journal::drawJournal(int direction, int howFar) {
 		drawFrame();
 	}
 
-	Common::String fixedText_Page = fixedText.getText(kFixedText_Journal_Page);
+	Common::String fixedText_Page = IS_SERRATED_SCALPEL ? fixedText.getText(Scalpel::kFixedText_Journal_Page) : "TODO";
 
 	screen.gPrint(Common::Point(235, 21), COL_PEN_COLOR, fixedText_Page.c_str(), _page);
 
diff --git a/engines/sherlock/module.mk b/engines/sherlock/module.mk
index 6e573ab..2a5cff6 100644
--- a/engines/sherlock/module.mk
+++ b/engines/sherlock/module.mk
@@ -8,6 +8,7 @@ MODULE_OBJS = \
 	scalpel/drivers/mt32.o \
 	scalpel/tsage/logo.o \
 	scalpel/tsage/resources.o \
+	scalpel/scalpel_fixed_text.o \
 	scalpel/scalpel_inventory.o \
 	scalpel/scalpel_journal.o \
 	scalpel/scalpel_map.o \
@@ -20,6 +21,7 @@ MODULE_OBJS = \
 	scalpel/settings.o \
 	tattoo/drivers/tattoo_adlib.o \
 	tattoo/tattoo.o \
+	tattoo/tattoo_fixed_text.o \
 	tattoo/tattoo_journal.o \
 	tattoo/tattoo_map.o \
 	tattoo/tattoo_people.o \
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index faead3b..586978e 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -22,6 +22,7 @@
 
 #include "engines/util.h"
 #include "sherlock/scalpel/scalpel.h"
+#include "sherlock/scalpel/scalpel_fixed_text.h"
 #include "sherlock/scalpel/scalpel_map.h"
 #include "sherlock/scalpel/scalpel_people.h"
 #include "sherlock/scalpel/scalpel_scene.h"
@@ -868,7 +869,7 @@ bool ScalpelEngine::showOfficeCutscene3DO() {
 }
 
 void ScalpelEngine::loadInventory() {
-	FixedText &fixedText = *_fixedText;
+	ScalpelFixedText &fixedText = *(ScalpelFixedText *)_fixedText;
 	Inventory &inv = *_inventory;
 
 	Common::String fixedText_Message    = fixedText.getText(kFixedText_InitInventory_Message);
diff --git a/engines/sherlock/scalpel/scalpel_fixed_text.cpp b/engines/sherlock/scalpel/scalpel_fixed_text.cpp
new file mode 100644
index 0000000..dc15578
--- /dev/null
+++ b/engines/sherlock/scalpel/scalpel_fixed_text.cpp
@@ -0,0 +1,377 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "sherlock/scalpel/scalpel_fixed_text.h"
+#include "sherlock/sherlock.h"
+
+namespace Sherlock {
+
+namespace Scalpel {
+
+static const char *const fixedTextEN[] = {
+	// SH1: Window buttons
+	"Exit",
+	"Up",
+	"Down",
+	// SH1: Inventory buttons
+	"Exit",
+	"Look",
+	"Use",
+	"Give",
+	// SH1: Journal text
+	"Watson's Journal",
+	"Page %d",
+	// SH1: Journal buttons
+	"Exit",
+	"Back 10",
+	"Up",
+	"Down",
+	"Ahead 10",
+	"Search",
+	"First Page",
+	"Last Page",
+	"Print Text",
+	// SH1: Journal search
+	"Exit",
+	"Backward",
+	"Forward",
+	"Text Not Found !",
+	// SH1: Initial Inventory
+	"A message requesting help",
+	"A number of business cards",
+	"Opera Tickets",
+	"Cuff Link",
+	"Wire Hook",
+	"Note",
+	"An open pocket watch",
+	"A piece of paper with numbers on it",
+	"A letter folded many times",
+	"Tarot Cards",
+	"An ornate key",
+	"A pawn ticket",
+	// SH2: Verbs
+	"Open",
+	"Look",
+	"Talk",
+	"Journal"
+};
+
+// sharp-s       : 0xE1 / octal 341
+// small a-umlaut: 0x84 / octal 204
+// small o-umlaut: 0x94 / octal 224
+// small u-umlaut: 0x81 / octal 201
+static const char *const fixedTextDE[] = {
+	// SH1: Window buttons
+	"Zur\201ck",
+	"Hoch",
+	"Runter",
+	// SH1: Inventory buttons
+	"Zur\201ck",
+	"Schau",
+	"Benutze",
+	"Gib",
+	// SH1: Journal text
+	"Watsons Tagebuch",
+	"Seite %d",
+	// SH1: Journal buttons
+	"Zur\201ck",
+	"10 hoch",
+	"Hoch",
+	"Runter",
+	"10 runter",
+	"Suche",
+	"Erste Seite",
+	"Letzte Seite",
+	"Drucke Text",
+	// SH1: Journal search
+	"Zur\201ck",
+	"R\201ckw\204rts", // original: "Backward"
+	"Vorw\204rts", // original: "Forward"
+	"Text nicht gefunden!",
+	// SH1: Initial Inventory
+	"Ein Hilferuf von Lestrade",
+	"Holmes' Visitenkarten",
+	"Karten f\201rs Opernhaus",
+	"Manschettenkn\224pfe",
+	"Zum Haken verbogener Drahtkorb",
+	"Mitteilung am Epstein",
+	"Eine offene Taschenuhr",
+	"Ein Zettel mit Zahlen drauf",
+	"Ein mehrfach gefalteter Briefbogen",
+	"Ein Tarock-Kartenspiel", // [sic]
+	"Ein verzierter Schl\201ssel",
+	"Ein Pfandschein",
+	// SH2: Verbs
+	"\231ffne",
+	"Schau",
+	"Rede",
+	"Tagebuch"
+};
+
+// up-side down exclamation mark - 0xAD / octal 255
+// up-side down question mark - 0xA8 / octal 250
+// n with a wave on top - 0xA4 / octal 244
+static const char *const fixedTextES[] = {
+	// SH1: Window buttons
+	"Exit",
+	"Subir",
+	"Bajar",
+	// SH1: Inventory buttons
+	"Exit",
+	"Mirar",
+	"Usar",
+	"Dar",
+	// SH1: Journal text
+	"Diario de Watson",
+	"Pagina %d",
+	// SH1: Journal buttons
+	"Exit",
+	"Retroceder",
+	"Subir",
+	"baJar",
+	"Adelante",
+	"Buscar",
+	"1a pagina",
+	"Ult pagina",
+	"Imprimir",
+	// SH1: Journal search
+	"Exit",
+	"Retroceder",
+	"Avanzar",
+	"Texto no encontrado!",
+	// SH1: Initial Inventory
+	"Un mensaje solicitando ayuda",
+	"Unas cuantas tarjetas de visita",
+	"Entradas para la opera",
+	"Unos gemelos",
+	"Un gancho de alambre",
+	"Una nota",
+	"Un reloj de bolsillo abierto",
+	"Un trozo de papel con unos numeros",
+	"Un carta muy plegada",
+	"Unas cartas de Tarot",
+	"Una llave muy vistosa",
+	"Una papeleta de empe\244o",
+};
+
+// =========================================
+
+// === Sherlock Holmes 1: Serrated Scalpel ===
+static const char *const fixedTextEN_ActionOpen[] = {
+	"This cannot be opened",
+	"It is already open",
+	"It is locked",
+	"Wait for Watson",
+	" ",
+	"."
+};
+
+static const char *const fixedTextDE_ActionOpen[] = {
+	"Das kann man nicht \224ffnen",
+	"Ist doch schon offen!",
+	"Leider verschlossen",
+	"Warte auf Watson",
+	" ",
+	"."
+};
+
+static const char *const fixedTextES_ActionOpen[] = {
+	"No puede ser abierto",
+	"Ya esta abierto",
+	"Esta cerrado",
+	"Espera a Watson",
+	" ",
+	"."
+};
+
+static const char *const fixedTextEN_ActionClose[] = {
+	"This cannot be closed",
+	"It is already closed",
+	"The safe door is in the way"
+};
+
+static const char *const fixedTextDE_ActionClose[] = {
+	"Das kann man nicht schlie\341en",
+	"Ist doch schon zu!",
+	"Die safet\201r ist Weg"
+};
+
+static const char *const fixedTextES_ActionClose[] = {
+	"No puede ser cerrado",
+	"Ya esta cerrado",
+	"La puerta de seguridad esta entre medias"
+};
+
+static const char *const fixedTextEN_ActionMove[] = {
+	"This cannot be moved",
+	"It is bolted to the floor",
+	"It is too heavy",
+	"The other crate is in the way"
+};
+
+
+static const char *const fixedTextDE_ActionMove[] = {
+	"L\204\341t sich nicht bewegen",
+	"Festged\201belt in der Erde...",
+	"Oha, VIEL zu schwer",
+	"Der andere Kiste ist im Weg" // [sic]
+};
+
+static const char *const fixedTextES_ActionMove[] = {
+	"No puede moverse",
+	"Esta sujeto a la pared",
+	"Es demasiado pesado",
+	"El otro cajon esta en mitad"
+};
+
+static const char *const fixedTextEN_ActionPick[] = {
+	"Nothing of interest here",
+	"It is bolted down",
+	"It is too big to carry",
+	"It is too heavy",
+	"I think a girl would be more your type",
+	"Those flowers belong to Penny",
+	"She's far too young for you!",
+	"I think a girl would be more your type!",
+	"Government property for official use only"
+};
+
+static const char *const fixedTextDE_ActionPick[] = {
+	"Nichts Interessantes da",
+	"Zu gut befestigt",
+	"Ist ja wohl ein bi\341chen zu gro\341, oder ?",
+	"Oha, VIEL zu schwer",
+	"Ich denke, Du stehst mehr auf M\204dchen ?",
+	"Diese Blumen geh\224ren Penny",
+	"Sie ist doch viel zu jung f\201r Dich!",
+	"Ich denke, Du stehst mehr auf M\204dchen ?",
+	"Staatseigentum - Nur für den Dienstgebrauch !"
+};
+
+static const char *const fixedTextES_ActionPick[] = {
+	"No hay nada interesante",
+	"Esta anclado al suelo",
+	"Es muy grande para llevarlo",
+	"Pesa demasiado",
+	"Creo que una chica sera mas tu tipo",
+	"Esas flores pertenecen a Penny",
+	"\255Es demasiado joven para ti!"
+	"\255Creo que una chica sera mas tu tipo!",
+	"Propiedad del gobierno para uso oficial"
+};
+
+static const char *const fixedTextEN_ActionUse[] = {
+	"You can't do that",
+	"It had no effect",
+	"You can't reach it",
+	"OK, the door looks bigger! Happy?"
+	"Doors don't smoke"
+};
+
+static const char *const fixedTextDE_ActionUse[] = {
+	"Nein, das geht wirklich nicht",
+	"Tja keinerlei Wirkung",
+	"Da kommst du nicht dran",
+	"Na gut, die Tür sieht jetzt gr\224\341er aus. Zufrieden?"
+	"Türen sind Nichtraucher!"
+};
+
+static const char *const fixedTextES_ActionUse[] = {
+	"No puedes hacerlo",
+	"No tuvo ningun efecto",
+	"No puedes alcanzarlo",
+	"Bien, \255es enorme! \250Feliz?"
+	"Las puertas no fuman"
+};
+
+#define FIXEDTEXT_GETCOUNT(_name_) sizeof(_name_) / sizeof(byte *)
+#define FIXEDTEXT_ENTRY(_name_)    _name_, FIXEDTEXT_GETCOUNT(_name_)
+
+static const FixedTextActionEntry fixedTextEN_Actions[] = {
+	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionOpen) },
+	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionClose) },
+	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionMove) },
+	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionPick) },
+	{ FIXEDTEXT_ENTRY(fixedTextEN_ActionUse) }
+};
+
+static const FixedTextActionEntry fixedTextDE_Actions[] = {
+	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionOpen) },
+	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionClose) },
+	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionMove) },
+	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionPick) },
+	{ FIXEDTEXT_ENTRY(fixedTextDE_ActionUse) }
+};
+
+static const FixedTextActionEntry fixedTextES_Actions[] = {
+	{ FIXEDTEXT_ENTRY(fixedTextES_ActionOpen) },
+	{ FIXEDTEXT_ENTRY(fixedTextES_ActionClose) },
+	{ FIXEDTEXT_ENTRY(fixedTextES_ActionMove) },
+	{ FIXEDTEXT_ENTRY(fixedTextES_ActionPick) },
+	{ FIXEDTEXT_ENTRY(fixedTextES_ActionUse) }
+};
+
+// =========================================
+
+// TODO:
+// It seems there was a French version of Sherlock Holmes 2
+static const FixedTextLanguageEntry fixedTextLanguages[] = {
+	{ Common::DE_DEU,   fixedTextDE, fixedTextDE_Actions },
+	{ Common::ES_ESP,   fixedTextES, fixedTextES_Actions },
+	{ Common::EN_ANY,   fixedTextEN, fixedTextEN_Actions },
+	{ Common::UNK_LANG, fixedTextEN, fixedTextEN_Actions }
+};
+
+// =========================================
+
+// =========================================
+
+ScalpelFixedText::ScalpelFixedText(SherlockEngine *vm) : FixedText(vm) {
+	// Figure out which fixed texts to use
+	Common::Language curLanguage = _vm->getLanguage();
+
+	const FixedTextLanguageEntry *curLanguageEntry = fixedTextLanguages;
+
+	while (curLanguageEntry->language != Common::UNK_LANG) {
+		if (curLanguageEntry->language == curLanguage)
+			break; // found current language
+		curLanguageEntry++;
+	}
+	_curLanguageEntry = curLanguageEntry;
+}
+
+const Common::String ScalpelFixedText::getText(int fixedTextId) {
+	return Common::String(_curLanguageEntry->fixedTextArray[fixedTextId]);
+}
+
+const Common::String ScalpelFixedText::getActionMessage(FixedTextActionId actionId, int messageIndex) {
+	assert(actionId >= 0);
+	assert(messageIndex >= 0);
+	const FixedTextActionEntry *curActionEntry = &_curLanguageEntry->actionArray[actionId];
+
+	assert(messageIndex < curActionEntry->fixedTextArrayCount);
+	return Common::String(curActionEntry->fixedTextArray[messageIndex]);
+}
+
+} // End of namespace Scalpel
+
+} // End of namespace Sherlock
diff --git a/engines/sherlock/scalpel/scalpel_fixed_text.h b/engines/sherlock/scalpel/scalpel_fixed_text.h
new file mode 100644
index 0000000..de4c55d
--- /dev/null
+++ b/engines/sherlock/scalpel/scalpel_fixed_text.h
@@ -0,0 +1,108 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef SHERLOCK_SCALPEL_FIXED_TEXT_H
+#define SHERLOCK_SCALPEL_FIXED_TEXT_H
+
+#include "sherlock/fixed_text.h"
+
+namespace Sherlock {
+
+namespace Scalpel {
+
+enum FixedTextId {
+	// Window buttons
+	kFixedText_Window_Exit = 0,
+	kFixedText_Window_Up,
+	kFixedText_Window_Down,
+	// Inventory buttons
+	kFixedText_Inventory_Exit,
+	kFixedText_Inventory_Look,
+	kFixedText_Inventory_Use,
+	kFixedText_Inventory_Give,
+	// Journal text
+	kFixedText_Journal_WatsonsJournal,
+	kFixedText_Journal_Page,
+	// Journal buttons
+	kFixedText_Journal_Exit,
+	kFixedText_Journal_Back10,
+	kFixedText_Journal_Up,
+	kFixedText_Journal_Down,
+	kFixedText_Journal_Ahead10,
+	kFixedText_Journal_Search,
+	kFixedText_Journal_FirstPage,
+	kFixedText_Journal_LastPage,
+	kFixedText_Journal_PrintText,
+	// Journal search
+	kFixedText_JournalSearch_Exit,
+	kFixedText_JournalSearch_Backward,
+	kFixedText_JournalSearch_Forward,
+	kFixedText_JournalSearch_NotFound,
+	// Initial inventory
+	kFixedText_InitInventory_Message,
+	kFixedText_InitInventory_HolmesCard,
+	kFixedText_InitInventory_Tickets,
+	kFixedText_InitInventory_CuffLink,
+	kFixedText_InitInventory_WireHook,
+	kFixedText_InitInventory_Note,
+	kFixedText_InitInventory_OpenWatch,
+	kFixedText_InitInventory_Paper,
+	kFixedText_InitInventory_Letter,
+	kFixedText_InitInventory_Tarot,
+	kFixedText_InitInventory_OrnateKey,
+	kFixedText_InitInventory_PawnTicket,
+};
+
+struct FixedTextActionEntry {
+	const char *const *fixedTextArray;
+	int   fixedTextArrayCount;
+};
+
+struct FixedTextLanguageEntry {
+	Common::Language language;
+	const char *const *fixedTextArray;
+	const FixedTextActionEntry *actionArray;
+};
+
+class ScalpelFixedText: public FixedText {
+private:
+	const FixedTextLanguageEntry *_curLanguageEntry;
+public:
+	ScalpelFixedText(SherlockEngine *vm);
+	virtual ~ScalpelFixedText() {}
+
+	/**
+	 * Gets text
+	 */
+	virtual const Common::String getText(int fixedTextId);
+
+	/**
+	 * Get action message
+	 */
+	virtual const Common::String getActionMessage(FixedTextActionId actionId, int messageIndex);
+};
+
+} // End of namespace Scalpel
+
+} // End of namespace Sherlock
+
+#endif
diff --git a/engines/sherlock/scalpel/scalpel_inventory.cpp b/engines/sherlock/scalpel/scalpel_inventory.cpp
index bf12a16..5744ba9 100644
--- a/engines/sherlock/scalpel/scalpel_inventory.cpp
+++ b/engines/sherlock/scalpel/scalpel_inventory.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "sherlock/scalpel/scalpel_inventory.h"
+#include "sherlock/scalpel/scalpel_fixed_text.h"
 #include "sherlock/scalpel/scalpel_screen.h"
 #include "sherlock/scalpel/scalpel_user_interface.h"
 #include "sherlock/scalpel/scalpel.h"
diff --git a/engines/sherlock/scalpel/scalpel_journal.cpp b/engines/sherlock/scalpel/scalpel_journal.cpp
index 8bb74e9..e3421cd 100644
--- a/engines/sherlock/scalpel/scalpel_journal.cpp
+++ b/engines/sherlock/scalpel/scalpel_journal.cpp
@@ -22,6 +22,7 @@
 
 #include "sherlock/journal.h"
 #include "sherlock/sherlock.h"
+#include "sherlock/scalpel/scalpel_fixed_text.h"
 #include "sherlock/scalpel/scalpel_journal.h"
 #include "sherlock/scalpel/scalpel_screen.h"
 #include "sherlock/scalpel/scalpel.h"
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 33d0e4a..2ea3172 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "sherlock/scalpel/scalpel_talk.h"
+#include "sherlock/scalpel/scalpel_fixed_text.h"
 #include "sherlock/scalpel/scalpel_map.h"
 #include "sherlock/scalpel/scalpel_people.h"
 #include "sherlock/scalpel/scalpel_scene.h"
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index 9a07a40..684824c 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "sherlock/scalpel/scalpel_user_interface.h"
+#include "sherlock/scalpel/scalpel_fixed_text.h"
 #include "sherlock/scalpel/scalpel_inventory.h"
 #include "sherlock/scalpel/scalpel_journal.h"
 #include "sherlock/scalpel/scalpel_people.h"
diff --git a/engines/sherlock/sherlock.cpp b/engines/sherlock/sherlock.cpp
index f491023..72101fd 100644
--- a/engines/sherlock/sherlock.cpp
+++ b/engines/sherlock/sherlock.cpp
@@ -95,7 +95,7 @@ void SherlockEngine::initialize() {
 	_animation = new Animation(this);
 	_debugger = new Debugger(this);
 	_events = new Events(this);
-	_fixedText = new FixedText(this);
+	_fixedText = FixedText::init(this);
 	_inventory = Inventory::init(this);
 	_map = Map::init(this);
 	_music = new Music(this, _mixer);
diff --git a/engines/sherlock/tattoo/tattoo_fixed_text.cpp b/engines/sherlock/tattoo/tattoo_fixed_text.cpp
new file mode 100644
index 0000000..ec0c8ca
--- /dev/null
+++ b/engines/sherlock/tattoo/tattoo_fixed_text.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "sherlock/tattoo/tattoo_fixed_text.h"
+#include "sherlock/sherlock.h"
+
+namespace Sherlock {
+
+namespace Tattoo {
+
+static const char *const FIXED_TEXT_ENGLISH[] = {
+	"Open",
+	"Look",
+	"Talk",
+	"Journal"
+};
+
+TattooFixedText::TattooFixedText(SherlockEngine *vm) : FixedText(vm) {
+}
+
+const Common::String TattooFixedText::getText(int fixedTextId) {
+	return Common::String(FIXED_TEXT_ENGLISH[fixedTextId]);
+}
+
+const Common::String TattooFixedText::getActionMessage(FixedTextActionId actionId, int messageIndex) {
+	return Common::String();
+}
+
+
+} // End of namespace Tattoo
+
+} // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/tattoo_fixed_text.h b/engines/sherlock/tattoo/tattoo_fixed_text.h
new file mode 100644
index 0000000..1ac75aa
--- /dev/null
+++ b/engines/sherlock/tattoo/tattoo_fixed_text.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef SHERLOCK_TATTOO_FIXED_TEXT_H
+#define SHERLOCK_TATTOO_FIXED_TEXT_H
+
+#include "sherlock/fixed_text.h"
+
+namespace Sherlock {
+
+namespace Tattoo {
+
+enum FixedTextId {
+	kFixedText_Open,
+	kFixedText_Look,
+	kFixedText_Talk,
+	kFixedText_Journal
+};
+
+class TattooFixedText: public FixedText {
+private:
+public:
+	TattooFixedText(SherlockEngine *vm);
+	virtual ~TattooFixedText() {}
+
+	/**
+	 * Gets text
+	 */
+	virtual const Common::String getText(int fixedTextId);
+
+	/**
+	 * Get action message
+	 */
+	virtual const Common::String getActionMessage(FixedTextActionId actionId, int messageIndex);
+};
+
+} // End of namespace Scalpel
+
+} // End of namespace Sherlock
+
+#endif
diff --git a/engines/sherlock/tattoo/widget_verbs.cpp b/engines/sherlock/tattoo/widget_verbs.cpp
index 9cf4794..a56b151 100644
--- a/engines/sherlock/tattoo/widget_verbs.cpp
+++ b/engines/sherlock/tattoo/widget_verbs.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "sherlock/tattoo/widget_verbs.h"
+#include "sherlock/tattoo/tattoo_fixed_text.h"
 #include "sherlock/tattoo/tattoo_scene.h"
 #include "sherlock/tattoo/tattoo_user_interface.h"
 #include "sherlock/tattoo/tattoo_people.h"
@@ -41,9 +42,9 @@ void WidgetVerbs::activateVerbMenu(bool objectsOn) {
 	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
 	TattooPeople &people = *(TattooPeople *)_vm->_people;
 	bool isWatson = false;
-	Common::String strLook = fixedText.getText(kFixedText_Verb_Look);
-	Common::String strTalk = fixedText.getText(kFixedText_Verb_Talk);
-	Common::String strJournal = fixedText.getText(kFixedText_Verb_Journal);
+	Common::String strLook = fixedText.getText(kFixedText_Look);
+	Common::String strTalk = fixedText.getText(kFixedText_Talk);
+	Common::String strJournal = fixedText.getText(kFixedText_Journal);
 
 	if (talk._talkToAbort)
 		return;
@@ -108,9 +109,9 @@ void WidgetVerbs::execute() {
 	Common::Point scenePos = mousePos + ui._currentScroll;
 	bool noDesc = false;
 
-	Common::String strLook = fixedText.getText(kFixedText_Verb_Look);
-	Common::String strTalk = fixedText.getText(kFixedText_Verb_Talk);
-	Common::String strJournal = fixedText.getText(kFixedText_Verb_Journal);
+	Common::String strLook = fixedText.getText(kFixedText_Look);
+	Common::String strTalk = fixedText.getText(kFixedText_Talk);
+	Common::String strJournal = fixedText.getText(kFixedText_Journal);
 
 	checkTabbingKeys(_verbCommands.size());
 






More information about the Scummvm-git-logs mailing list