From afa3f50b8a2bc47a243156c196f88ab799fe4f8f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 23 Nov 2013 21:34:54 +0100 Subject: GRAPHICS: Let Font take uint32 as character codes. This is required to support UTF-32 strings but does not make them work automatically! --- graphics/fonts/winfont.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/fonts/winfont.cpp') diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp index 3bad92236d..c0ebab19ba 100644 --- a/graphics/fonts/winfont.cpp +++ b/graphics/fonts/winfont.cpp @@ -200,7 +200,7 @@ char WinFont::indexToCharacter(uint16 index) const { return index + _firstChar; } -uint16 WinFont::characterToIndex(byte character) const { +uint16 WinFont::characterToIndex(uint32 character) const { // Go to the default character if we didn't find a mapping if (character < _firstChar || character > _lastChar) character = _defaultChar; @@ -208,7 +208,7 @@ uint16 WinFont::characterToIndex(byte character) const { return character - _firstChar; } -int WinFont::getCharWidth(byte chr) const { +int WinFont::getCharWidth(uint32 chr) const { return _glyphs[characterToIndex(chr)].charWidth; } @@ -324,7 +324,7 @@ bool WinFont::loadFromFNT(Common::SeekableReadStream &stream) { return true; } -void WinFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const { +void WinFont::drawChar(Surface *dst, uint32 chr, int x, int y, uint32 color) const { assert(dst); assert(dst->format.bytesPerPixel == 1 || dst->format.bytesPerPixel == 2 || dst->format.bytesPerPixel == 4); assert(_glyphs); -- cgit v1.2.3