aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-10-11 12:01:20 +0000
committerJohannes Schickel2009-10-11 12:01:20 +0000
commite90f337bd20bcf04920c1eeae634892750aed363 (patch)
tree0c059ef00811074734a8a8696fae1a255845b7ec
parent67c6e92efba2ffcde33a3e9b8e9ebaf7389e05ae (diff)
downloadscummvm-rg350-e90f337bd20bcf04920c1eeae634892750aed363.tar.gz
scummvm-rg350-e90f337bd20bcf04920c1eeae634892750aed363.tar.bz2
scummvm-rg350-e90f337bd20bcf04920c1eeae634892750aed363.zip
Fix regression introduced with r44907.
svn-id: r44911
-rw-r--r--engines/kyra/screen.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 7d7140463f..dc8402ecba 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -1135,7 +1135,7 @@ int Screen::getFontWidth() const {
int Screen::getCharWidth(uint16 c) const {
const int width = _fonts[_currentFont]->getCharWidth(c);
- return width + (_currentFont != FID_SJIS_FNT) ? _charWidth : 0;
+ return width + ((_currentFont != FID_SJIS_FNT) ? _charWidth : 0);
}
int Screen::getTextWidth(const char *str) const {
@@ -3315,7 +3315,7 @@ SJISFont::SJISFont(Screen *s, Graphics::FontSJIS *font, const uint8 invisColor,
_sjisWidth = _font->getMaxFontWidth() >> 1;
_fontHeight = _font->getFontHeight() >> 1;
- _asciiWidth = _font->getCharWidth('a');
+ _asciiWidth = _font->getCharWidth('a') >> 1;
}
void SJISFont::unload() {
@@ -3332,10 +3332,10 @@ int SJISFont::getWidth() const {
}
int SJISFont::getCharWidth(uint16 c) const {
- if ((c & 0xFF) >= 0xA1 && (c & 0xFF) <= 0xDF)
- return _sjisWidth;
- else
+ if (c <= 0x7F || (c >= 0xA1 && c <= 0xDF))
return _asciiWidth;
+ else
+ return _sjisWidth;
}
void SJISFont::setColorMap(const uint8 *src) {