aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorMartin Kiewitz2015-10-05 23:53:46 +0200
committerMartin Kiewitz2015-10-05 23:53:46 +0200
commit2aaf178dfc7643df3327669f7114a360d8279423 (patch)
tree356b14dc142e585ef5ea5a1a879f51d56fdf1818 /engines/sherlock
parente73a50c6c53bffcf10f044377a72cf754b524bf9 (diff)
downloadscummvm-rg350-2aaf178dfc7643df3327669f7114a360d8279423.tar.gz
scummvm-rg350-2aaf178dfc7643df3327669f7114a360d8279423.tar.bz2
scummvm-rg350-2aaf178dfc7643df3327669f7114a360d8279423.zip
SHERLOCK: SS: Spanish inv. exclam. mark support
Support for spanish inverted exclamation mark Was skipped over in the original interpreter and also wasn't even included in the spanish font We create the character by ourselves and map it accordingly
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/fonts.cpp57
1 files changed, 56 insertions, 1 deletions
diff --git a/engines/sherlock/fonts.cpp b/engines/sherlock/fonts.cpp
index b607891d06..25034f8f6e 100644
--- a/engines/sherlock/fonts.cpp
+++ b/engines/sherlock/fonts.cpp
@@ -62,6 +62,43 @@ void Fonts::setFont(int fontNum) {
// load font data
_font = new ImageFile(fontFilename);
+
+ if (IS_SERRATED_SCALPEL) {
+ if (_vm->getLanguage() == Common::ES_ESP) {
+ if (_fontNumber == 1) {
+ // Create a new character - inverted exclamation mark (0x88)
+ // Seems this wasn't included originally, but some text has it
+ // This was obviously not done in the original game interpreter
+ ImageFrame &frameExclamationMark = (*_font)[0]; // get actual exclamation mark
+ ImageFrame frameRevExclamationMark;
+
+ frameRevExclamationMark._width = frameExclamationMark._width;
+ frameRevExclamationMark._height = frameExclamationMark._height;
+ frameRevExclamationMark._paletteBase = frameExclamationMark._paletteBase;
+ frameRevExclamationMark._rleEncoded = frameExclamationMark._rleEncoded;
+ frameRevExclamationMark._size = frameExclamationMark._size;
+ frameRevExclamationMark._frame.create(frameExclamationMark._width, frameExclamationMark._height, Graphics::PixelFormat::createFormatCLUT8());
+
+ byte *frameExclMarkPixels = (byte *)frameExclamationMark._frame.getPixels();
+ byte *frameRevExclMarkPixels = (byte *)frameRevExclamationMark._frame.getPixels();
+
+ uint16 revExclMarkY = frameExclamationMark._height - 1;
+ frameRevExclMarkPixels += frameExclamationMark._width * (frameExclamationMark._height - 1);
+ for (uint16 exclMarkY = 0; exclMarkY < frameExclamationMark._height; exclMarkY++) {
+ memcpy(frameRevExclMarkPixels, frameExclMarkPixels, frameExclamationMark._width);
+ revExclMarkY--;
+ frameRevExclMarkPixels -= frameExclamationMark._width;
+ frameExclMarkPixels += frameExclamationMark._width;
+ }
+
+ frameRevExclamationMark._offset.x = frameExclamationMark._offset.x;
+ frameRevExclamationMark._offset.y = frameExclamationMark._offset.y + 1;
+
+ _font->push_back(frameRevExclamationMark);
+ }
+ }
+ }
+
} else {
// 3DO
switch (fontNum) {
@@ -81,7 +118,7 @@ void Fonts::setFont(int fontNum) {
}
_charCount = _font->size();
-
+
// Iterate through the frames to find the widest and tallest font characters
_fontHeight = _widestChar = 0;
for (uint idx = 0; idx < _charCount; ++idx) {
@@ -118,6 +155,24 @@ inline byte Fonts::translateChar(byte c) {
return 135; // and this for SH1
default:
if (IS_SERRATED_SCALPEL) {
+ if (_vm->getLanguage() == Common::ES_ESP) {
+ if (_fontNumber == 1) {
+ // Special workarounds for translated game text, which was skipped because of effectively a bug
+ // This was not done in the original interpreter
+ // It seems at least the inverted exclamation mark was skipped by the original interpreter /
+ // wasn't shown at all.
+ // This character is used for example in the alley room, when talking with the inspector after
+ // searching the corpse. "[0xAD]Claro! Mi experiencia profesional revela que esta mujer fue asesinada..."
+ // The same text gets put inside Watson's journal as well and should be on page 10 right after
+ // talking with the inspector. For further study see bug #6931
+ // Inverted question mask was also skipped, but at least that character is inside the font already.
+ if (c == 0xAD) {
+ // inverted exclamation mark
+ return 0x88; // our own font character, created during setFont()
+ }
+ // Inverted question mask is 0x86 (mapped from 0x88)
+ }
+ }
if (c >= 0x80) { // German SH1 version did this, but not German SH2
c--;
}