From 84660f620bc06c79f88ceabc3000a9168513e5a1 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 11 Nov 2006 15:37:03 +0000 Subject: Improve international support in CINE engine. svn-id: r24678 --- engines/cine/cine.cpp | 2 +- engines/cine/cine.h | 3 +- engines/cine/detection.cpp | 6 +- engines/cine/font.cpp | 69 ------- engines/cine/font.h | 39 ---- engines/cine/module.mk | 1 - engines/cine/texte.cpp | 492 ++++++++++++++++++++++++++++++++++++++++++++- engines/cine/texte.h | 16 ++ engines/cine/various.cpp | 165 ++------------- engines/cine/various.h | 2 - 10 files changed, 524 insertions(+), 271 deletions(-) delete mode 100644 engines/cine/font.cpp delete mode 100644 engines/cine/font.h diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 1b094af523..c850f0e4f0 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -115,7 +115,7 @@ static void initialize() { setupOpcodes(); - initLanguage(Common::parseLanguage(ConfMan.get("language"))); + initLanguage(g_cine->getLanguage()); init_video(); textDataPtr = (byte *)malloc(8000); diff --git a/engines/cine/cine.h b/engines/cine/cine.h index bddbfd86b7..3a83dba7e9 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -55,7 +55,8 @@ enum CineGameType { enum CineGameFeatures { GF_CD = 1 << 0, - GF_DEMO = 1 << 1 + GF_DEMO = 1 << 1, + GF_ALT_FONT = 1 << 2 }; struct CINEGameDescription { diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index e3b546daf1..4b8ce8d804 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -223,7 +223,7 @@ static const CINEGameDescription gameDescriptions[] = { Common::kPlatformPC, }, GType_FW, - 0, + GF_ALT_FONT, }, { @@ -236,7 +236,7 @@ static const CINEGameDescription gameDescriptions[] = { Common::kPlatformPC, }, GType_FW, - 0, + GF_ALT_FONT, }, { @@ -275,7 +275,7 @@ static const CINEGameDescription gameDescriptions[] = { Common::kPlatformAmiga, }, GType_FW, - 0, + GF_ALT_FONT, }, { diff --git a/engines/cine/font.cpp b/engines/cine/font.cpp deleted file mode 100644 index 69bac063a8..0000000000 --- a/engines/cine/font.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2006 The ScummVM project - * - * cinE Engine is (C) 2004-2005 by CinE Team - * - * 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. - * - * $URL$ - * $Id$ - * - */ - -#include "common/stdafx.h" -#include "common/scummsys.h" - -#include "cine/font.h" - -namespace Cine { - -const CharacterEntry fontParamTable[256] = { - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, {63, 1}, {69, 5}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {68, 3}, - {64, 3}, {65, 3}, { 0, 0}, { 0, 0}, {62, 2}, {74, 6}, {66, 1}, {67, 6}, - {52, 6}, {53, 6}, {54, 6}, {55, 6}, {56, 6}, {57, 6}, {58, 6}, {59, 6}, - {60, 6}, {61, 6}, {76, 3}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {75, 6}, - { 0, 0}, { 0, 6}, //a - { 1, 6}, { 2, 6}, { 3, 6}, { 4, 6}, { 5, 6}, { 6, 6}, - { 7, 6}, { 8, 3}, { 9, 6}, {10, 6}, {11, 6}, {12, 7}, {13, 6}, {14, 6}, - {15, 6}, {16, 6}, {17, 6}, {18, 6}, {19, 6}, {20, 6}, {21, 6}, {22, 7}, - {23, 6}, {24, 6}, {25, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, {26, 6}, //a - {27, 6}, {28, 5}, {29, 6}, {30, 6}, {31, 5}, {32, 6}, - {33, 6}, {34, 4}, {35, 4}, {36, 5}, {37, 3}, {38, 7}, {39, 6}, {40, 6}, - {41, 6}, {42, 6}, {43, 6}, {44, 6}, {45, 6}, {46, 6}, {47, 6}, {48, 7}, - {49, 6}, {50, 6}, {51, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, {70, 6}, { 0, 0}, { 0, 0}, {72, 6}, { 0, 0}, {73, 5}, - {77, 6}, { 0, 0}, {71, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {77, 6}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} -}; - -} // End of namespace Cine diff --git a/engines/cine/font.h b/engines/cine/font.h deleted file mode 100644 index 041551d0a5..0000000000 --- a/engines/cine/font.h +++ /dev/null @@ -1,39 +0,0 @@ -/* ScummVM - Scumm Interpreter - * Copyright (C) 2006 The ScummVM project - * - * cinE Engine is (C) 2004-2005 by CinE Team - * - * 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. - * - * $URL$ - * $Id$ - * - */ - -#ifndef CINE_FONT_H_ -#define CINE_FONT_H_ - -namespace Cine { - -struct CharacterEntry { - byte characterIdx; - byte characterWidth; -}; - -extern const CharacterEntry fontParamTable[256]; - -} // End of namespace Cine - -#endif diff --git a/engines/cine/module.mk b/engines/cine/module.mk index 10f2ddbaa0..929511b1b4 100644 --- a/engines/cine/module.mk +++ b/engines/cine/module.mk @@ -6,7 +6,6 @@ MODULE_OBJS = \ bg_list.o \ cine.o \ detection.o \ - font.o \ gfx.o \ main_loop.o \ msg.o \ diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp index 24be31d42c..e327274c62 100644 --- a/engines/cine/texte.cpp +++ b/engines/cine/texte.cpp @@ -32,6 +32,13 @@ byte *textDataPtr; byte textTable[256][2][16 * 8]; +const char **failureMessages; +const commandeType *defaultActionCommand; +const commandeType *systemMenu; +const commandeType *confirmMenu; +const char **otherMessages; +const char *commandPrepositionOn; + void generateMask(byte *sprite, byte *mask, uint16 size, byte transparency); void loadTextData(const char *pFileName, byte *pDestinationBuffer) { @@ -58,11 +65,18 @@ void loadTextData(const char *pFileName, byte *pDestinationBuffer) { tempBuffer = pDestinationBuffer; if (g_cine->getGameType() == Cine::GType_FW) { - dataSize = dataSize / 0x4E; + int numCharacters; + if (g_cine->getFeatures() & GF_ALT_FONT) { + numCharacters = 85; + } else { + numCharacters = 78; + } + + dataSize = dataSize / numCharacters; loadRelatedPalette(pFileName); - for (i = 0; i < 0x4E; i++) { + for (i = 0; i < numCharacters; i++) { gfxConvertSpriteToRaw(textTable[i][0], tempBuffer, 16, 8); generateMask(textTable[i][0], textTable[i][1], 16 * 8, 0); tempBuffer += dataSize; @@ -78,4 +92,478 @@ void loadTextData(const char *pFileName, byte *pDestinationBuffer) { pFileHandle.close(); } +const CharacterEntry *fontParamTable; + +const CharacterEntry fontParamTable_standard[256] = { + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, {63, 1}, {69, 5}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {68, 3}, + {64, 3}, {65, 3}, { 0, 0}, { 0, 0}, {62, 2}, {74, 6}, {66, 1}, {67, 6}, + {52, 6}, {53, 6}, {54, 6}, {55, 6}, {56, 6}, {57, 6}, {58, 6}, {59, 6}, + {60, 6}, {61, 6}, {76, 3}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {75, 6}, + { 0, 0}, { 0, 6}, //a + { 1, 6}, { 2, 6}, { 3, 6}, { 4, 6}, { 5, 6}, { 6, 6}, + { 7, 6}, { 8, 3}, { 9, 6}, {10, 6}, {11, 6}, {12, 7}, {13, 6}, {14, 6}, + {15, 6}, {16, 6}, {17, 6}, {18, 6}, {19, 6}, {20, 6}, {21, 6}, {22, 7}, + {23, 6}, {24, 6}, {25, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, {26, 6}, //a + {27, 6}, {28, 5}, {29, 6}, {30, 6}, {31, 5}, {32, 6}, + {33, 6}, {34, 4}, {35, 4}, {36, 5}, {37, 3}, {38, 7}, {39, 6}, {40, 6}, + {41, 6}, {42, 6}, {43, 6}, {44, 6}, {45, 6}, {46, 6}, {47, 6}, {48, 7}, + {49, 6}, {50, 6}, {51, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, {70, 6}, { 0, 0}, { 0, 0}, {72, 6}, { 0, 0}, {73, 5}, + {77, 6}, { 0, 0}, {71, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {77, 6}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} +}; + +const CharacterEntry fontParamTable_alt[256] = { + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, {63, 1}, {69, 5}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {68, 3}, + {64, 3}, {65, 3}, { 0, 0}, { 0, 0}, {62, 2}, {74, 6}, {66, 1}, {67, 6}, + {52, 6}, {53, 6}, {54, 6}, {55, 6}, {56, 6}, {57, 6}, {58, 6}, {59, 6}, + {60, 6}, {61, 6}, {76, 3}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {75, 6}, + { 0, 0}, { 0, 6}, { 1, 6}, { 2, 6}, { 3, 6}, { 4, 6}, { 5, 6}, { 6, 6}, + { 7, 6}, { 8, 3}, { 9, 6}, {10, 6}, {11, 6}, {12, 7}, {13, 6}, {14, 6}, + {15, 6}, {16, 6}, {17, 6}, {18, 6}, {19, 6}, {20, 6}, {21, 6}, {22, 7}, + {23, 6}, {24, 6}, {25, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, {26, 6}, {27, 6}, {28, 5}, {29, 6}, {30, 6}, {31, 5}, {32, 6}, + {33, 6}, {34, 4}, {35, 4}, {36, 5}, {37, 3}, {38, 7}, {39, 6}, {40, 6}, + {41, 6}, {42, 6}, {43, 6}, {44, 6}, {45, 6}, {46, 6}, {47, 6}, {48, 7}, + {49, 6}, {50, 6}, {51, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, {82, 6}, {70, 6}, { 0, 0}, {78, 6}, {72, 6}, { 0, 0}, {73, 5}, + {77, 6}, {79, 6}, {71, 6}, {80, 4}, { 0, 0}, { 0, 0}, {78, 6}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {81, 6}, { 0, 0}, { 0, 0}, {77, 6}, + {83, 6}, {81, 6}, {82, 6}, { 0, 0}, { 0, 0}, { 0, 0}, {84, 6}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, {84, 6}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0} +}; + +void initLanguage(Common::Language lang) { + static const char *failureMessages_EN[] = { + // EXAMINE + "I don't see anything unusual.", + "There's nothing of interest here.", + "This isn't particularly interesting.", + "You won't find anything.", + // TAKE + "I can't take that.", + "I find it difficult.", + "I don't see what I am supposed to take.", + "I have difficulty in following you.", + // INVENTORY + "There's no point.", + "You have better things to do.", + "Come on, don't let's waste any time.", + "That doesn't seem to me to be a good idea.", + // USE + "I don't see why I should do that.", + "It's had no effect whatsoever.", + "It won't produce any results.", + "Try and find something else.", + // OPERATE + "It doesn't work.", + "Let suppose you are trying and don't let's mention it again.", + "Nothing happens.", + "You have better things to do.", + // SPEAK + "No answer.", + "More action , less talking !", + "I'd be very surprised if you got an answer", + "A wall of silence ..." + }; + + static const commandeType defaultActionCommand_EN[] = { + "EXAMINE", + "TAKE", + "INVENTORY", + "USE", + "OPERATE", + "SPEAK", + "NOACTION" + }; + + static const commandeType systemMenu_EN[] = { + "Pause", + "Restart Game", + "Quit", + "Backup Drive is A:", + "Restore game", + "Save game" + }; + + static const char *otherMessages_EN[] = { + "This backup doesn't exist ...", + "Could not create save file ...", + "PAUSE", + "Loading | %s", + "Loading canceled ...", + "No baclup in the drive...", + "temporary save name", + "Please enter the backup name", + "on" + }; + + static const commandeType confirmMenu_EN[] = { + "Ok, go ahead ...", + "Absolutely Not!" + }; + + static const char *failureMessages_FR[] = { + // EXAMINER + "Je ne vois rien de special.", + "Il n'y a rien d'int\x82ressant.", + "Cela pr\x82sente peu d'int\x82r\x88ts.", + "Vous ne trouvez rien.", + // PRENDRE + "Je ne peux pas prendre cela.", + "Cela me semble difficile", + "Je ne vois pas ce qu'il y a \x85 prendre", + "j'ai du mal \x85 vous suivre.", + // INVENTAIRE + "C'est inutile", + "Vous avez mieux \x85 faire", + "Allons, ne perdons pas de temps", + "\x87""a ne me semble pas \x88tre une bonne id\x82""e", + // UTILISER + "Je ne vois pas pourquoi je ferais cela.", + "C'est absolument sans effets", + "Cela n'amenerait \x85 rien", + "Essayez de trouver autre chose.", + // ACTIONNER + "Ca ne marche pas", + "Supposons que vous essayez et n'en parlons plus.", + "Rien n'y fait.", + "Vous avez mieux \x85 faire.", + // PARLER + "Vous lui parlez . Sans r\x82ponse.", + "Plus d'actes et moins de Paroles !", + "Je serais bien surpris si vous obteniez une r\x82ponse.", + "Un mur de silence ..." + }; + + static const commandeType defaultActionCommand_FR[] = { + "EXAMINER", + "PRENDRE", + "INVENTAIRE", + "UTILISER", + "ACTIONNER", + "PARLER", + "NOACTION" + }; + + static const commandeType systemMenu_FR[] = { + "Pause", + "Nouvelle partie", + "Quitter", + "Lecteur de Svg. A:", + "Charger une partie", + "Sauver la partie" + }; + + static const commandeType confirmMenu_FR[] = { + "Ok , Vas-y ...", + "Surtout Pas !" + }; + + static const char *otherMessages_FR[] = { + "Cette sauvegarde n'existe pas ...", + "Could not create save file ...", // + "PAUSE", + "Sauvegarde de | %s", + "Sauvegarde Annul\x82""e ...", + "Aucune sauvegarde dans le lecteur ...", + "temporary save name", // + "Veuillez entrer le Nom de la Sauvegarde .", + "sur" + }; + + static const char *failureMessages_ES[] = { + // EXAMINE + "No veo nada especial", + "No hay nada interesante", + "No tiene mucho interes", + "No encuentras nada", + // TAKE + "No puedo coger eso", + "Eso parece dificil", + "No veo nada mas para coger", + "No he debido entenderte", + // INVENTORY + "Es inutil", + "Tienes algo mejor que hacer" + "Vamos. No perdamos tiempo", + "Esa no es una buena idea", + // USE + "No veo porque hacerlo", + "No ha tenido efecto", + "Eso no arreglara nada", + "Intenta encontrar otra cosa", + // OPERATE + "Eso no funciona", + "Suponfamos que pruebas y no hablamos mas", + "Nada ha pasado", + "Tienes cosas mejores que hacer", + // SPEAK + "Le hablas. Sin respuesta.", + "Menos hablar y mas trabajar", + "Me sorprenderia si tuvieras otra repuesta", + "Un muro de silencio ..." + }; + + static const commandeType defaultActionCommand_ES[] = { + "EXAMINAR", + "COGER", + "INVENTARIO", + "USAR", + "ACCIONAR", + "HABLAR", + "NOACTION" + }; + + static const commandeType systemMenu_ES[] = { + "Pause", + "Nueva partida", + "Abandonar", + "Unidad grabar. A:", + "Cargar una partida", + "Salvar la partida" + }; + + static const commandeType confirmMenu_ES[] = { + "Ok , Vas a ...", + "Nade de nada !" + }; + + static const char *otherMessages_ES[] = { + "Esta granacion no existe", + "Could not create save file ..." // + "PAUSE", + "Gabacion de| %s", + "Rrabacion anulada", + "No hay partidas grabadas en este disco...", + "temporary save name", // + "Teclea el nombre de la partida grabada", + "donde" + }; + + static const char *failureMessages_DE[] = { + // EXAMINE + "Ich sehe nichts Besonderes", + "Es gibt hier nichts Interessantes", + "Das ist nicht besonders interessant", + "Sie werden nichts finden", + // TAKE + "Ich Kann das nicht nehmen", + "Das finde ich schwierig'", + "Ich wei\x9e nicht, was ich nehmen soll", + "Ich kann Ihnen nicht folgen", + // INVENTORY + "Das bringt nichts", + "Sie haben wirklich was Besseres zu tun", + "Los, wir sollten keine Zeit verschwenden", + "Das scheint mir eine gute Idee zu sein", + // USE + "Ich wei\x9e nicht, warum ich das tun soll", + "Es hat so oder so nichts begracht", + "Davon haben wir nichts", + "Versuchen Sie, etwas anderes zu finden", + // OPERATE + "Es geht nicht", + "Sagen wir, das war ein Versuch, und reden wir nicht mehr dr\x81""ber", + "Nichts passiert", + "Sie haben wirklich was Besseres zu tun", + // SPEAK + "Sie sprechen m it ihm. Keine Antwort", + "Nicht reden, sondern handeln!", + "Wenn Sie eine Antwork bek\x84men, w\x81rde es mich sehr wundern", + "Eine Wand des Schweigens..." + }; + + static const commandeType defaultActionCommand_DE[] = { + "Pr\x81""fe", + "Nimm", + "Bestand", + "Benutze", + "Bet\x84tige", + "Sprich", + "NOACTION" + }; + + static const commandeType systemMenu_DE[] = { + "Pause", + "Spiel Neu Starten", + "Lassen", + "Backuplaufwerk A:", + "Spiel Laden", + "Spiel Speichern" + }; + + static const commandeType confirmMenu_DE[] = { + "Gut, Weitermachen", + "Absolut Nicht!" + }; + + static const char *otherMessages_DE[] = { + "Diese Sicherungskopie gibt es nicht", + "Could not create save file ...", // + "PAUSE", + "Er L\x84""dt | %s", + "Ladevorgang Abgebrochen...", + "Kein Backup im Laufwerk...", + "temporary save name", // + "Geben Sie den Namen|der Sicherungsdiskette ein", + "gegen" + }; + + static const char *failureMessages_IT[] = { + // EXAMINE + "Non vedo nula di speciale", + "Non c'\x8a niente di interessante", + "E' di poco interesse", + "Non trovate nulla", + // TAKE + "Non poso prendere quello", + "Quello mi sembra difficile", + "Non vedo cosa ci sia da prendere", + "Faccio fatica a seguirvi", + // INVENTORY + "E' inutile", + "Avete di meglio da fare", + "Allora, no perdiamo tempo", + "Non mi pare che sia una buona idea", + // USE + "Non vedo perch\x82 dovrei farlo", + "E' assolutamente privo di effetti", + "Cio non portera a nulla", + "Provate a trovare qualcosa d'altro", + // OPERATE + "Non funziona", + "Supponiamo che voi proviate e non ne parliamo piu", + "Niente di fatto", + "Avete di meglio da fare", + // SPEAK + "Gli parlate. Senza risposta", + "Piu fatti e meno parole", + "Sarei sorpreso se voi otterreste una risposta", + "Un muro di silenzio ..." + }; + + static const commandeType defaultActionCommand_IT[] = { + "ESAMINARE", + "PRENDERE", + "INVENTARIO", + "UTILIZZARE", + "AZIONARE", + "PARLARE", + "NOACTION" + }; + + static const commandeType systemMenu_IT[] = { + "Pausa", + "Parte nuova", + "Quit", + "Drive di svg. A:", + "Caricare una parte", + "Salvare una parte" + }; + + static const commandeType confirmMenu_IT[] = { + "Ok, vacci ...", + "Supratutto non!" + }; + + static const char *otherMessages_IT[] = { + "Questo salvataggio non esiste...", + "Could not create save file ...", // + "PAUSE", + "Caricamento di| %s", + "Caricamento annullato...", + "Nessun salvataggio su questo disco...", + "temporary save name", // + "Vogliate accedere con il nome del salvataggio", + "su" + }; + + switch (lang) { + case Common::FR_FRA: + failureMessages = failureMessages_FR; + defaultActionCommand = defaultActionCommand_FR; + systemMenu = systemMenu_FR; + confirmMenu = confirmMenu_FR; + otherMessages = otherMessages_FR; + commandPrepositionOn = otherMessages_FR[8]; + break; + + case Common::ES_ESP: + failureMessages = failureMessages_ES; + defaultActionCommand = defaultActionCommand_ES; + systemMenu = systemMenu_ES; + confirmMenu = confirmMenu_ES; + otherMessages = otherMessages_ES; + commandPrepositionOn = otherMessages_ES[8]; + break; + + case Common::DE_DEU: + failureMessages = failureMessages_DE; + defaultActionCommand = defaultActionCommand_DE; + systemMenu = systemMenu_DE; + confirmMenu = confirmMenu_DE; + otherMessages = otherMessages_DE; + commandPrepositionOn = otherMessages_DE[8]; + break; + + case Common::IT_ITA: + failureMessages = failureMessages_IT; + defaultActionCommand = defaultActionCommand_IT; + systemMenu = systemMenu_IT; + confirmMenu = confirmMenu_IT; + otherMessages = otherMessages_IT; + commandPrepositionOn = otherMessages_IT[8]; + break; + + default: + failureMessages = failureMessages_EN; + defaultActionCommand = defaultActionCommand_EN; + systemMenu = systemMenu_EN; + confirmMenu = confirmMenu_EN; + otherMessages = otherMessages_EN; + commandPrepositionOn = otherMessages_EN[8]; + break; + } + + if (g_cine->getFeatures() & GF_ALT_FONT) { + fontParamTable = fontParamTable_alt; + } else { + fontParamTable = fontParamTable_standard; + } +} + } // End of namespace Cine diff --git a/engines/cine/texte.h b/engines/cine/texte.h index 8907e9e638..9264c23d06 100644 --- a/engines/cine/texte.h +++ b/engines/cine/texte.h @@ -30,9 +30,25 @@ namespace Cine { +typedef char commandeType[20]; + extern byte *textDataPtr; extern byte textTable[256][2][16 * 8]; +extern const char **failureMessages; +extern const commandeType *defaultActionCommand; +extern const commandeType *systemMenu; +extern const commandeType *confirmMenu; +extern const char **otherMessages; +extern const char *commandPrepositionOn; + +struct CharacterEntry { + byte characterIdx; + byte characterWidth; +}; + +extern const CharacterEntry *fontParamTable; + void loadTextData(const char *pFileName, byte *pDestinationBuffer); } // End of namespace Cine diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index 418623d4e7..b64ab5d7d4 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -27,7 +27,6 @@ #include "common/savefile.h" #include "cine/cine.h" -#include "cine/font.h" #include "cine/main_loop.h" #include "cine/object.h" #include "cine/sfx_player.h" @@ -128,148 +127,8 @@ byte inputVar1 = 0; uint16 inputVar2; uint16 inputVar3; -const char **failureMessages; -const commandeType *defaultActionCommand; -const commandeType *systemMenu; -const commandeType *confirmMenu; -const char *commandPrepositionOn; - selectedObjStruct currentSelectedObject; -void initLanguage(Common::Language lang) { - static const char *failureMessages_EN[] = { - // EXAMINE - "I don't see anything unusual.", - "There's nothing of interest here.", - "This isn't particularly interesting.", - "You won't find anything.", - // TAKE - "I can't take that.", - "I find it difficult.", - "I don't see what I am supposed to take.", - "I have difficulty in following you.", - // INVENTORY (???) - "There's no point.", - "You have better things to do.", - "Come on, don't let's waste any time.", - "That doesn't seem to me to be a good idea.", - // USE - "I don't see why I should do that.", - "It's had no effect whatsoever.", - "It won't produce any results.", - "Try and find something else.", - // OPERATE - "It doesn't work.", - "Let suppose you are trying and don't let's mention it again.", - "Nothing happens.", - "You have better things to do.", - // SPEAK - "No answer.", - "More action , less talking !", - "I'd be very surprised if you got an answer", - "A wall of silence ..." - }; - - static const commandeType defaultActionCommand_EN[] = { - "EXAMINE", - "TAKE", - "INVENTORY", - "USE", - "OPERATE", - "SPEAK", - "NOACTION" - }; - - static const commandeType systemMenu_EN[] = { - "Pause", - "Restart Game", - "Quit", - "Backup Drive is A:", - "Restore game", - "Save game" - }; - - static const commandeType confirmMenu_EN[] = { - "Ok, go ahead ...", - "Absolutely Not!" - }; - - // \x82 == é, \x85 == à, \x87 == ç, \x88 == ê - static const char *failureMessages_FR[] = { - // EXAMINER - "Je ne vois rien de special.", - "Il n'y a rien d'int\x82ressant.", - "Cela pr\x82sente peu d'int\x82r\x88ts.", - "Vous ne trouvez rien.", - // PRENDRE - "Je ne peux pas prendre cela.", - "Cela me semble difficile", - "Je ne vois pas ce qu'il y a \x85 prendre", - "j'ai du mal \x85 vous suivre.", - // INVENTAIRE (???) - "C'est inutile", - "Vous avez mieux \x85 faire", - "Allons, ne perdons pas de temps", - "\x87""a ne me semble pas \x88tre une bonne id\x82""e", - // UTILISER - "Je ne vois pas pourquoi je ferais cela.", - "C'est absolument sans effets", - "Cela n'amenerait \x85 rien", - "Essayez de trouver autre chose.", - // ACTIONNER - "Ca ne marche pas", - "Supposons que vous essayez et n'en parlons plus.", - "Rien n'y fait.", - "Vous avez mieux \x85 faire.", - // PARLER - "Vous lui parlez . Sans r\x82ponse.", - "Plus d'actes et moins de Paroles !", - "Je serais bien surpris si vous obteniez une r\x82ponse.", - "Un mur de silence ..." - }; - - static const commandeType defaultActionCommand_FR[] = { - "EXAMINER", - "PRENDRE", - "INVENTAIRE", - "UTILISER", - "ACTIONNER", - "PARLER", - "NOACTION" - }; - - static const commandeType systemMenu_FR[] = { - "Pause", - "Nouvelle partie", - "Quitter", - "Lecteur de Svg. A:", - "Charger une partie", - "Sauver la partie" - }; - - static const commandeType confirmMenu_FR[] = { - "Ok , Vas-y ...", - "Surtout Pas !" - }; - - switch (lang) { - case Common::FR_FRA: - failureMessages = failureMessages_FR; - defaultActionCommand = defaultActionCommand_FR; - systemMenu = systemMenu_FR; - confirmMenu = confirmMenu_FR; - commandPrepositionOn = "sur"; - break; - default: - failureMessages = failureMessages_EN; - defaultActionCommand = defaultActionCommand_EN; - systemMenu = systemMenu_EN; - confirmMenu = confirmMenu_EN; - commandPrepositionOn = "on"; - break; - } -} - void mainLoopSub3(void) { } @@ -587,7 +446,7 @@ int16 makeLoad(char *saveName) { fHandle = g_saveFileMan->openForLoading(saveName); if (!fHandle) { - drawString("Cette sauvegarde n'existe pas ...", 0); + drawString(otherMessages[0], 0); waitPlayerInput(); // restoreScreen(); checkDataDisk(-1); @@ -834,7 +693,7 @@ void makeSave(char *saveFileName) { fHandle = g_saveFileMan->openForSaving(saveFileName); if (!fHandle) { - drawString("Could not create save file ...", 0); + drawString(otherMessages[1], 0); waitPlayerInput(); // restoreScreen(); checkDataDisk(-1); @@ -1072,7 +931,7 @@ void makeSystemMenu(void) { switch (systemCommand) { case 0: { - drawString("PAUSE", 0); + drawString(otherMessages[2], 0); waitPlayerInput(); break; } @@ -1115,22 +974,22 @@ void makeSystemMenu(void) { if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) { char loadString[256]; - sprintf(loadString, "Chargement de | %s", currentSaveName[selectedSave]); + sprintf(loadString, otherMessages[3], currentSaveName[selectedSave]); drawString(loadString, 0); makeLoad(saveNameBuffer); } else { - drawString("Chargement Annulé ...", 0); + drawString(otherMessages[4], 0); waitPlayerInput(); checkDataDisk(-1); } } else { - drawString("Chargement Annulé ...", 0); + drawString(otherMessages[4], 0); waitPlayerInput(); checkDataDisk(-1); } } else { - drawString("Aucune sauvegarde dans le lecteur ...", 0); + drawString(otherMessages[5], 0); waitPlayerInput(); checkDataDisk(-1); } @@ -1145,8 +1004,8 @@ void makeSystemMenu(void) { if (selectedSave >= 0) { char saveFileName[256]; - //makeTextEntryMenu("Veuillez entrer le Nom de la Sauvegarde .", ¤tSaveName[selectedSave], 120); - sprintf(currentSaveName[selectedSave], "temporary save name"); + //makeTextEntryMenu(otherMessages[7], ¤tSaveName[selectedSave], 120); + sprintf(currentSaveName[selectedSave], otherMessages[6]); if (g_cine->getGameType() == Cine::GType_FW) sprintf(saveFileName, "FW.%1d", selectedSave); @@ -1167,14 +1026,14 @@ void makeSystemMenu(void) { fHandle->write(currentSaveName, 200); delete fHandle; - sprintf(saveString, "Sauvegarde de |%s", currentSaveName[selectedSave]); + sprintf(saveString, otherMessages[3], currentSaveName[selectedSave]); drawString(saveString, 0); makeSave(saveFileName); checkDataDisk(-1); } else { - drawString("Sauvegarde Annulée ...", 0); + drawString(otherMessages[4], 0); waitPlayerInput(); checkDataDisk(-1); } @@ -2009,7 +1868,7 @@ uint16 executePlayerInput(void) { canUseOnObject = 0; if (isInPause) { - drawString("PAUSE", 0); + drawString(otherMessages[2], 0); waitPlayerInput(); isInPause = 0; } diff --git a/engines/cine/various.h b/engines/cine/various.h index 7cd7e37a52..3cbdaa96ef 100644 --- a/engines/cine/various.h +++ b/engines/cine/various.h @@ -32,8 +32,6 @@ namespace Cine { -typedef char commandeType[20]; - void initLanguage(Common::Language lang); int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width); -- cgit v1.2.3