KYRA: Fix (a few) font checks for systems with unsigend char.

Thanks to wjp for reporting those. This only affects games with SJIS font use.
This commit is contained in:
Johannes Schickel 2013-07-01 15:08:01 +02:00
parent a00c3e75b0
commit b1dcd252b3
2 changed files with 3 additions and 3 deletions

View File

@ -213,7 +213,7 @@ void KyraRpgEngine::drawDialogueButtons() {
screen()->printText(_dialogueButtonString[i], (x + 37 - (screen()->getTextWidth(_dialogueButtonString[i])) / 2) & ~3,
((_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2) & ~7, _dialogueHighlightedButton == i ? 0xC1 : 0xE1, 0);
} else {
int sjisYOffset = (_flags.lang == Common::JA_JPN && _dialogueButtonString[i][0] < 0) ? 2 : 0;
int sjisYOffset = (_flags.lang == Common::JA_JPN && (_dialogueButtonString[i][0] & 0x80)) ? 2 : 0;
gui_drawBox(x, (_dialogueButtonYoffs + _dialogueButtonPosY[i]), _dialogueButtonWidth, guiSettings()->buttons.height, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill);
screen()->printText(_dialogueButtonString[i], x + (_dialogueButtonWidth >> 1) - (screen()->getTextWidth(_dialogueButtonString[i])) / 2,
(_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2 - sjisYOffset, _dialogueHighlightedButton == i ? _dialogueButtonLabelColor1 : _dialogueButtonLabelColor2, 0);

View File

@ -1256,7 +1256,7 @@ int Screen::getTextWidth(const char *str) {
while (1) {
if (_sjisMixedFontMode)
setFont(*str < 0 ? FID_SJIS_FNT : curFont);
setFont((*str & 0x80) ? FID_SJIS_FNT : curFont);
uint c = fetchChar(str);
@ -1296,7 +1296,7 @@ void Screen::printText(const char *str, int x, int y, uint8 color1, uint8 color2
while (1) {
if (_sjisMixedFontMode)
setFont(*str < 0 ? FID_SJIS_FNT : curFont);
setFont((*str & 0x80) ? FID_SJIS_FNT : curFont);
uint8 charHeightFnt = getFontHeight();