diff options
author | Gregory Montoir | 2006-11-18 11:53:36 +0000 |
---|---|---|
committer | Gregory Montoir | 2006-11-18 11:53:36 +0000 |
commit | 318c50913d7e71a2075e35c54bf91c1d90eb333e (patch) | |
tree | e367b780ecd8d35030fb2c8f0435a999b707f302 /engines/touche/graphics.cpp | |
parent | dd075b312f161b3f3f6f89355a05b7bc05e3f52d (diff) | |
download | scummvm-rg350-318c50913d7e71a2075e35c54bf91c1d90eb333e.tar.gz scummvm-rg350-318c50913d7e71a2075e35c54bf91c1d90eb333e.tar.bz2 scummvm-rg350-318c50913d7e71a2075e35c54bf91c1d90eb333e.zip |
added font data for french version (and probably all other localized versions)
svn-id: r24729
Diffstat (limited to 'engines/touche/graphics.cpp')
-rw-r--r-- | engines/touche/graphics.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/engines/touche/graphics.cpp b/engines/touche/graphics.cpp index db3c687471..0611168db9 100644 --- a/engines/touche/graphics.cpp +++ b/engines/touche/graphics.cpp @@ -27,6 +27,21 @@ namespace Touche { +void Graphics::setupFont(Common::Language language) { + switch (language) { + case Common::EN_ANY: + _fontOffs = _engFontOffs; + _fontSize = _engFontSize; + _fontData = _engFontData; + break; + default: // else default to a localized version + _fontOffs = _locFontOffs; + _fontSize = _locFontSize; + _fontData = _locFontData; + break; + } +} + int Graphics::getStringWidth16(const char *str) { int w = 0; while (*str) { @@ -40,7 +55,7 @@ int Graphics::getStringWidth16(const char *str) { } int Graphics::getCharWidth16(uint8 chr) { - assert(chr >= 32 && chr < 174); + assert(chr >= 32 && chr < 32 + _fontSize); const uint8 *chrData = _fontData + _fontOffs[chr - 32]; return chrData[2]; } @@ -56,7 +71,7 @@ int Graphics::drawChar16(uint8 *dst, int dstPitch, uint8 chr, int x, int y, uint dst += y * dstPitch + x; uint8 color1 = color & 0xFF; uint8 color2 = color >> 8; - assert(chr >= 32 && chr < 174); + assert(chr >= 32 && chr < 32 + _fontSize); const uint8 *chrData = _fontData + _fontOffs[chr - 32]; int chrHeight = chrData[1]; int chrWidth = chrData[2]; |