aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-10-11 11:34:30 +0000
committerJohannes Schickel2009-10-11 11:34:30 +0000
commitea28351862c8db5c8e1bd72a4d4c4cb63a50b2a6 (patch)
treedeb5cc7d2c499861314f66594738fd82a33bbf65
parent6e93add43f5b098df8b51e1d23ba4d9a3136b8ea (diff)
downloadscummvm-rg350-ea28351862c8db5c8e1bd72a4d4c4cb63a50b2a6.tar.gz
scummvm-rg350-ea28351862c8db5c8e1bd72a4d4c4cb63a50b2a6.tar.bz2
scummvm-rg350-ea28351862c8db5c8e1bd72a4d4c4cb63a50b2a6.zip
Cleanup.
svn-id: r44907
-rw-r--r--engines/kyra/screen.cpp20
-rw-r--r--engines/kyra/screen.h2
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);