From ea28351862c8db5c8e1bd72a4d4c4cb63a50b2a6 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 11 Oct 2009 11:34:30 +0000 Subject: Cleanup. svn-id: r44907 --- engines/kyra/screen.cpp | 20 +++----------------- engines/kyra/screen.h | 2 -- 2 files changed, 3 insertions(+), 19 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 921c7f2c17..7d7140463f 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -1134,10 +1134,8 @@ int Screen::getFontWidth() const { } int Screen::getCharWidth(uint16 c) const { - if (isSJISChar(c)) - return _fonts[FID_SJIS_FNT]->getCharWidth(c); - else - return _fonts[_currentFont]->getCharWidth(c) + _charWidth; + const int width = _fonts[_currentFont]->getCharWidth(c); + return width + (_currentFont != FID_SJIS_FNT) ? _charWidth : 0; } int Screen::getTextWidth(const char *str) const { @@ -1204,18 +1202,6 @@ void Screen::printText(const char *str, int x, int y, uint8 color1, uint8 color2 } } -bool Screen::isSJISChar(uint16 c) const { - if (!_useSJIS) - return false; - - if (c & 0xFF00) - return true; - else if ((c & 0xFF) >= 0xA1 && (c & 0xFF) <= 0xDF) - return true; - - return false; -} - uint16 Screen::fetchChar(const char *&s) const { if (_currentFont != FID_SJIS_FNT) return (uint8)*s++; @@ -3346,7 +3332,7 @@ int SJISFont::getWidth() const { } int SJISFont::getCharWidth(uint16 c) const { - if (_screen->isSJISChar(c)) + if ((c & 0xFF) >= 0xA1 && (c & 0xFF) <= 0xDF) return _sjisWidth; else return _asciiWidth; diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h index 82862fcbf7..0f8208c791 100644 --- a/engines/kyra/screen.h +++ b/engines/kyra/screen.h @@ -426,8 +426,6 @@ public: const ScreenDim *_curDim; - bool isSJISChar(uint16 ch) const; - // shape handling uint8 *encodeShape(int x, int y, int w, int h, int flags); -- cgit v1.2.3