svn-id: r44907
This commit is contained in:
Johannes Schickel 2009-10-11 11:34:30 +00:00
parent 6e93add43f
commit ea28351862
2 changed files with 3 additions and 19 deletions

View File

@ -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;

View File

@ -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);