From cd4812dfd9444a7c9df1955c940523186922de42 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 16 Apr 2010 18:23:50 +0000 Subject: SCI: support for kanji (sjis), minor centering issue left svn-id: r48674 --- engines/sci/graphics/font.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/sci/graphics/font.cpp') diff --git a/engines/sci/graphics/font.cpp b/engines/sci/graphics/font.cpp index 4bfe8f87dd..91cf01c912 100644 --- a/engines/sci/graphics/font.cpp +++ b/engines/sci/graphics/font.cpp @@ -30,7 +30,7 @@ namespace Sci { -GfxFont::GfxFont(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId) +GfxFontFromResource::GfxFontFromResource(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resourceId) : _resourceId(resourceId), _screen(screen), _resMan(resMan) { assert(resourceId != -1); @@ -56,29 +56,29 @@ GfxFont::GfxFont(ResourceManager *resMan, GfxScreen *screen, GuiResourceId resou } } -GfxFont::~GfxFont() { +GfxFontFromResource::~GfxFontFromResource() { delete []_chars; _resMan->unlockResource(_resource); } -GuiResourceId GfxFont::getResourceId() { +GuiResourceId GfxFontFromResource::getResourceId() { return _resourceId; } -byte GfxFont::getHeight() { +byte GfxFontFromResource::getHeight() { return _fontHeight; } -byte GfxFont::getCharWidth(byte chr) { +byte GfxFontFromResource::getCharWidth(uint16 chr) { return chr < _numChars ? _chars[chr].w : 0; } -byte GfxFont::getCharHeight(byte chr) { +byte GfxFontFromResource::getCharHeight(uint16 chr) { return chr < _numChars ? _chars[chr].h : 0; } -byte *GfxFont::getCharData(byte chr) { +byte *GfxFontFromResource::getCharData(uint16 chr) { return chr < _numChars ? _resourceData + _chars[chr].offset + 2 : 0; } -void GfxFont::draw(int16 chr, int16 top, int16 left, byte color, bool greyedOutput) { +void GfxFontFromResource::draw(uint16 chr, int16 top, int16 left, byte color, bool greyedOutput) { int charWidth = MIN(getCharWidth(chr), _screen->getWidth() - left); int charHeight = MIN(getCharHeight(chr), _screen->getHeight() - top); byte b = 0, mask = 0xFF; -- cgit v1.2.3