From 0c95f6524e0d22ebb3dd4e13ec8b0026eff52887 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sun, 6 Jan 2013 00:34:44 +0100 Subject: KYRA: (LOL/FM-TOWNS) - fix sjis text position for button labels --- engines/kyra/kyra_rpg.cpp | 9 +++++---- engines/kyra/sound_lol.cpp | 2 +- engines/kyra/text_rpg.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'engines') diff --git a/engines/kyra/kyra_rpg.cpp b/engines/kyra/kyra_rpg.cpp index 67d27dee86..f8eb7d00cd 100644 --- a/engines/kyra/kyra_rpg.cpp +++ b/engines/kyra/kyra_rpg.cpp @@ -204,18 +204,19 @@ bool KyraRpgEngine::posWithinRect(int posX, int posY, int x1, int y1, int x2, in void KyraRpgEngine::drawDialogueButtons() { int cp = screen()->setCurPage(0); - Screen::FontId of = screen()->setFont(gameFlags().lang == Common::JA_JPN && gameFlags().use16ColorMode ? Screen::FID_SJIS_FNT : Screen::FID_6_FNT); + Screen::FontId of = screen()->setFont(_flags.lang == Common::JA_JPN && _flags.use16ColorMode ? Screen::FID_SJIS_FNT : Screen::FID_6_FNT); for (int i = 0; i < _dialogueNumButtons; i++) { int x = _dialogueButtonPosX[i]; - if (gameFlags().use16ColorMode) { + if (_flags.lang == Common::JA_JPN && _flags.use16ColorMode) { gui_drawBox(x, ((_dialogueButtonYoffs + _dialogueButtonPosY[i]) & ~7) - 1, 74, 10, 0xEE, 0xCC, -1); 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; 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, _dialogueHighlightedButton == i ? _dialogueButtonLabelColor1 : _dialogueButtonLabelColor2, 0); + (_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2 - sjisYOffset, _dialogueHighlightedButton == i ? _dialogueButtonLabelColor1 : _dialogueButtonLabelColor2, 0); } } screen()->setFont(of); @@ -228,7 +229,7 @@ uint16 KyraRpgEngine::processDialogue() { for (int i = 0; i < _dialogueNumButtons; i++) { int x = _dialogueButtonPosX[i]; - int y = (gameFlags().use16ColorMode ? ((_dialogueButtonYoffs + _dialogueButtonPosY[i]) & ~7) - 1 : (_dialogueButtonYoffs + _dialogueButtonPosY[i])); + int y = ((_flags.lang == Common::JA_JPN && _flags.use16ColorMode) ? ((_dialogueButtonYoffs + _dialogueButtonPosY[i]) & ~7) - 1 : (_dialogueButtonYoffs + _dialogueButtonPosY[i])); Common::Point p = getMousePos(); if (posWithinRect(p.x, p.y, x, y, x + _dialogueButtonWidth, y + guiSettings()->buttons.height)) { _dialogueHighlightedButton = i; diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp index 41f59be985..48230d025c 100644 --- a/engines/kyra/sound_lol.cpp +++ b/engines/kyra/sound_lol.cpp @@ -273,7 +273,7 @@ int LoLEngine::snd_playTrack(int track) { snd_loadSoundFile(track); int t = (track - 250) * 3; _sound->playTrack(_musicTrackMap[t + 2]); - } else { + } else { _sound->playTrack(track - 249); } } diff --git a/engines/kyra/text_rpg.cpp b/engines/kyra/text_rpg.cpp index b6b09e9225..a19d678e35 100644 --- a/engines/kyra/text_rpg.cpp +++ b/engines/kyra/text_rpg.cpp @@ -125,7 +125,7 @@ void TextDisplayer_rpg::displayText(char *str, ...) { bool sjisTextMode = (_vm->gameFlags().lang == Common::JA_JPN && _vm->gameFlags().use16ColorMode && (sdx == 3 || sdx == 4 || sdx == 5 || sdx == 15)) ? true : false; int sjisOffs = sjisTextMode ? 8 : 9; - + uint16 charsPerLine = (sd->w << 3) / (_screen->getFontWidth() + _screen->_charWidth); while (c) { @@ -323,7 +323,7 @@ void TextDisplayer_rpg::printLine(char *str) { char c = 0; uint8 twoByteCharOffs = 0; - + if (sjisTextMode) { bool ct = true; @@ -427,7 +427,7 @@ void TextDisplayer_rpg::printLine(char *str) { strPos--; } } - + if (!strPos) { if (_textDimData[sdx].column && !_printFlag) { s = lw = 0; @@ -436,7 +436,7 @@ void TextDisplayer_rpg::printLine(char *str) { s = lineLastCharPos; } } - + } } -- cgit v1.2.3