diff options
-rw-r--r-- | engines/kyra/screen.cpp | 20 | ||||
-rw-r--r-- | engines/kyra/screen.h | 2 |
2 files changed, 3 insertions, 19 deletions
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); |