1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "sherlock/sherlock.h"
24 #include "sherlock/fixed_text.h"
25 #include "sherlock/scalpel/scalpel_fixed_text.h"
26 #include "sherlock/tattoo/tattoo_fixed_text.h"
27 
28 namespace Sherlock {
29 
30 static const char *const fixedJournalTextEN[] = {
31 	// Holmes asked/said...
32 	"Holmes asked me, ",
33 	"Holmes asked the Inspector, ",
34 	"Holmes asked %s, ",
35 	"Holmes said to me, ",
36 	"Holmes said to the Inspector, ",
37 	"Holmes said to %s, ",
38 	// I asked/said...
39 	"I replied, ",
40 	"The reply was, ",
41 	// Holmes/I/The Inspector/Person asked/said (without "Then" prefix)
42 	"Holmes asked, ",
43 	"Holmes said, ",
44 	"I asked, ",
45 	"I said, ",
46 	"The Inspector asked, ",
47 	"The Inspector said, ",
48 	"%s asked, ",
49 	"%s said, ",
50 	// Then Holmes/I/The Inspector/Person asked/said
51 	"Then Holmes asked, ",
52 	"Then Holmes said, ",
53 	"Then I asked, ",
54 	"Then I said, ",
55 	"Then the Inspector asked, ",
56 	"Then the Inspector said, ",
57 	"Then %s asked, ",
58 	"Then %s said, "
59 };
60 
61 static const char *const fixedJournalTextDE[] = {
62 	// Holmes asked/said...
63 	"Holmes fragte mich, ",
64 	"Holmes fragte Inspektor Lestrade, ",
65 	"Holmes fragte %s, ",
66 	"Holmes sagte mir, ",
67 	"Holmes sagte Inspektor Lestrade, ",
68 	"Holmes sagte %s, ",
69 	// I asked/said...
70 	"Ich antwortete, ",
71 	"Die Antwort lautete, ",
72 	// Holmes/I/The Inspector/Person asked/said (without "Then" prefix)
73 	"Holmes fragte, ", // original: "fragte Holmes"
74 	"Holmes sagte, ", // original: "sagte Holmes"
75 	"Ich fragte, ", // original: "fragte Ich"
76 	"Ich sagte, ", // original: "sagte Ich"
77 	"Der Inspektor fragte, ",
78 	"Der Inspektor sagte, ",
79 	"%s fragte, ",
80 	"%s sagte, ",
81 	// Then Holmes/I/The Inspector/Person asked/said
82 	"Dann fragte Holmes, ",
83 	"Dann sagte Holmes, ",
84 	"Dann fragte ich, ", // original: "Dann sagte Ich"
85 	"Dann sagte ich, ", // original: "Dann sagte Ich"
86 	"Dann fragte der Inspektor, ",
87 	"Dann sagte der Inspektor, ",
88 	"Dann fragte %s, ",
89 	"Dann sagte %s, "
90 };
91 
92 // Only used for Sherlock Holmes 2, so special characters should use the SH2 charset
93 // small a w/ accent grave: 0x85 / octal 205
94 // small e w/ accent acute: 0x82 / octal 202
95 // small e w/ accent grave: 0x8A / octal 212
96 // small e w/ circonflexe:  0x88 / octal 210
97 // small cedilla:           0x87 / octal 207
98 static const char *const fixedJournalTextFR[] = {
99 	// Holmes asked/said...
100 	"Holmes me demanda, ", // original: "Holmes m'a demand\202, "
101 	"Holmes demanda \205 l'inspecteur, ", // original: "Holmes a demand\202 \205 l'inspecteur, "
102 	"Holmes demanda \205 %s, ", // original: "Holmes a demand\202 \205 %s, "
103 	"Holmes me dit, ", // original: "Holmes m'a dit, "
104 	"Holmes dit \205 l'inspecteur, ", // original: "Holmes a dit \205 l'inspecteur, "
105 	"Holmes dit \205 %s, ", // original: "Holmes a dit \205 %s, "
106 	// I asked/said...
107 	"Je r\202pondis, ", // original: "J'ai r\202pondu, ",
108 	"La r\202ponse fut, ",
109 	// Holmes/I/The Inspector/Person asked/said (without "Then" prefix)
110 	"Holmes demanda, ", // original: "Holmes a demand\202, "
111 	"Holmes dit, ",
112 	"Je demandai, ", // original: "J'ai demand\202, "
113 	"Je dis, ", // original: "J'ai dit, "
114 	"L'inspecteur demanda, ", // original: ""L'inspecteur a demand\202, "
115 	"L'inspecteur dit, ",
116 	"%s demanda, ", // original: "%s a demand\202, "
117 	"%s dit, ",
118 	// Then Holmes/I/The Inspector/Person asked/said
119 	"Alors Holmes demanda, ", // original: it seems "puis"/"then" was not used/removed. They instead added a space character, so sentences looked weird
120 	"Alors Holmes dit, ",
121 	"Alors je demandai, ",
122 	"Alors je dis, ",
123 	"Alors l'inspecteur demanda, ",
124 	"Alors l'inspecteur dit, ",
125 	"Alors %s demanda, ",
126 	"Alors %s dit, "
127 };
128 
129 // Sherlock Holmes 1+2:
130 // small e w/ accent bottom to top : 0x82 / octal 202
131 // big   E w/ accent bottom to top : 0x90 / octal 220
132 // small a w/ accent bottom to top : 0xA0 / octal 240
133 // small i w/ accent bottom to top : 0xA1 / octal 241
134 // small o w/ accent bottom to top : 0xA2 / octal 242
135 // small u w/ accent bottom to top : 0xA3 / octal 243
136 // small n w/ wavy line            : 0xA4 / octal 244
137 // big   N w/ wavy line            : 0xA5 / octal 245
138 // small a w/ under line           : 0xA6 / octal 246
139 // small o w/ under line           : 0xA7 / octal 247
140 // inverted question mark          : 0xA8 / octal 250
141 static const char *const fixedJournalTextES[] = {
142 	// Holmes asked/said...
143 	"Holmes me pregunt\242, ", // original: "Holmes me pidi\242, ",
144 	"Holmes pregunt\242 al Inspector, ", // original: "el inspector"?
145 	"Holmes pregunt\242 %s, ",
146 	"Holmes me dijo, ",
147 	"Holmes dijo al Inspector, ", // original: "el inspector"?
148 	"Holmes dijo a %s, ", // original: "Holmes dijo a %s, "
149 	// I asked/said...
150 	"Yo content\202, ", // original: "Yo respond\241, ",
151 	"La respuesta fue, ",
152 	// Holmes/I/The Inspector/Person asked/said (without "Then" prefix)
153 	"Holmes pregunt\242, ",
154 	"Holmes dijo, ",
155 	"Yo pregunt\202, ", // original: "Yo pregunt\242, ",
156 	"Yo dije, ",
157 	"El Inspector pregunt\242, ",
158 	"El Inspector dijo, ",
159 	"%s pregunt\242, ",
160 	"%s dijo, ",
161 	// Then Holmes/I/The Inspector/Person asked/said
162 	"Despu\202s Holmes pregunt\242, ", // original: added "Entonces" instead of "Despues"
163 	"Despu\202s Holmes dijo, ",
164 	"Despu\202s yo pregunt\202, ", // "pregunt\242, "
165 	"Despu\202s yo dije, ",
166 	"Despu\202s el Inspector pregunt\242, ",
167 	"Despu\202s el Inspector dijo, ",
168 	"Despu\202s %s pregunt\242, ",
169 	"Despu\202s %s dijo, "
170 };
171 
FixedText(SherlockEngine * vm)172 FixedText::FixedText(SherlockEngine *vm)  {
173 	_vm = vm;
174 
175 	// Figure out which fixed texts to use
176 	Common::Language curLanguage = _vm->getLanguage();
177 
178 	switch (curLanguage) {
179 	case Common::EN_ANY:
180 		// Used by Sherlock Holmes 1+2
181 		_fixedJournalTextArray = fixedJournalTextEN;
182 		_fixedObjectPickedUpText = "Picked up %s";
183 		break;
184 	case Common::DE_DEU:
185 		// Used by Sherlock Holmes 1+2
186 		_fixedJournalTextArray = fixedJournalTextDE;
187 		_fixedObjectPickedUpText = "%s eingesteckt";
188 		break;
189 	case Common::FR_FRA:
190 		// Used by Sherlock Holmes 2
191 		_fixedJournalTextArray = fixedJournalTextFR;
192 		_fixedObjectPickedUpText = ""; // Not used, because there is no French Sherlock Holmes 1
193 		break;
194 	case Common::ES_ESP:
195 		// Used by Sherlock Holmes 1+2
196 		_fixedJournalTextArray = fixedJournalTextES;
197 		_fixedObjectPickedUpText = "Cogido/a %s";
198 		break;
199 	default:
200 		// Default to English
201 		_fixedJournalTextArray = fixedJournalTextEN;
202 		_fixedObjectPickedUpText = "Picked up %s";
203 		break;
204 	}
205 }
206 
init(SherlockEngine * vm)207 FixedText *FixedText::init(SherlockEngine *vm) {
208 	if (vm->getGameID() == GType_SerratedScalpel)
209 		return new Scalpel::ScalpelFixedText(vm);
210 	else
211 		return new Tattoo::TattooFixedText(vm);
212 }
213 
getJournalText(int fixedJournalTextId)214 const char *FixedText::getJournalText(int fixedJournalTextId) {
215 	return _fixedJournalTextArray[fixedJournalTextId];
216 }
217 
getObjectPickedUpText()218 const char *FixedText::getObjectPickedUpText() {
219 	return _fixedObjectPickedUpText;
220 }
221 
222 } // End of namespace Sherlock
223