2012-05-03 00:49:59 +10:00
|
|
|
|
/* 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.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2012-05-14 07:43:50 +02:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This code is based on original Tony Tough source code
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 1997-2003 Nayma Software
|
|
|
|
|
*/
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
#include "common/textconsole.h"
|
|
|
|
|
#include "tony/mpal/mpalutils.h"
|
|
|
|
|
#include "tony/font.h"
|
|
|
|
|
#include "tony/input.h"
|
|
|
|
|
#include "tony/inventory.h"
|
|
|
|
|
#include "tony/loc.h"
|
|
|
|
|
#include "tony/tony.h"
|
|
|
|
|
|
|
|
|
|
namespace Tony {
|
|
|
|
|
|
|
|
|
|
/****************************************************************************\
|
2012-05-20 15:28:48 +10:00
|
|
|
|
* RMFont Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
|
|
|
|
RMFont::RMFont() {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_letter = NULL;
|
2012-06-14 00:11:56 +02:00
|
|
|
|
_nLetters = _fontDimx = _fontDimy = _dimx = _dimy = 0;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RMFont::~RMFont() {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
unload();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Dumps a font to a buffer
|
2012-05-21 23:53:13 +02:00
|
|
|
|
* @param buf Buffer for font contents
|
|
|
|
|
* @param nChars Number of characters (max 256)
|
|
|
|
|
* @param dimx X dimension in pixels
|
|
|
|
|
* @param dimy Y dimension in pixels
|
2012-05-03 00:49:59 +10:00
|
|
|
|
*
|
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void DumpFontBMP(const char *filename, const byte *buf, int nChars, int charX, int charY, byte *pal) {
|
|
|
|
|
error("DumpFontBMP not supported in ScummVM");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMFont::load(const byte *buf, int nChars, int dimx, int dimy, uint32 palResID) {
|
|
|
|
|
_letter = new RMGfxSourceBuffer8RLEByte[nChars];
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-17 18:36:23 +02:00
|
|
|
|
// Initialize the fonts
|
2012-05-03 23:08:19 +10:00
|
|
|
|
for (int i = 0; i < nChars; i++) {
|
2012-06-17 18:36:23 +02:00
|
|
|
|
// Initialize the buffer with the letters
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_letter[i].init(buf + i * (dimx * dimy + 8) + 8, dimx, dimy);
|
|
|
|
|
_letter[i].loadPaletteWA(palResID);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_fontDimx = dimx;
|
|
|
|
|
_fontDimy = dimy;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_nLetters = nChars;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMFont::load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID) {
|
2012-05-03 22:49:30 +10:00
|
|
|
|
RMRes res(resID);
|
|
|
|
|
|
2012-06-07 08:42:35 +02:00
|
|
|
|
if ((int)res.size() < nChars * (dimy * dimx + 8))
|
|
|
|
|
nChars = res.size() / (dimy * dimx + 8);
|
2012-05-03 22:49:30 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
load(res, nChars, dimx, dimy, palResID);
|
2012-05-03 22:49:30 +10:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMFont::unload(void) {
|
|
|
|
|
if (_letter != NULL) {
|
|
|
|
|
delete[] _letter;
|
|
|
|
|
_letter = NULL;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
RMGfxPrimitive *RMFont::makeLetterPrimitive(byte bChar, int &nLength) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
RMFontPrimitive *prim;
|
|
|
|
|
int nLett;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Convert from character to glyph index
|
2012-06-06 08:04:33 +02:00
|
|
|
|
nLett = convertToLetter(bChar);
|
2012-06-11 00:34:45 +02:00
|
|
|
|
assert(nLett < _nLetters);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Create primitive font
|
2012-05-03 00:49:59 +10:00
|
|
|
|
prim = new RMFontPrimitive(this);
|
2012-06-06 08:04:33 +02:00
|
|
|
|
prim->_nChar = nLett;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Get the length of the character in pixels
|
2012-06-06 08:04:33 +02:00
|
|
|
|
nLength = letterLength(bChar);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
return prim;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMFont::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim2) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
RMFontPrimitive *prim = (RMFontPrimitive *)prim2;
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Call the draw method of the letter assigned to the primitive
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (prim->_nChar != -1)
|
|
|
|
|
CORO_INVOKE_2(_letter[prim->_nChar].draw, bigBuf, prim);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMFont::close(void) {
|
|
|
|
|
unload();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
int RMFont::stringLen(const RMString &text) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int len, i;
|
|
|
|
|
|
|
|
|
|
len = 0;
|
2012-06-07 08:42:35 +02:00
|
|
|
|
for (i = 0; i < text.length() - 1; i++)
|
2012-06-06 08:04:33 +02:00
|
|
|
|
len += letterLength(text[i], text[i + 1]);
|
|
|
|
|
len += letterLength(text[i]);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
return len;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
int RMFont::stringLen(char bChar, char bNext) {
|
|
|
|
|
return letterLength(bChar, bNext);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************\
|
|
|
|
|
* Metodi di RMFontColor
|
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
|
|
|
|
RMFontColor::RMFontColor() : RMFont() {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_fontR = _fontG = _fontB = 255;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RMFontColor::~RMFontColor() {
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:31:06 +02:00
|
|
|
|
void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int r = (int)r1 << 16;
|
|
|
|
|
int g = (int)g1 << 16;
|
|
|
|
|
int b = (int)b1 << 16;
|
|
|
|
|
|
|
|
|
|
int rstep = r / 14;
|
|
|
|
|
int gstep = g / 14;
|
|
|
|
|
int bstep = b / 14;
|
|
|
|
|
|
|
|
|
|
int i;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
byte pal[768 * 3];
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-17 18:36:23 +02:00
|
|
|
|
// Check if we are already on the right color
|
2012-06-11 00:34:45 +02:00
|
|
|
|
if (_fontR == r1 && _fontG == g1 && _fontB == b1)
|
2012-05-03 00:49:59 +10:00
|
|
|
|
return;
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_fontR = r1;
|
|
|
|
|
_fontG = g1;
|
|
|
|
|
_fontB = b1;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Constructs a new paletter for the font
|
2012-05-03 00:49:59 +10:00
|
|
|
|
for (i = 1; i < 16; i++) {
|
2012-05-14 21:29:27 +02:00
|
|
|
|
pal[i * 3 + 0] = r >> 16;
|
|
|
|
|
pal[i * 3 + 1] = g >> 16;
|
|
|
|
|
pal[i * 3 + 2] = b >> 16;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
r -= rstep;
|
|
|
|
|
g -= gstep;
|
|
|
|
|
b -= bstep;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-14 21:29:27 +02:00
|
|
|
|
pal[15 * 3 + 0] += 8;
|
|
|
|
|
pal[15 * 3 + 1] += 8;
|
|
|
|
|
pal[15 * 3 + 2] += 8;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Puts in all the letters
|
2012-06-11 00:34:45 +02:00
|
|
|
|
for (i = 0; i < _nLetters; i++)
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_letter[i].loadPaletteWA(pal);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************\
|
2012-05-20 15:28:48 +10:00
|
|
|
|
* RMFontParla Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMFontParla::init(void) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int i;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// bernie: Number of characters in the font
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int nchars =
|
2012-05-14 21:29:27 +02:00
|
|
|
|
112 // base
|
|
|
|
|
+ 18 // polish
|
|
|
|
|
+ 66 // russian
|
|
|
|
|
+ 30 // czech
|
|
|
|
|
+ 8 // french
|
|
|
|
|
+ 5; // deutsch
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
load(RES_F_PARL, nchars, 20, 20);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-17 18:36:23 +02:00
|
|
|
|
// Initialize the f**king table
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lDefault = 13;
|
|
|
|
|
_hDefault = 18;
|
|
|
|
|
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
|
2012-05-03 23:08:19 +10:00
|
|
|
|
for (i = 0; i < 256; i++) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[i] = -1;
|
|
|
|
|
_lTable[i] = _lDefault;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 26; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['A' + i] = i + 0;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 26; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['a' + i] = i + 26;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 10; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['0' + i] = i + 52;
|
|
|
|
|
|
|
|
|
|
_cTable[';'] = 62;
|
|
|
|
|
_cTable[','] = 63;
|
|
|
|
|
_cTable['.'] = 64;
|
|
|
|
|
_cTable[':'] = 65;
|
|
|
|
|
_cTable['-'] = 66;
|
|
|
|
|
_cTable['_'] = 67;
|
|
|
|
|
_cTable['+'] = 68;
|
|
|
|
|
_cTable['<'] = 69;
|
|
|
|
|
_cTable['>'] = 70;
|
|
|
|
|
_cTable['!'] = 71;
|
|
|
|
|
//_cTable['!'] = 72; Exclamation countdown
|
|
|
|
|
_cTable['?'] = 73;
|
|
|
|
|
//_cTable['?'] = 74; Question down
|
|
|
|
|
_cTable['('] = 75;
|
|
|
|
|
_cTable[')'] = 76;
|
|
|
|
|
_cTable['\"'] = 77;
|
|
|
|
|
_cTable['^'] = 77;
|
|
|
|
|
_cTable['/'] = 78;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 79;
|
|
|
|
|
_cTable['$'] = 80;
|
|
|
|
|
_cTable['%'] = 81;
|
|
|
|
|
_cTable['&'] = 82;
|
|
|
|
|
_cTable['='] = 83;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 84;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 85;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 86;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 87;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 88;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 89;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 89;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 90;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 91;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 92;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 93;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 94;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 95;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 96;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 97;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 98;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 99;
|
|
|
|
|
//_cTable[' '] = 100; e circlet
|
|
|
|
|
//_cTable[' '] = 101; i circlet
|
|
|
|
|
//_cTable[' '] = 102; o circlet
|
|
|
|
|
//_cTable[' '] = 103; u circlet
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 104;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 105;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 106;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 107;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 108;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 109;
|
|
|
|
|
//_cTable['<27>'] = 110; integral
|
|
|
|
|
_cTable['\''] = 111;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Little lengths
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lTable[' '] = 9;
|
|
|
|
|
_lTable['\''] = 5;
|
|
|
|
|
_lTable['.'] = 5;
|
|
|
|
|
_lTable[','] = 5;
|
|
|
|
|
_lTable[':'] = 5;
|
|
|
|
|
_lTable[';'] = 5;
|
|
|
|
|
_lTable['!'] = 5;
|
|
|
|
|
_lTable['?'] = 10;
|
|
|
|
|
_lTable['\"'] = 5;
|
|
|
|
|
_lTable['^'] = 5;
|
|
|
|
|
_lTable['('] = 7;
|
|
|
|
|
_lTable[')'] = 7;
|
|
|
|
|
|
|
|
|
|
_lTable['4'] = 10;
|
|
|
|
|
|
|
|
|
|
_lTable['a'] = 14;
|
|
|
|
|
_lTable['b'] = 15;
|
|
|
|
|
_lTable['c'] = 12;
|
|
|
|
|
_lTable['e'] = 12;
|
|
|
|
|
_lTable['i'] = 6;
|
|
|
|
|
_lTable['<EFBFBD>'] = 6;
|
|
|
|
|
_lTable['l'] = 5;
|
|
|
|
|
_lTable['m'] = 16;
|
|
|
|
|
_lTable['n'] = 12;
|
|
|
|
|
_lTable['o'] = 11;
|
|
|
|
|
_lTable['p'] = 11;
|
|
|
|
|
_lTable['s'] = 12;
|
|
|
|
|
_lTable['u'] = 12;
|
|
|
|
|
|
|
|
|
|
_lTable['E'] = 10;
|
|
|
|
|
_lTable['F'] = 11;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-21 23:53:13 +02:00
|
|
|
|
if (_vm->getLanguage() == Common::PL_POL) {
|
2012-05-20 10:52:08 +10:00
|
|
|
|
// Polish characters
|
|
|
|
|
//AaCcEeLlNnOoSsZzZz
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ꣳ<EFBFBD><EAA3B3><EFBFBD><EFBFBD><F38C9CAF><EFBFBD>
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 112;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 113;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 114;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 115;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 116;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 117;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 118;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 119;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 120;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 121;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 122;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 123;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 124;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 125;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 126;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 127;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 128;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 129;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::RU_RUS) {
|
|
|
|
|
|
|
|
|
|
// Russian Characters
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
|
2012-05-21 23:53:13 +02:00
|
|
|
|
// allowing for further translations. To support Tonyin other langauges,
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// these mappings could be used as a basis
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 130;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 131;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 132;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 133;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 134;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 135;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 136;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 137;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 138;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 139;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 140;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 141;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 142;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 143;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 144;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 145;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 146;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 147;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 148;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 149;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 150;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 151;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 152;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 153;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 154;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 155;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 156;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 157;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 158;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 159;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 160;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 161;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 162;
|
|
|
|
|
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 163;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 164;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 165;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 166;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 167;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 168;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 169;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 170;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 171;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 172;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 173;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 174;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 175;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 176;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 177;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 178;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 179;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 180;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 181;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 182;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 183;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 184;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 185;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 186;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 187;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 188;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 189;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 190;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 191;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 192;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 193;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 194;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 195;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 17;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 19;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 8;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::CZ_CZE) {
|
|
|
|
|
// Czech
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 196;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 197;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 198;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 199;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 200;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 201;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 202;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 203;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 204;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 205;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 206;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 207;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 208;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 209;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 210;
|
|
|
|
|
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 211;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 212;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 213;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 214;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 215;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 216;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 217;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 218;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 219;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 220;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 221;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 222;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 223;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 224;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 225;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 19;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 7;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 17;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-05-21 23:53:13 +02:00
|
|
|
|
} else if (_vm->getLanguage() == Common::FR_FRA) {
|
2012-05-20 10:52:08 +10:00
|
|
|
|
// French
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 226;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 227;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 228;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 229;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 230;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 231;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 232;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 233;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::DE_DEU) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 234;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
// 'SS' = 235
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 236;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 237;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 238;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************\
|
2012-05-20 15:28:48 +10:00
|
|
|
|
* RMFontMacc Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMFontMacc::init(void) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int i;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// bernie: Number of characters in the font
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int nchars =
|
2012-05-14 21:29:27 +02:00
|
|
|
|
102 // base
|
|
|
|
|
+ 18 // polish
|
|
|
|
|
+ 66 // russian
|
|
|
|
|
+ 30 // czech
|
|
|
|
|
+ 8 // francais
|
|
|
|
|
+ 5; // deutsch
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
load(RES_F_MACC, nchars, 11, 16);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
// Default
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lDefault = 10;
|
|
|
|
|
_hDefault = 17;
|
|
|
|
|
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-05-03 00:49:59 +10:00
|
|
|
|
for (i = 0; i < 256; i++) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[i] = -1;
|
|
|
|
|
_lTable[i] = _lDefault;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 26; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['A' + i] = i + 0;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 26; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['a' + i] = i + 26;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 10; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['0' + i] = i + 52;
|
|
|
|
|
|
|
|
|
|
_cTable['!'] = 62;
|
|
|
|
|
//_cTable['!'] = 63; // ! rovescia
|
|
|
|
|
_cTable['\"'] = 64;
|
|
|
|
|
_cTable['$'] = 65;
|
|
|
|
|
_cTable['%'] = 66;
|
|
|
|
|
_cTable['&'] = 67;
|
|
|
|
|
_cTable['/'] = 68;
|
|
|
|
|
_cTable['('] = 69;
|
|
|
|
|
_cTable[')'] = 70;
|
|
|
|
|
_cTable['='] = 71;
|
|
|
|
|
_cTable['?'] = 72;
|
|
|
|
|
//_cTable['?'] = 73; // ? rovescia
|
|
|
|
|
_cTable['*'] = 74;
|
|
|
|
|
_cTable['+'] = 75;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 76;
|
|
|
|
|
_cTable[';'] = 77;
|
|
|
|
|
_cTable[','] = 78;
|
|
|
|
|
_cTable['.'] = 79;
|
|
|
|
|
_cTable[':'] = 80;
|
|
|
|
|
_cTable['-'] = 81;
|
|
|
|
|
_cTable['<'] = 82;
|
|
|
|
|
_cTable['>'] = 83;
|
|
|
|
|
_cTable['/'] = 84;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 85;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 86;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 87;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 88;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 89;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 90;
|
|
|
|
|
//_cTable[(byte)''] = 91; // e with ball
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 92;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 93;
|
|
|
|
|
//_cTable[(byte)''] = 94; // i with ball
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 95;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 96;
|
|
|
|
|
//_cTable[(byte)''] = 97; // o with ball
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 98;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 99;
|
|
|
|
|
//_cTable[(byte)''] = 100; // u with ball
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 101;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-21 23:53:13 +02:00
|
|
|
|
if (_vm->getLanguage() == Common::PL_POL) {
|
2012-05-20 10:52:08 +10:00
|
|
|
|
// Polish characters
|
|
|
|
|
//AaCcEeLlNnOoSsZzZz
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ꣳ<EFBFBD><EAA3B3><EFBFBD><EFBFBD><F38C9CAF><EFBFBD>
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 102;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 103;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 104;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 105;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 106;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 107;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 108;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 109;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 110;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 111;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 112;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 113;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 114;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 115;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 116;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 117;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 118;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 119;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::RU_RUS) {
|
|
|
|
|
// Russian Characters
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
|
2012-05-21 23:53:13 +02:00
|
|
|
|
// allowing for further translations. To support Tonyin other langauges,
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// these mappings could be used as a basis
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 120;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 121;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 122;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 123;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 124;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 125;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 126;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 127;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 128;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 129;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 130;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 131;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 132;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 133;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 134;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 135;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 136;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 137;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 138;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 139;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 140;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 141;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 142;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 143;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 144;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 145;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 146;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 147;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 148;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 149;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 150;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 151;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 152;
|
|
|
|
|
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 153;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 154;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 155;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 156;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 157;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 158;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 159;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 160;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 161;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 162;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 163;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 164;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 165;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 166;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 167;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 168;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 169;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 170;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 171;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 172;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 173;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 174;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 175;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 176;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 177;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 178;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 179;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 180;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 181;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 182;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 183;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 184;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 185;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 8;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::CZ_CZE) {
|
|
|
|
|
// Czech
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 186;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 187;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 188;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 189;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 190;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 191;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 192;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 193;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 194;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 195;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 196;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 197;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 198;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 199;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 200;
|
|
|
|
|
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 201;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 202;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 203;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 204;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 205;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 206;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 207;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 208;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 209;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 210;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 211;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 212;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 213;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 214;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 215;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 9;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::FR_FRA) {
|
|
|
|
|
// French
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 226;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 227;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 228;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 229;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 230;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 231;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 232;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 233;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 8;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::DE_DEU) {
|
|
|
|
|
// German
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 234;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
// 'SS' = 235
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 236;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 237;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 238;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***************************************************************************\
|
2012-05-20 15:28:48 +10:00
|
|
|
|
* RMFontCredits Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMFontCredits::init(void) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int i;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// bernie: Number of characters in the font
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int nchars =
|
2012-05-14 21:29:27 +02:00
|
|
|
|
112 // base
|
|
|
|
|
+ 18 // polish
|
|
|
|
|
+ 66 // russian
|
|
|
|
|
+ 30 // czech
|
|
|
|
|
+ 8 // french
|
|
|
|
|
+ 2; // deutsch
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
load(RES_F_CREDITS, nchars, 27, 28, RES_F_CPAL);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
// Default
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lDefault = 10;
|
|
|
|
|
_hDefault = 28;
|
|
|
|
|
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-05-03 23:08:19 +10:00
|
|
|
|
for (i = 0; i < 256; i++) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[i] = -1;
|
|
|
|
|
_lTable[i] = _lDefault;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 26; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['A' + i] = i + 0;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 26; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['a' + i] = i + 26;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 52;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 53;
|
|
|
|
|
// _cTable[''] = 54; // a ^
|
|
|
|
|
// _cTable[''] = 55; // a pallini
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 56;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 57;
|
|
|
|
|
// _cTable[''] = 58; // e ^
|
|
|
|
|
// _cTable[''] = 59; // e pallini
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 60;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 61;
|
|
|
|
|
// _cTable[''] = 62; // i ^
|
|
|
|
|
// _cTable[''] = 63; // i pallini
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 64;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 65;
|
|
|
|
|
// _cTable[''] = 66; // o ^
|
|
|
|
|
// _cTable[''] = 67; // o pallini
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 68;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 69;
|
|
|
|
|
// _cTable[''] = 70; // u ^
|
|
|
|
|
// _cTable[''] = 71; // u pallini
|
|
|
|
|
// _cTable[''] = 72; // y pallini
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 73;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 74;
|
|
|
|
|
// _cTable[''] = 75; // o barrato
|
|
|
|
|
// _cTable[''] = 76; // ac
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 77;
|
|
|
|
|
// _cTable[''] = 78; // ? rovesciato
|
|
|
|
|
_cTable['?'] = 79;
|
|
|
|
|
// _cTable[''] = 80; // ! rovesciato
|
|
|
|
|
_cTable['!'] = 81;
|
|
|
|
|
// _cTable[''] = 82; // 1/2
|
|
|
|
|
// _cTable[''] = 83; // 1/4
|
|
|
|
|
_cTable['('] = 84;
|
|
|
|
|
_cTable[')'] = 85;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 86;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 87;
|
|
|
|
|
// _cTable[''] = 88; // AE
|
|
|
|
|
_cTable[':'] = 89;
|
|
|
|
|
_cTable['%'] = 90;
|
|
|
|
|
_cTable['&'] = 91;
|
|
|
|
|
_cTable['/'] = 92;
|
|
|
|
|
_cTable['+'] = 93;
|
|
|
|
|
_cTable[';'] = 94;
|
|
|
|
|
_cTable[','] = 95;
|
|
|
|
|
_cTable['^'] = 96;
|
|
|
|
|
_cTable['='] = 97;
|
|
|
|
|
_cTable['_'] = 98;
|
|
|
|
|
_cTable['*'] = 99;
|
|
|
|
|
_cTable['.'] = 100;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < 10; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['0' + i] = i + 101;
|
|
|
|
|
_cTable['\''] = 111;
|
|
|
|
|
|
|
|
|
|
_lTable[' '] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable['A'] = 19;
|
|
|
|
|
_lTable['B'] = 15;
|
|
|
|
|
_lTable['C'] = 14;
|
|
|
|
|
_lTable['D'] = 13;
|
|
|
|
|
_lTable['E'] = 14;
|
|
|
|
|
_lTable['F'] = 13;
|
|
|
|
|
_lTable['G'] = 16;
|
|
|
|
|
_lTable['H'] = 15;
|
|
|
|
|
_lTable['I'] = 5;
|
|
|
|
|
_lTable['J'] = 8;
|
|
|
|
|
_lTable['K'] = 15;
|
|
|
|
|
_lTable['L'] = 13;
|
|
|
|
|
_lTable['M'] = 17;
|
|
|
|
|
_lTable['N'] = 15;
|
|
|
|
|
_lTable['<EFBFBD>'] = _lTable['O'] = 14;
|
|
|
|
|
_lTable['P'] = 12;
|
|
|
|
|
_lTable['Q'] = 14;
|
|
|
|
|
_lTable['R'] = 14;
|
|
|
|
|
_lTable['S'] = 15;
|
|
|
|
|
_lTable['T'] = 11;
|
|
|
|
|
_lTable['<EFBFBD>'] = _lTable['U'] = 12;
|
|
|
|
|
_lTable['V'] = 12;
|
|
|
|
|
_lTable['W'] = 16;
|
|
|
|
|
_lTable['X'] = 12;
|
|
|
|
|
_lTable['Y'] = 13;
|
|
|
|
|
_lTable['Z'] = 14;
|
|
|
|
|
|
|
|
|
|
_lTable['a'] = 11;
|
|
|
|
|
_lTable['b'] = 9;
|
|
|
|
|
_lTable['c'] = 9;
|
|
|
|
|
_lTable['d'] = 10;
|
|
|
|
|
_lTable['e'] = 9;
|
|
|
|
|
_lTable['f'] = 8;
|
|
|
|
|
_lTable['g'] = 9;
|
|
|
|
|
_lTable['h'] = 10;
|
|
|
|
|
_lTable['i'] = 5;
|
|
|
|
|
_lTable['j'] = 6;
|
|
|
|
|
_lTable['k'] = 12;
|
|
|
|
|
_lTable['l'] = 6;
|
|
|
|
|
_lTable['m'] = 14;
|
|
|
|
|
_lTable['n'] = 10;
|
|
|
|
|
_lTable['o'] = 11;
|
|
|
|
|
_lTable['p'] = 11;
|
|
|
|
|
_lTable['q'] = 9;
|
|
|
|
|
_lTable['r'] = 9;
|
|
|
|
|
_lTable['s'] = 9;
|
|
|
|
|
_lTable['t'] = 6;
|
|
|
|
|
_lTable['u'] = 9;
|
|
|
|
|
_lTable['v'] = 10;
|
|
|
|
|
_lTable['w'] = 14;
|
|
|
|
|
_lTable['x'] = 9;
|
|
|
|
|
_lTable['y'] = 10;
|
|
|
|
|
_lTable['z'] = 9;
|
|
|
|
|
|
|
|
|
|
_lTable['0'] = 12;
|
|
|
|
|
_lTable['1'] = 8;
|
|
|
|
|
_lTable['2'] = 10;
|
|
|
|
|
_lTable['3'] = 11;
|
|
|
|
|
_lTable['4'] = 12;
|
|
|
|
|
_lTable['5'] = 11;
|
|
|
|
|
_lTable['6'] = 12;
|
|
|
|
|
_lTable['7'] = 10;
|
|
|
|
|
_lTable['8'] = 11;
|
|
|
|
|
_lTable['9'] = 10;
|
|
|
|
|
|
|
|
|
|
_lTable['/'] = 10;
|
|
|
|
|
_lTable['^'] = 9;
|
|
|
|
|
_lTable[','] = 5;
|
|
|
|
|
_lTable['.'] = 5;
|
|
|
|
|
_lTable[';'] = 5;
|
|
|
|
|
_lTable[':'] = 5;
|
|
|
|
|
_lTable['\''] = 5;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 09:57:24 +10:00
|
|
|
|
if (_vm->getLanguage() == Common::PL_POL) {
|
|
|
|
|
// Polish characters
|
|
|
|
|
//AaCcEeLlNnOoSsZzZz
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ꣳ<EFBFBD><EAA3B3><EFBFBD><EFBFBD><F38C9CAF><EFBFBD>
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 112;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 113;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 114;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 115;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 116;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 117;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 118;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 119;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 120;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 121;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 122;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 123;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 124;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 125;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 126;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 127;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 128;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 129;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
2012-05-20 09:57:24 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::RU_RUS) {
|
|
|
|
|
// Russian Characters
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
|
2012-05-21 23:53:13 +02:00
|
|
|
|
// allowing for further translations. To support Tonyin other langauges,
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// these mappings could be used as a basis
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 130;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 131;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 132;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 133;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 134;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 135;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 136;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 137;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 138;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 139;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 140;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 141;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 142;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 143;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 144;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 145;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 146;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 147;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 148;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 149;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 150;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 151;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 152;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 153;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 154;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 155;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 156;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 157;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 158;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 159;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 160;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 161;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 162;
|
|
|
|
|
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 163;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 164;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 165;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 166;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 167;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 168;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 169;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 170;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 171;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 172;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 173;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 174;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 175;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 176;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 177;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 178;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 179;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 180;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 181;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 182;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 183;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 184;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 185;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 186;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 187;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 188;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 189;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 190;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 191;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 192;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 193;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 194;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 195;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 22;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 22;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 23;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 23;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
2012-05-20 09:57:24 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::CZ_CZE) {
|
|
|
|
|
// CZECH Language
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 196;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 197;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 198;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 199;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 200;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 201;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 202;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 203;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 204;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 205;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 206;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 207;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 208;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 209;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 210;
|
|
|
|
|
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 211;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 212;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 213;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 214;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 215;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 216;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 217;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 218;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 219;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 220;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 221;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 222;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 223;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 224;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 225;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 14;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 7;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 19;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 13;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 6;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
2012-05-20 09:57:24 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::FR_FRA) {
|
|
|
|
|
// French
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 226;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 227;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 228;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 229;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 230;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 231;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 232;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 233;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 12;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 6;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 10;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
2012-05-20 09:57:24 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::DE_DEU) {
|
|
|
|
|
// German
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 234;
|
2012-05-20 09:57:24 +10:00
|
|
|
|
// 'SS' = 235
|
|
|
|
|
|
|
|
|
|
// old chars overrides
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 55;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 67;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 71;
|
2012-05-20 09:57:24 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 11;
|
2012-05-20 09:57:24 +10:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************\
|
|
|
|
|
* Metodi di RMFontObj
|
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
2012-05-23 00:19:46 +02:00
|
|
|
|
#define TOUPPER(a) ((a) >= 'a' && (a) <= 'z' ? (a) + 'A' - 'a' : (a))
|
|
|
|
|
#define TOLOWER(a) ((a) >= 'A' && (a) <= 'Z' ? (a) + 'a' - 'A' : (a))
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMFontObj::setBothCase(int nChar, int nNext, signed char spiazz) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_l2Table[TOUPPER(nChar)][TOUPPER(nNext)] = spiazz;
|
|
|
|
|
_l2Table[TOUPPER(nChar)][TOLOWER(nNext)] = spiazz;
|
|
|
|
|
_l2Table[TOLOWER(nChar)][TOUPPER(nNext)] = spiazz;
|
|
|
|
|
_l2Table[TOLOWER(nChar)][TOLOWER(nNext)] = spiazz;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMFontObj::init(void) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int i;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
//bernie: Number of characters in the font (solo maiuscolo)
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int nchars =
|
2012-05-14 21:29:27 +02:00
|
|
|
|
85 // base
|
|
|
|
|
+ 9 // polish
|
|
|
|
|
+ 33 // russian
|
|
|
|
|
+ 15 // czech
|
|
|
|
|
+ 0 // francais (no uppercase chars)
|
|
|
|
|
+ 1; // deutsch
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
load(RES_F_OBJ, nchars, 25, 30);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-17 18:36:23 +02:00
|
|
|
|
// Initialize the f**king table
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lDefault = 26;
|
|
|
|
|
_hDefault = 30;
|
|
|
|
|
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-03 23:08:19 +10:00
|
|
|
|
for (i = 0; i < 256; i++) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[i] = -1;
|
|
|
|
|
_lTable[i] = _lDefault;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-03 23:08:19 +10:00
|
|
|
|
for (i = 0; i < 26; i++) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['A' + i] = i + 0;
|
|
|
|
|
_cTable['a' + i] = i + 0;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 10; i++)
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['0' + i] = i + 26;
|
|
|
|
|
|
|
|
|
|
_cTable[','] = 36;
|
|
|
|
|
_cTable[';'] = 37;
|
|
|
|
|
_cTable['.'] = 38;
|
|
|
|
|
_cTable[':'] = 39;
|
|
|
|
|
_cTable['-'] = 40;
|
|
|
|
|
_cTable['+'] = 41;
|
|
|
|
|
_cTable['!'] = 42;
|
|
|
|
|
// _cTable['!'] = 43; Exclamation countdown
|
|
|
|
|
_cTable['?'] = 44;
|
|
|
|
|
// _cTable['?'] = 45; Interrogativo alla rovescia
|
|
|
|
|
_cTable['/'] = 46;
|
|
|
|
|
_cTable['('] = 47;
|
|
|
|
|
_cTable[')'] = 48;
|
|
|
|
|
_cTable['='] = 49;
|
|
|
|
|
_cTable['\''] = 50;
|
|
|
|
|
_cTable['\"'] = 51;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 52;
|
|
|
|
|
_cTable[(byte)'$'] = 53;
|
|
|
|
|
_cTable[(byte)'%'] = 54;
|
|
|
|
|
_cTable[(byte)'&'] = 55;
|
|
|
|
|
_cTable[(byte)'^'] = 56;
|
|
|
|
|
_cTable[(byte)'*'] = 57;
|
|
|
|
|
_cTable[(byte)'<'] = 58;
|
|
|
|
|
_cTable[(byte)'>'] = 59;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 60;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 61;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 62;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 63;
|
|
|
|
|
//_cTable[(byte)'<27>'] = 64; integral
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 65;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 66;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 67;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 68;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 69;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 70;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 71;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 72;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 73;
|
|
|
|
|
//_cTable[(byte)' '] = 74; e circlet
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 75;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 76;
|
|
|
|
|
//_cTable[(byte)' '] = 77; i circlet
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 78;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 79;
|
|
|
|
|
//_cTable[(byte)' '] = 80; o circlet
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = 81;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 82;
|
|
|
|
|
//_cTable[' '] = 83; u circlet
|
|
|
|
|
//_cTable[' '] = 84; y dieresi
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
/* Little lengths */
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lTable[' '] = 11;
|
|
|
|
|
_lTable['.'] = 8;
|
|
|
|
|
_lTable['-'] = 12;
|
|
|
|
|
_lTable['\''] = 8;
|
|
|
|
|
_lTable['0'] = 20;
|
|
|
|
|
_lTable['1'] = 20;
|
|
|
|
|
_lTable['2'] = 15;
|
|
|
|
|
_lTable['3'] = 20;
|
|
|
|
|
_lTable['4'] = 20;
|
|
|
|
|
_lTable['5'] = 20;
|
|
|
|
|
_lTable['6'] = 20;
|
|
|
|
|
_lTable['7'] = 20;
|
|
|
|
|
_lTable['8'] = 20;
|
|
|
|
|
_lTable['9'] = 20;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_lTable['a'] = _lTable['A'] = _lTable['<EFBFBD>'] = _lTable['<EFBFBD>'] = 17;
|
|
|
|
|
_lTable['b'] = _lTable['B'] = 17;
|
|
|
|
|
_lTable['c'] = _lTable['C'] = 19;
|
|
|
|
|
_lTable['d'] = _lTable['D'] = 17;
|
|
|
|
|
_lTable['e'] = _lTable['E'] = 15;
|
|
|
|
|
_lTable['f'] = _lTable['F'] = 17;
|
|
|
|
|
_lTable['g'] = _lTable['G'] = 19;
|
|
|
|
|
_lTable['i'] = _lTable['I'] = 16;
|
|
|
|
|
_lTable['h'] = _lTable['H'] = 17;
|
|
|
|
|
_lTable['k'] = _lTable['K'] = 17;
|
|
|
|
|
_lTable['l'] = _lTable['L'] = 14;
|
|
|
|
|
_lTable['m'] = _lTable['M'] = 19;
|
|
|
|
|
_lTable['n'] = _lTable['N'] = 17;
|
|
|
|
|
_lTable['o'] = _lTable['O'] = _lTable['<EFBFBD>'] = _lTable['<EFBFBD>'] = 19;
|
|
|
|
|
_lTable['p'] = _lTable['P'] = 17;
|
|
|
|
|
_lTable['q'] = _lTable['Q'] = 19;
|
|
|
|
|
_lTable['r'] = _lTable['R'] = 14;
|
|
|
|
|
_lTable['s'] = _lTable['S'] = 13;
|
|
|
|
|
_lTable['t'] = _lTable['T'] = 15;
|
|
|
|
|
_lTable['u'] = _lTable['U'] = _lTable['<EFBFBD>'] = _lTable['<EFBFBD>'] = 15;
|
|
|
|
|
_lTable['v'] = _lTable['V'] = 13;
|
|
|
|
|
_lTable['x'] = _lTable['X'] = 15;
|
|
|
|
|
_lTable['y'] = _lTable['Y'] = 13;
|
|
|
|
|
_lTable['w'] = _lTable['W'] = 19;
|
|
|
|
|
_lTable['z'] = _lTable['Z'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = 17;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
/* Casi particolari */
|
2012-06-06 08:04:33 +02:00
|
|
|
|
setBothCase('C', 'C', 2);
|
|
|
|
|
setBothCase('A', 'T', -2);
|
|
|
|
|
setBothCase('R', 'S', 2);
|
|
|
|
|
setBothCase('H', 'I', -2);
|
|
|
|
|
setBothCase('T', 'S', 2);
|
|
|
|
|
setBothCase('O', 'R', 2);
|
|
|
|
|
setBothCase('O', 'L', 2);
|
|
|
|
|
setBothCase('O', 'G', 2);
|
|
|
|
|
setBothCase('Z', 'A', -1);
|
|
|
|
|
setBothCase('R', 'R', 1);
|
|
|
|
|
setBothCase('R', 'U', 3);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-21 23:53:13 +02:00
|
|
|
|
if (_vm->getLanguage() == Common::PL_POL) {
|
2012-05-20 10:52:08 +10:00
|
|
|
|
// Polish characters
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ꣳ<EFBFBD><EAA3B3><EFBFBD><EFBFBD><F38C9CAF><EFBFBD>
|
|
|
|
|
//AaCcEeLlNnOoSsZzZz
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 85;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 20;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 86;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 22;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 87;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 17;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 88;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 19;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 89;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 17;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 90;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 22;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 91;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 15;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 92;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 21;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 93;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 21;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::RU_RUS) {
|
|
|
|
|
// Russian Characters
|
2012-05-21 23:53:13 +02:00
|
|
|
|
// WARNING: The Russian font uses many of the ISO-Latin-1 font,
|
|
|
|
|
// allowing for further translations. To support Tonyin other langauges,
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// these mappings could be used as a basis
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 85;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 94;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 95;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 96;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 97;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 98;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 99;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 100;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 101;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 102;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 103;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 104;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 105;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 106;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 107;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 108;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 109;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 110;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 111;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 112;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 113;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 114;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 115;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 116;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 117;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 118;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 119;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 120;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 121;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 122;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 123;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 124;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 125;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 126;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 17;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 22;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 22;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 19;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 21;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 20;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 19;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 22;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 19;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 19;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::CZ_CZE) {
|
|
|
|
|
// Czech
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 127;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 128;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 129;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 130;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 131;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 132;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 133;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 134;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 135;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 136;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 137;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 138;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 139;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 140;
|
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 141;
|
|
|
|
|
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 17;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 15;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 22;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 21;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 18;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 19;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 17;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 23;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 24;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 17;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 22;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-05-21 23:53:13 +02:00
|
|
|
|
} else if (_vm->getLanguage() == Common::FR_FRA) {
|
2012-05-20 10:52:08 +10:00
|
|
|
|
// French
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Translate accented characters as normal letters
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 0; // a
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 17;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 4; // e
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 15;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 8; // i
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 16;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 14; // o
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 19;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable[(byte)'<EFBFBD>'] = _cTable[(byte)'<EFBFBD>'] = 20; // u
|
|
|
|
|
_lTable[(byte)'<EFBFBD>'] = _lTable[(byte)'<EFBFBD>'] = 15;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
|
|
|
|
|
} else if (_vm->getLanguage() == Common::DE_DEU) {
|
|
|
|
|
// German
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_cTable['<EFBFBD>'] = 142;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
// SS = 143
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_lTable['<EFBFBD>'] = 24;
|
2012-05-20 10:52:08 +10:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************\
|
2012-05-20 15:28:48 +10:00
|
|
|
|
* RMText Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
RMFontColor *RMText::_fonts[4] = { NULL, NULL, NULL, NULL };
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMText::initStatics() {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
Common::fill(&_fonts[0], &_fonts[4], (RMFontColor *)NULL);
|
2012-05-13 23:05:41 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-03 00:49:59 +10:00
|
|
|
|
RMText::RMText() {
|
2012-06-17 18:36:23 +02:00
|
|
|
|
// Default color: white
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_textR = _textG = _textB = 255;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Default length
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_maxLineLength = 350;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
_bTrasp0 = true;
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_aHorType = HCENTER;
|
|
|
|
|
_aVerType = VTOP;
|
2012-06-05 08:39:55 +02:00
|
|
|
|
setPriority(150);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RMText::~RMText() {
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMText::unload() {
|
|
|
|
|
if (_fonts[0] != NULL) {
|
|
|
|
|
delete _fonts[0];
|
|
|
|
|
delete _fonts[1];
|
|
|
|
|
delete _fonts[2];
|
|
|
|
|
delete _fonts[3];
|
|
|
|
|
_fonts[0] = _fonts[1] = _fonts[2] = _fonts[3] = 0;
|
2012-05-05 10:56:56 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMText::setMaxLineLength(int max) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_maxLineLength = max;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 18:51:20 +02:00
|
|
|
|
void RMText::removeThis(CORO_PARAM, bool &result) {
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Here we can do checks on the number of frames, time spent, etc.
|
2012-05-12 20:49:36 +10:00
|
|
|
|
result = true;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMText::writeText(const RMString &text, int nFont, int *time) {
|
2012-06-17 18:36:23 +02:00
|
|
|
|
// Initializes the font (only once)
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_fonts[0] == NULL) {
|
|
|
|
|
_fonts[0] = new RMFontParla;
|
|
|
|
|
_fonts[0]->init();
|
|
|
|
|
_fonts[1] = new RMFontObj;
|
|
|
|
|
_fonts[1]->init();
|
|
|
|
|
_fonts[2] = new RMFontMacc;
|
|
|
|
|
_fonts[2]->init();
|
|
|
|
|
_fonts[3] = new RMFontCredits;
|
|
|
|
|
_fonts[3]->init();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
writeText(text, _fonts[nFont], time);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMText::writeText(const RMString &text, RMFontColor *font, int *time) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
RMGfxPrimitive *prim;
|
|
|
|
|
char *p, *old_p;
|
|
|
|
|
int i, j, x, y;
|
|
|
|
|
int len;
|
|
|
|
|
int numchar;
|
|
|
|
|
int width, height;
|
|
|
|
|
char *string;
|
|
|
|
|
int numlines;
|
|
|
|
|
|
2012-06-17 18:36:23 +02:00
|
|
|
|
// Set the base color
|
2012-06-11 00:34:45 +02:00
|
|
|
|
font->setBaseColor(_textR, _textG, _textB);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Destroy the buffer before starting
|
2012-06-05 08:39:55 +02:00
|
|
|
|
destroy();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// If the string is empty, do nothing
|
2012-05-03 00:49:59 +10:00
|
|
|
|
if (text == NULL || text[0] == '\0')
|
|
|
|
|
return;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Divide the words into lines. In this cycle, X contains the maximum length reached by a line,
|
|
|
|
|
// and the number of lines
|
2012-05-14 21:29:27 +02:00
|
|
|
|
string = p = text;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
i = j = x = 0;
|
|
|
|
|
while (*p != '\0') {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
j += font->stringLen(*p);
|
2012-06-11 00:34:45 +02:00
|
|
|
|
if (j > (((_aHorType == HLEFTPAR) && (i > 0)) ? _maxLineLength - 25 : _maxLineLength)) {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
j -= font->stringLen(*p, p[1]);
|
2012-05-23 00:19:46 +02:00
|
|
|
|
if (j > x)
|
|
|
|
|
x = j;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Back to the first usable space
|
2012-05-03 00:49:59 +10:00
|
|
|
|
//
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// BERNIE: In the original, sentences containing words that exceed the
|
2012-05-21 23:53:13 +02:00
|
|
|
|
// width of a line caused discontinuation of the whole sentence.
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// This workaround has the partial word broken up so it will still display
|
2012-05-03 00:49:59 +10:00
|
|
|
|
//
|
|
|
|
|
old_p = p;
|
2012-05-23 00:19:46 +02:00
|
|
|
|
while (*p != ' ' && *p != '-' && p > string)
|
|
|
|
|
p--;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
if (p == string)
|
|
|
|
|
p = old_p;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Check if there are any blanks to end
|
2012-05-23 00:19:46 +02:00
|
|
|
|
while (*p == ' ' && *p != '\0')
|
|
|
|
|
p++;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
if (*p == '\0')
|
|
|
|
|
break;
|
|
|
|
|
p--;
|
|
|
|
|
i++;
|
|
|
|
|
*p = '\0';
|
|
|
|
|
j = 0;
|
|
|
|
|
}
|
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-23 00:19:46 +02:00
|
|
|
|
if (j > x)
|
|
|
|
|
x = j;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-05-03 00:49:59 +10:00
|
|
|
|
i++;
|
|
|
|
|
numlines = i;
|
|
|
|
|
|
|
|
|
|
x += 8;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Starting position for the surface: X1, Y
|
2012-05-03 00:49:59 +10:00
|
|
|
|
width = x;
|
2012-06-06 08:04:33 +02:00
|
|
|
|
height = (numlines - 1) * font->letterHeight() + font->_fontDimy;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Create the surface
|
2012-06-07 21:14:59 +02:00
|
|
|
|
create(width, height);
|
2012-06-05 08:39:55 +02:00
|
|
|
|
Common::fill(_buf, _buf + width * height * 2, 0);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
p = string;
|
|
|
|
|
|
|
|
|
|
y = 0;
|
|
|
|
|
numchar = 0;
|
|
|
|
|
for (; i > 0; i--) {
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Measure the length of the line
|
2012-05-03 00:49:59 +10:00
|
|
|
|
x = 0;
|
2012-06-06 08:04:33 +02:00
|
|
|
|
j = font->stringLen(RMString(p));
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
switch (_aHorType) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
case HLEFT:
|
|
|
|
|
x = 0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case HLEFTPAR:
|
|
|
|
|
if (i == numlines)
|
2012-05-14 21:29:27 +02:00
|
|
|
|
x = 0;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
else
|
|
|
|
|
x = 25;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case HCENTER:
|
|
|
|
|
x = width / 2 - j / 2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case HRIGHT:
|
|
|
|
|
x = width - j - 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (*p != '\0') {
|
|
|
|
|
if (*p == ' ') {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
x += font->stringLen(*p);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
p++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
prim = font->makeLetterPrimitive(*p, len);
|
2012-06-11 20:24:25 +02:00
|
|
|
|
prim->getDst()._x1 = x;
|
|
|
|
|
prim->getDst()._y1 = y;
|
2012-06-05 08:39:55 +02:00
|
|
|
|
addPrim(prim);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
numchar++;
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
x += font->stringLen(*p, p[1]);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
p++;
|
|
|
|
|
}
|
|
|
|
|
p++;
|
2012-06-06 08:04:33 +02:00
|
|
|
|
y += font->letterHeight();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (time != NULL)
|
2012-06-09 00:52:38 +02:00
|
|
|
|
*time = 1000 + numchar * (11 - GLOBALS._nCfgTextSpeed) * 14;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMText::clipOnScreen(RMGfxPrimitive *prim) {
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Don't let it go outside the screen
|
2012-06-11 20:24:25 +02:00
|
|
|
|
if (prim->getDst()._x1 < 5)
|
|
|
|
|
prim->getDst()._x1 = 5;
|
|
|
|
|
if (prim->getDst()._y1 < 5)
|
|
|
|
|
prim->getDst()._y1 = 5;
|
|
|
|
|
if (prim->getDst()._x1 + _dimx > 635)
|
|
|
|
|
prim->getDst()._x1 = 635 - _dimx;
|
|
|
|
|
if (prim->getDst()._y1 + _dimy > 475)
|
|
|
|
|
prim->getDst()._y1 = 475 - _dimy;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMText::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Horizontally
|
2012-06-11 00:34:45 +02:00
|
|
|
|
if (_aHorType == HCENTER)
|
2012-06-07 21:14:59 +02:00
|
|
|
|
prim->getDst().topLeft() -= RMPoint(_dimx / 2, 0);
|
2012-06-11 00:34:45 +02:00
|
|
|
|
else if (_aHorType == HRIGHT)
|
2012-06-07 21:14:59 +02:00
|
|
|
|
prim->getDst().topLeft() -= RMPoint(_dimx, 0);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Vertically
|
2012-06-11 00:34:45 +02:00
|
|
|
|
if (_aVerType == VTOP) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
} else if (_aVerType == VCENTER) {
|
2012-06-11 20:24:25 +02:00
|
|
|
|
prim->getDst()._y1 -= _dimy / 2;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
} else if (_aVerType == VBOTTOM) {
|
2012-06-11 20:24:25 +02:00
|
|
|
|
prim->getDst()._y1 -= _dimy;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
clipOnScreen(prim);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
CORO_INVOKE_2(RMGfxWoodyBuffer::draw, bigBuf, prim);
|
2012-05-12 20:49:36 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************\
|
2012-05-20 15:28:48 +10:00
|
|
|
|
* RMTextDialog Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
|
|
|
|
RMTextDialog::RMTextDialog() : RMText() {
|
2012-06-14 00:11:56 +02:00
|
|
|
|
_time = _startTime = 0;
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_dst = RMPoint(0, 0);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_bSkipStatus = true;
|
|
|
|
|
_bShowed = true;
|
|
|
|
|
_bForceTime = false;
|
|
|
|
|
_bForceNoTime = false;
|
|
|
|
|
_bAlwaysDisplay = false;
|
|
|
|
|
_bNoTab = false;
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_hCustomSkip = CORO_INVALID_PID_VALUE;
|
|
|
|
|
_hCustomSkip2 = CORO_INVALID_PID_VALUE;
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_input = NULL;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Create the event for displaying the end
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_hEndDisplay = CoroScheduler.createEvent(false, false);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RMTextDialog::~RMTextDialog() {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
CoroScheduler.closeEvent(_hEndDisplay);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::show(void) {
|
|
|
|
|
_bShowed = true;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::hide(CORO_PARAM) {
|
|
|
|
|
_bShowed = false;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::writeText(const RMString &text, int font, int *time) {
|
|
|
|
|
RMText::writeText(text, font, &_time);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
if (time != NULL)
|
2012-06-06 08:04:33 +02:00
|
|
|
|
*time = _time;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::writeText(const RMString &text, RMFontColor *font, int *time) {
|
|
|
|
|
RMText::writeText(text, font, &_time);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
if (time != NULL)
|
2012-06-06 08:04:33 +02:00
|
|
|
|
*time = _time;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::setSkipStatus(bool bEnabled) {
|
|
|
|
|
_bSkipStatus = bEnabled;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::forceTime(void) {
|
|
|
|
|
_bForceTime = true;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::forceNoTime(void) {
|
|
|
|
|
_bForceNoTime = true;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::setNoTab(void) {
|
|
|
|
|
_bNoTab = true;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::setForcedTime(uint32 dwTime) {
|
|
|
|
|
_time = dwTime;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::setAlwaysDisplay(void) {
|
|
|
|
|
_bAlwaysDisplay = true;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 18:51:20 +02:00
|
|
|
|
void RMTextDialog::removeThis(CORO_PARAM, bool &result) {
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
bool expired;
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
|
|
|
|
// Presume successful result
|
|
|
|
|
result = true;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Don't erase the background
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_bSkipStatus) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
if (!(GLOBALS._bCfgDubbing && _hCustomSkip2 != CORO_INVALID_PID_VALUE)) {
|
2012-06-09 00:52:38 +02:00
|
|
|
|
if (GLOBALS._bCfgTimerizedText) {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (!_bForceNoTime) {
|
|
|
|
|
if (_vm->getTime() > (uint32)_time + _startTime)
|
2012-05-09 00:42:27 +10:00
|
|
|
|
return;
|
2012-05-23 00:19:46 +02:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
2012-05-23 00:19:46 +02:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (!_bNoTab) {
|
2012-06-05 01:04:53 +02:00
|
|
|
|
if (_vm->getEngine()->getInput().getAsyncKeyState(Common::KEYCODE_TAB))
|
2012-05-09 00:42:27 +10:00
|
|
|
|
return;
|
2012-05-23 00:19:46 +02:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (!_bNoTab) {
|
|
|
|
|
if (_input) {
|
|
|
|
|
if (_input->mouseLeftClicked() || _input->mouseRightClicked())
|
2012-05-09 00:42:27 +10:00
|
|
|
|
return;
|
2012-05-23 00:19:46 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Erase the background
|
2012-06-11 00:34:45 +02:00
|
|
|
|
else if (!(GLOBALS._bCfgDubbing && _hCustomSkip2 != CORO_INVALID_PID_VALUE)) {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (!_bForceNoTime) {
|
|
|
|
|
if (_vm->getTime() > (uint32)_time + _startTime)
|
2012-05-23 00:19:46 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// If time is forced
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_bForceTime) {
|
|
|
|
|
if (_vm->getTime() > (uint32)_time + _startTime)
|
2012-05-09 00:42:27 +10:00
|
|
|
|
return;
|
2012-05-23 00:19:46 +02:00
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
if (_hCustomSkip != CORO_INVALID_PID_VALUE) {
|
|
|
|
|
CORO_INVOKE_3(CoroScheduler.waitForSingleObject, _hCustomSkip, 0, &_ctx->expired);
|
2012-05-09 00:42:27 +10:00
|
|
|
|
// == WAIT_OBJECT_0
|
|
|
|
|
if (!_ctx->expired)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
if (GLOBALS._bCfgDubbing && _hCustomSkip2 != CORO_INVALID_PID_VALUE) {
|
|
|
|
|
CORO_INVOKE_3(CoroScheduler.waitForSingleObject, _hCustomSkip2, 0, &_ctx->expired);
|
2012-05-09 00:42:27 +10:00
|
|
|
|
// == WAIT_OBJECT_0
|
|
|
|
|
if (!_ctx->expired)
|
|
|
|
|
return;
|
|
|
|
|
}
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-09 00:42:27 +10:00
|
|
|
|
result = false;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RMTextDialog::Unregister(void) {
|
|
|
|
|
RMGfxTask::Unregister();
|
2012-06-05 08:39:55 +02:00
|
|
|
|
assert(_nInList == 0);
|
2012-06-11 00:34:45 +02:00
|
|
|
|
CoroScheduler.setEvent(_hEndDisplay);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMTextDialog::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_startTime == 0)
|
|
|
|
|
_startTime = _vm->getTime();
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_bShowed) {
|
2012-06-17 17:04:10 +10:00
|
|
|
|
if (GLOBALS._bShowSubtitles || _bAlwaysDisplay) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
prim->getDst().topLeft() = _dst;
|
2012-06-05 08:39:55 +02:00
|
|
|
|
CORO_INVOKE_2(RMText::draw, bigBuf, prim);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-05-12 20:49:36 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::setCustomSkipHandle(uint32 hCustom) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_hCustomSkip = hCustom;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::setCustomSkipHandle2(uint32 hCustom) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_hCustomSkip2 = hCustom;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::waitForEndDisplay(CORO_PARAM) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
CoroScheduler.waitForSingleObject(coroParam, _hEndDisplay, CORO_INFINITE);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialog::setInput(RMInput *input) {
|
|
|
|
|
_input = input;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************************************\
|
2012-05-20 15:28:48 +10:00
|
|
|
|
* RMTextDialogScrolling Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
|
|
|
|
RMTextDialogScrolling::RMTextDialogScrolling() {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_curLoc = NULL;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RMTextDialogScrolling::RMTextDialogScrolling(RMLocation *loc) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_curLoc = loc;
|
|
|
|
|
_startScroll = loc->scrollPosition();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RMTextDialogScrolling::~RMTextDialogScrolling() {
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMTextDialogScrolling::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
RMPoint curDst;
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_ctx->curDst = _dst;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
if (_curLoc != NULL)
|
|
|
|
|
_dst -= _curLoc->scrollPosition() - _startScroll;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
CORO_INVOKE_2(RMTextDialog::draw, bigBuf, prim);
|
2012-05-12 20:49:36 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_dst = _ctx->curDst;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextDialogScrolling::clipOnScreen(RMGfxPrimitive *prim) {
|
2012-05-20 16:03:09 +10:00
|
|
|
|
// We must not do anything!
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************\
|
2012-05-09 23:15:41 +10:00
|
|
|
|
* RMTextItemName Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
|
|
|
|
RMTextItemName::RMTextItemName() : RMText() {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_item = NULL;
|
2012-06-05 08:39:55 +02:00
|
|
|
|
setPriority(220);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RMTextItemName::~RMTextItemName() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMTextItemName::doFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &loc, RMPointer &ptr, RMInventory &inv) {
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
RMItem *lastItem;
|
|
|
|
|
uint32 hThread;
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
2012-05-13 10:42:03 +10:00
|
|
|
|
RMString itemName;
|
|
|
|
|
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_ctx->lastItem = _item;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-09 23:15:41 +10:00
|
|
|
|
// Adds to the list if there is need
|
2012-06-05 08:39:55 +02:00
|
|
|
|
if (!_nInList)
|
|
|
|
|
bigBuf.addPrim(new RMGfxPrimitive(this));
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-05-09 23:15:41 +10:00
|
|
|
|
// Update the scrolling co-ordinates
|
2012-06-07 07:58:01 +02:00
|
|
|
|
_curscroll = loc.scrollPosition();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-09 23:15:41 +10:00
|
|
|
|
// Check if we are on the inventory
|
2012-06-06 08:31:06 +02:00
|
|
|
|
if (inv.itemInFocus(_mpos))
|
|
|
|
|
_item = inv.whichItemIsIn(_mpos);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
else
|
2012-06-07 07:58:01 +02:00
|
|
|
|
_item = loc.whichItemIsIn(_mpos);
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-05-13 10:42:03 +10:00
|
|
|
|
itemName = "";
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-19 11:05:57 +02:00
|
|
|
|
// If there an item, get its name
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_item != NULL)
|
2012-06-07 07:58:01 +02:00
|
|
|
|
_item->getName(itemName);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-09 23:15:41 +10:00
|
|
|
|
// Write it
|
2012-06-06 08:04:33 +02:00
|
|
|
|
writeText(itemName, 1);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-09 23:15:41 +10:00
|
|
|
|
// Handle the change If the selected item is different from the previous one
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_ctx->lastItem != _item) {
|
|
|
|
|
if (_item == NULL)
|
2012-06-06 01:37:06 +02:00
|
|
|
|
ptr.setSpecialPointer(RMPointer::PTR_NONE);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
else {
|
2012-06-07 07:58:01 +02:00
|
|
|
|
_ctx->hThread = mpalQueryDoAction(20, _item->mpalCode(), 0);
|
2012-05-11 23:15:59 +10:00
|
|
|
|
if (_ctx->hThread == CORO_INVALID_PID_VALUE)
|
2012-06-06 01:37:06 +02:00
|
|
|
|
ptr.setSpecialPointer(RMPointer::PTR_NONE);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
else
|
2012-05-11 23:15:59 +10:00
|
|
|
|
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->hThread, CORO_INFINITE);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-05-09 00:42:27 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMTextItemName::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
2012-05-20 16:03:09 +10:00
|
|
|
|
// If there is no text, it's pointless to continue
|
2012-06-05 08:39:55 +02:00
|
|
|
|
if (_buf == NULL)
|
2012-05-03 00:49:59 +10:00
|
|
|
|
return;
|
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Set the destination coordinates of the mouse
|
2012-06-07 21:14:59 +02:00
|
|
|
|
prim->getDst().topLeft() = _mpos - RMPoint(0, 30);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
CORO_INVOKE_2(RMText::draw, bigBuf, prim);
|
2012-05-12 20:49:36 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
RMPoint RMTextItemName::getHotspot() {
|
|
|
|
|
if (_item == NULL)
|
|
|
|
|
return _mpos + _curscroll;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
else
|
2012-06-07 07:58:01 +02:00
|
|
|
|
return _item->hotspot();
|
2012-05-03 22:49:30 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
RMItem *RMTextItemName::getSelectedItem() {
|
|
|
|
|
return _item;
|
2012-05-03 22:49:30 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
bool RMTextItemName::isItemSelected() {
|
|
|
|
|
return _item != NULL;
|
2012-05-03 22:49:30 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
bool RMTextItemName::isNormalItemSelected() {
|
2012-06-07 08:42:35 +02:00
|
|
|
|
return _item != NULL && _itemName.length() > 0;
|
2012-05-03 22:49:30 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
/****************************************************************************\
|
2012-05-20 15:28:48 +10:00
|
|
|
|
* RMDialogChoice Methods
|
2012-05-03 00:49:59 +10:00
|
|
|
|
\****************************************************************************/
|
|
|
|
|
|
|
|
|
|
RMDialogChoice::RMDialogChoice() {
|
|
|
|
|
RMResRaw dlg1(RES_I_DLGTEXT);
|
|
|
|
|
RMResRaw dlg2(RES_I_DLGTEXTLINE);
|
|
|
|
|
RMRes dlgpal(RES_I_DLGTEXTPAL);
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_dlgText.init(dlg1, dlg1.width(), dlg1.height());
|
|
|
|
|
_dlgTextLine.init(dlg2, dlg2.width(), dlg2.height());
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_dlgText.loadPaletteWA(dlgpal);
|
|
|
|
|
_dlgTextLine.loadPaletteWA(dlgpal);
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_hUnreg = CoroScheduler.createEvent(false, false);
|
|
|
|
|
_bRemoveFromOT = false;
|
2012-06-14 00:11:56 +02:00
|
|
|
|
|
|
|
|
|
_curAdded = 0;
|
|
|
|
|
_bShow = false;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RMDialogChoice::~RMDialogChoice() {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
CoroScheduler.closeEvent(_hUnreg);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RMDialogChoice::Unregister(void) {
|
|
|
|
|
RMGfxWoodyBuffer::Unregister();
|
2012-06-05 08:39:55 +02:00
|
|
|
|
assert(!_nInList);
|
2012-06-11 00:34:45 +02:00
|
|
|
|
CoroScheduler.pulseEvent(_hUnreg);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_bRemoveFromOT = false;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMDialogChoice::init(void) {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_numChoices = 0;
|
|
|
|
|
_drawedStrings = NULL;
|
|
|
|
|
_ptDrawStrings = NULL;
|
|
|
|
|
_curSelection = -1;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-07 21:14:59 +02:00
|
|
|
|
create(640, 477);
|
2012-06-05 08:39:55 +02:00
|
|
|
|
setPriority(140);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMDialogChoice::close(void) {
|
|
|
|
|
if (_drawedStrings != NULL) {
|
|
|
|
|
delete[] _drawedStrings;
|
|
|
|
|
_drawedStrings = NULL;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_ptDrawStrings != NULL) {
|
|
|
|
|
delete[] _ptDrawStrings;
|
|
|
|
|
_ptDrawStrings = NULL;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
destroy();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMDialogChoice::setNumChoices(int num) {
|
2012-05-03 00:49:59 +10:00
|
|
|
|
int i;
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_numChoices = num;
|
|
|
|
|
_curAdded = 0;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Allocate space for drawn strings
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_drawedStrings = new RMText[num];
|
|
|
|
|
_ptDrawStrings = new RMPoint[num];
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-17 19:39:58 +02:00
|
|
|
|
// Initialization
|
2012-06-06 08:04:33 +02:00
|
|
|
|
for (i = 0; i < _numChoices; i++) {
|
|
|
|
|
_drawedStrings[i].setColor(0, 255, 0);
|
|
|
|
|
_drawedStrings[i].setAlignType(RMText::HLEFTPAR, RMText::VTOP);
|
|
|
|
|
_drawedStrings[i].setMaxLineLength(600);
|
|
|
|
|
_drawedStrings[i].setPriority(10);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMDialogChoice::addChoice(const RMString &string) {
|
2012-05-20 15:28:48 +10:00
|
|
|
|
// Draw the string
|
2012-06-06 08:04:33 +02:00
|
|
|
|
assert(_curAdded < _numChoices);
|
|
|
|
|
_drawedStrings[_curAdded++].writeText(string, 0);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMDialogChoice::prepare(CORO_PARAM) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
int i;
|
|
|
|
|
RMPoint ptPos;
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 00:34:45 +02:00
|
|
|
|
addPrim(new RMGfxPrimitive(&_dlgText, RMPoint(0, 0)));
|
|
|
|
|
addPrim(new RMGfxPrimitive(&_dlgTextLine, RMPoint(0, 155)));
|
|
|
|
|
addPrim(new RMGfxPrimitive(&_dlgTextLine, RMPoint(0, 155 + 83)));
|
|
|
|
|
addPrim(new RMGfxPrimitive(&_dlgTextLine, RMPoint(0, 155 + 83 + 83)));
|
|
|
|
|
addPrim(new RMGfxPrimitive(&_dlgTextLine, RMPoint(0, 155 + 83 + 83 + 83)));
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-07 08:42:35 +02:00
|
|
|
|
_ctx->ptPos.set(20, 90);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
for (_ctx->i = 0; _ctx->i < _numChoices; _ctx->i++) {
|
|
|
|
|
addPrim(new RMGfxPrimitive(&_drawedStrings[_ctx->i], _ctx->ptPos));
|
|
|
|
|
_ptDrawStrings[_ctx->i] = _ctx->ptPos;
|
2012-06-07 08:42:35 +02:00
|
|
|
|
_ctx->ptPos.offset(0, _drawedStrings[_ctx->i].getDimy() + 15);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
CORO_INVOKE_0(drawOT);
|
|
|
|
|
clearOT();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-11 20:24:25 +02:00
|
|
|
|
_ptDrawPos.set(0, 480 - _ctx->ptPos._y);
|
2012-05-12 20:49:36 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMDialogChoice::setSelected(CORO_PARAM, int pos) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
RMGfxBox box;
|
|
|
|
|
RMRect rc;
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (pos == _curSelection)
|
2012-05-03 00:49:59 +10:00
|
|
|
|
return;
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
_ctx->box.setPriority(5);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_curSelection != -1) {
|
2012-06-07 21:14:59 +02:00
|
|
|
|
_ctx->box.setColor(0xCC, 0xCC, 0xFF);
|
2012-06-11 20:24:25 +02:00
|
|
|
|
_ctx->rc.topLeft() = RMPoint(18, _ptDrawStrings[_curSelection]._y);
|
2012-06-07 08:42:35 +02:00
|
|
|
|
_ctx->rc.bottomRight() = _ctx->rc.topLeft() + RMPoint(597, _drawedStrings[_curSelection].getDimy());
|
2012-06-05 08:39:55 +02:00
|
|
|
|
addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc));
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
addPrim(new RMGfxPrimitive(&_drawedStrings[_curSelection], _ptDrawStrings[_curSelection]));
|
2012-06-05 08:39:55 +02:00
|
|
|
|
CORO_INVOKE_0(drawOT);
|
|
|
|
|
clearOT();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pos != -1) {
|
2012-06-07 21:14:59 +02:00
|
|
|
|
_ctx->box.setColor(100, 100, 100);
|
2012-06-11 20:24:25 +02:00
|
|
|
|
_ctx->rc.topLeft() = RMPoint(18, _ptDrawStrings[pos]._y);
|
2012-06-07 08:42:35 +02:00
|
|
|
|
_ctx->rc.bottomRight() = _ctx->rc.topLeft() + RMPoint(597, _drawedStrings[pos].getDimy());
|
2012-06-05 08:39:55 +02:00
|
|
|
|
addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc));
|
2012-06-06 08:04:33 +02:00
|
|
|
|
addPrim(new RMGfxPrimitive(&_drawedStrings[pos], _ptDrawStrings[pos]));
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
CORO_INVOKE_0(drawOT);
|
|
|
|
|
clearOT();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_curSelection = pos;
|
2012-05-12 20:49:36 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMDialogChoice::show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) {
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
RMPoint destpt;
|
|
|
|
|
int deltay;
|
|
|
|
|
int starttime;
|
|
|
|
|
int elaps;
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
CORO_INVOKE_0(prepare);
|
|
|
|
|
_bShow = false;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
if (!_nInList && bigBuf != NULL)
|
|
|
|
|
bigBuf->addPrim(new RMGfxPrimitive(this));
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
|
|
|
|
if (0) {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_bShow = true;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
} else {
|
2012-06-04 23:45:36 +02:00
|
|
|
|
_ctx->starttime = _vm->getTime();
|
2012-06-11 20:24:25 +02:00
|
|
|
|
_ctx->deltay = 480 - _ptDrawPos._y;
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_ctx->destpt = _ptDrawPos;
|
2012-06-07 08:42:35 +02:00
|
|
|
|
_ptDrawPos.set(0, 480);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
if (!_nInList && bigBuf != NULL)
|
|
|
|
|
bigBuf->addPrim(new RMGfxPrimitive(this));
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_bShow = true;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-09 00:42:27 +10:00
|
|
|
|
_ctx->elaps = 0;
|
|
|
|
|
while (_ctx->elaps < 700) {
|
2012-06-05 01:15:25 +02:00
|
|
|
|
CORO_INVOKE_0(mainWaitFrame);
|
|
|
|
|
mainFreeze();
|
2012-06-04 23:45:36 +02:00
|
|
|
|
_ctx->elaps = _vm->getTime() - _ctx->starttime;
|
2012-06-11 20:24:25 +02:00
|
|
|
|
_ptDrawPos._y = 480 - ((_ctx->deltay * 100) / 700 * _ctx->elaps) / 100;
|
2012-06-05 01:15:25 +02:00
|
|
|
|
mainUnfreeze();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-11 20:24:25 +02:00
|
|
|
|
_ptDrawPos._y = _ctx->destpt._y;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
2012-05-09 00:42:27 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-05 08:39:55 +02:00
|
|
|
|
void RMDialogChoice::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_bShow == false)
|
2012-05-03 00:49:59 +10:00
|
|
|
|
return;
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
prim->setDst(_ptDrawPos);
|
2012-06-05 08:39:55 +02:00
|
|
|
|
CORO_INVOKE_2(RMGfxSourceBuffer16::draw, bigBuf, prim);
|
2012-05-12 20:49:36 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMDialogChoice::hide(CORO_PARAM) {
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
int deltay;
|
|
|
|
|
int starttime;
|
|
|
|
|
int elaps;
|
2012-05-09 00:42:27 +10:00
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
|
2012-05-09 00:42:27 +10:00
|
|
|
|
if (1) {
|
2012-06-04 23:45:36 +02:00
|
|
|
|
_ctx->starttime = _vm->getTime();
|
2012-05-09 00:42:27 +10:00
|
|
|
|
|
2012-06-11 20:24:25 +02:00
|
|
|
|
_ctx->deltay = 480 - _ptDrawPos._y;
|
2012-05-09 00:42:27 +10:00
|
|
|
|
_ctx->elaps = 0;
|
|
|
|
|
while (_ctx->elaps < 700) {
|
2012-06-05 01:15:25 +02:00
|
|
|
|
CORO_INVOKE_0(mainWaitFrame);
|
|
|
|
|
mainFreeze();
|
2012-06-04 23:45:36 +02:00
|
|
|
|
_ctx->elaps = _vm->getTime() - _ctx->starttime;
|
2012-06-11 20:24:25 +02:00
|
|
|
|
_ptDrawPos._y = 480 - ((_ctx->deltay * 100) / 700 * (700 - _ctx->elaps)) / 100;
|
2012-06-05 01:15:25 +02:00
|
|
|
|
mainUnfreeze();
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
_bShow = false;
|
2012-06-11 00:34:45 +02:00
|
|
|
|
_bRemoveFromOT = true;
|
|
|
|
|
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _hUnreg, CORO_INFINITE);
|
2012-05-09 00:42:27 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-06-05 18:51:20 +02:00
|
|
|
|
void RMDialogChoice::removeThis(CORO_PARAM, bool &result) {
|
2012-06-11 00:34:45 +02:00
|
|
|
|
result = _bRemoveFromOT;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
void RMDialogChoice::doFrame(CORO_PARAM, RMPoint ptMousePos) {
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_BEGIN_CONTEXT;
|
2012-05-14 21:29:27 +02:00
|
|
|
|
int i;
|
2012-05-12 20:49:36 +10:00
|
|
|
|
CORO_END_CONTEXT(_ctx);
|
|
|
|
|
|
|
|
|
|
CORO_BEGIN_CODE(_ctx);
|
|
|
|
|
|
2012-06-11 20:24:25 +02:00
|
|
|
|
if (ptMousePos._y > _ptDrawPos._y) {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
for (_ctx->i = 0; _ctx->i < _numChoices; _ctx->i++) {
|
2012-06-11 20:24:25 +02:00
|
|
|
|
if ((ptMousePos._y >= _ptDrawPos._y + _ptDrawStrings[_ctx->i]._y) && (ptMousePos._y < _ptDrawPos._y + _ptDrawStrings[_ctx->i]._y + _drawedStrings[_ctx->i].getDimy())) {
|
2012-06-06 08:04:33 +02:00
|
|
|
|
CORO_INVOKE_1(setSelected, _ctx->i);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
if (_ctx->i == _numChoices)
|
|
|
|
|
CORO_INVOKE_1(setSelected, -1);
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
2012-05-12 20:49:36 +10:00
|
|
|
|
|
|
|
|
|
CORO_END_CODE;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
2012-06-06 08:04:33 +02:00
|
|
|
|
int RMDialogChoice::getSelection(void) {
|
|
|
|
|
return _curSelection;
|
2012-05-03 00:49:59 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // End of namespace Tony
|