From 76d722d941c788f7660809abbad422c1bf14ec6e Mon Sep 17 00:00:00 2001 From: Oystein Eftevaag Date: Sun, 28 May 2006 02:51:03 +0000 Subject: Fixes bug [ 1480746 ] KYRA1: menu triggers assertion, and sets the text/speech config options correctly for CD versions svn-id: r22693 --- engines/kyra/gui.cpp | 12 ++++++------ engines/kyra/script_v1.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 0e2ac3b076..ff9dbe024d 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -677,19 +677,19 @@ void KyraEngine::calcCoords(Menu &menu) { int textX = menu.item[i].labelX + menu_x1; int offset; - if (textWidth + textX > x1) { - offset = (textWidth + textX) - x1; - menu.width += offset/2; - + if (textWidth/2 + textX >= x1) { + offset = ((textWidth + textX) - x1) / 2; if (maxOffset < offset) maxOffset = offset; } } } - if (maxOffset > 0) + if (maxOffset > 0) { for (int i = 0; i < menu.nrOfItems; i++) - menu.item[i].x += maxOffset - 10; + menu.item[i].x += maxOffset + 20; + menu.width += maxOffset + 20; + } if (menu.width > 310) menu.width = 310; diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index ff1494b894..946983d7c9 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -49,7 +49,7 @@ int KyraEngine::cmd_characterSays(ScriptState *script) { snd_voiceWaitForFinish(); snd_playVoiceFile(stackPos(0)); } - if (_configVoice == 0 || _configVoice == 1) + if (_configVoice == 0 || _configVoice == 2) characterSays(stackPosString(1), stackPos(2), stackPos(3)); } else { debugC(3, kDebugLevelScriptFuncs, "cmd_characterSays(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2)); @@ -623,7 +623,7 @@ int KyraEngine::cmd_customPrintTalkString(ScriptState *script) { snd_playVoiceFile(stackPos(0)); } _skipFlag = false; - if (_configVoice == 0 || _configVoice == 1) + if (_configVoice == 0 || _configVoice == 2) _text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2); } else { debugC(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF); -- cgit v1.2.3