aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOystein Eftevaag2006-03-08 13:15:13 +0000
committerOystein Eftevaag2006-03-08 13:15:13 +0000
commit39c9af43ae06814ee8298e7cf91c736a0dafccc8 (patch)
treea252d23d7ef7f545844ac124935126c13ef5cfeb
parent4c1e4c6987ed6cd511c932195e845a1ee15022aa (diff)
downloadscummvm-rg350-39c9af43ae06814ee8298e7cf91c736a0dafccc8.tar.gz
scummvm-rg350-39c9af43ae06814ee8298e7cf91c736a0dafccc8.tar.bz2
scummvm-rg350-39c9af43ae06814ee8298e7cf91c736a0dafccc8.zip
Implemented the last menu (the settings screen). Walking speed, text speed,
and speech modes (text only, speech only, speech & text) can now be configured. Toggling music and sound in general is not enabled yet. Also formatted the static menu resources a bit differently, made sure some vars in the menu code always got initalized, and fixed a slight formatting error :). svn-id: r21145
-rw-r--r--engines/kyra/gui.cpp209
-rw-r--r--engines/kyra/kyra.cpp7
-rw-r--r--engines/kyra/kyra.h22
-rw-r--r--engines/kyra/saveload.cpp16
-rw-r--r--engines/kyra/script_v1.cpp22
-rw-r--r--engines/kyra/staticres.cpp67
-rw-r--r--engines/kyra/text.cpp2
-rw-r--r--engines/kyra/timer.cpp9
8 files changed, 305 insertions, 49 deletions
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index db9f249485..dd57c26621 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -414,10 +414,12 @@ int KyraEngine::buttonMenuCallback(Button *caller) {
_screen->savePageToDisk("SEENPAGE.TMP", 0);
gui_fadePalette();
- for ( int i = 0; i < 5; i++)
+ for (int i = 0; i < 5; i++)
calcCoords(_menu[i]);
_menuRestoreScreen = true;
+ _keyboardEvent.pending = 0;
+ _keyboardEvent.repeat = 0;
_toplevelMenu = 0;
if (_menuDirectlyToLoad)
@@ -500,22 +502,24 @@ void KyraEngine::initMenu(Menu menu) {
_screen->fillRect(x1, y1, x2, y2, menu.item[i].bgcolor);
_screen->drawShadedBox(x1, y1, x2, y2, menu.item[i].color1, menu.item[i].color2);
- if (menu.item[i].field_12 != -1)
- textX = x1 + menu.item[i].field_12 + 3;
- else
- textX = _text->getCenterStringX(menu.item[i].itemString, x1, x2);
+ if (menu.item[i].itemString) {
+ if (menu.item[i].field_12 != -1)
+ textX = x1 + menu.item[i].field_12 + 3;
+ else
+ textX = _text->getCenterStringX(menu.item[i].itemString, x1, x2);
- textY = y1 + 2;
- _text->printText(menu.item[i].itemString, textX - 1, textY + 1, 12, 0, 0);
+ textY = y1 + 2;
+ _text->printText(menu.item[i].itemString, textX - 1, textY + 1, 12, 0, 0);
- if (i == menu.highlightedItem)
- _text->printText(menu.item[i].itemString, textX, textY, menu.item[i].highlightColor, 0, 0);
- else
- _text->printText(menu.item[i].itemString, textX, textY, menu.item[i].textColor, 0, 0);
+ if (i == menu.highlightedItem)
+ _text->printText(menu.item[i].itemString, textX, textY, menu.item[i].highlightColor, 0, 0);
+ else
+ _text->printText(menu.item[i].itemString, textX, textY, menu.item[i].textColor, 0, 0);
- if (menu.item[i].labelString) {
- _text->printText(menu.item[i].labelString, menu.x + menu.item[i].field_21 - 1, menu.y + menu.item[i].field_23 + 1, 12, 0, 0);
- _text->printText(menu.item[i].labelString, menu.x + menu.item[i].field_21, menu.y + menu.item[i].field_23, 253, 0, 0);
+ if (menu.item[i].labelString) {
+ _text->printText(menu.item[i].labelString, menu.x + menu.item[i].labelX - 1, menu.y + menu.item[i].labelY + 1, 12, 0, 0);
+ _text->printText(menu.item[i].labelString, menu.x + menu.item[i].labelX, menu.y + menu.item[i].labelY, 253, 0, 0);
+ }
}
}
@@ -799,8 +803,6 @@ int KyraEngine::gui_saveGame(Button *button) {
}
gui_redrawTextfield();
- _keyboardEvent.pending = 0;
- _keyboardEvent.repeat = 0;
while (_displaySubMenu) {
gui_getInput();
gui_updateSavegameString();
@@ -905,6 +907,181 @@ int KyraEngine::gui_quitConfirmNo(Button *button) {
return 0;
}
+int KyraEngine::gui_gameControlsMenu(Button *button) {
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_gameControlsMenu()");
+
+ _screen->loadPageFromDisk("SEENPAGE.TMP", 0);
+ _screen->savePageToDisk("SEENPAGE.TMP", 0);
+
+ if (_features & GF_TALKIE) {
+ _menu[5].width = 230;
+
+ for (int i = 0; i < 5; i++) {
+ _menu[5].item[i].labelX = 24;
+ _menu[5].item[i].x = 115;
+ _menu[5].item[i].width = 94;
+ }
+
+ _menu[5].item[3].labelString = "Voice / Text ";
+ _menu[5].item[3].callback = &KyraEngine::gui_controlsChangeVoice;
+
+ } else {
+ _menu[5].height = 136;
+ _menu[5].item[5].y = 110;
+ _menu[5].item[4].enabled = 0;
+ _menu[5].item[3].labelString = "Text speed ";
+ _menu[5].item[3].callback = &KyraEngine::gui_controlsChangeText;
+ }
+
+ calcCoords(_menu[5]);
+ gui_setupControls(_menu[5]);
+
+ processAllMenuButtons();
+
+ _displaySubMenu = true;
+ _cancelSubMenu = false;
+
+ while (_displaySubMenu) {
+ gui_getInput();
+ gui_processHighlights(_menu[5]);
+ processButtonList(_menuButtonList);
+ }
+
+ _screen->loadPageFromDisk("SEENPAGE.TMP", 0);
+ _screen->savePageToDisk("SEENPAGE.TMP", 0);
+
+ if (_cancelSubMenu) {
+ initMenu(_menu[_toplevelMenu]);
+ processAllMenuButtons();
+ }
+ return 0;
+}
+
+void KyraEngine::gui_setupControls(Menu &menu) {
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_setupControls()");
+
+ if (_configMusic)
+ menu.item[0].itemString = "On";
+ else
+ menu.item[0].itemString = "Off";
+
+ if (_configSounds)
+ menu.item[1].itemString = "On";
+ else
+ menu.item[1].itemString = "Off";
+
+
+ switch (_configWalkspeed) {
+ case 0:
+ menu.item[2].itemString = "Slowest";
+ break;
+ case 1:
+ menu.item[2].itemString = "Slow";
+ break;
+ case 2:
+ menu.item[2].itemString = "Normal";
+ break;
+ case 3:
+ menu.item[2].itemString = "Fast";
+ break;
+ case 4:
+ menu.item[2].itemString = "Fastest";
+ break;
+ default:
+ menu.item[2].itemString = "ERROR";
+ }
+
+ int textControl = 3;
+ if (_features & GF_TALKIE) {
+ textControl = 4;
+
+ if (_configVoice == 0)
+ _menu[5].item[4].enabled = 1;
+ else
+ _menu[5].item[4].enabled = 0;
+
+ switch (_configVoice) {
+ case 0:
+ menu.item[3].itemString = "Text only";
+ break;
+ case 1:
+ menu.item[3].itemString = "Voice & Text";
+ break;
+ case 2:
+ menu.item[3].itemString = "Voice only";
+ break;
+ default:
+ menu.item[3].itemString = "ERROR";
+ }
+ }
+
+ switch (_configTextspeed) {
+ case 0:
+ menu.item[textControl].itemString = "Slow";
+ break;
+ case 1:
+ menu.item[textControl].itemString = "Normal";
+ break;
+ case 2:
+ menu.item[textControl].itemString = "Fast";
+ break;
+ case 3:
+ menu.item[textControl].itemString = "Clickable";
+ break;
+ default:
+ menu.item[textControl].itemString = "ERROR";
+ }
+
+
+ initMenu(menu);
+}
+
+int KyraEngine::gui_controlsChangeMusic(Button *button) {
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeMusic()");
+ processMenuButton(button);
+
+ _configMusic = !_configMusic;
+ gui_setupControls(_menu[5]);
+ return 0;
+}
+
+int KyraEngine::gui_controlsChangeSounds(Button *button) {
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeSounds()");
+ processMenuButton(button);
+
+ _configSounds = !_configSounds;
+ gui_setupControls(_menu[5]);
+ return 0;
+}
+
+int KyraEngine::gui_controlsChangeWalk(Button *button) {
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeWalk()");
+ processMenuButton(button);
+
+ _configWalkspeed = ++_configWalkspeed % 5;
+ setWalkspeed(_configWalkspeed);
+ gui_setupControls(_menu[5]);
+ return 0;
+}
+
+int KyraEngine::gui_controlsChangeText(Button *button) {
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeText()");
+ processMenuButton(button);
+
+ _configTextspeed = ++_configTextspeed % 4;
+ gui_setupControls(_menu[5]);
+ return 0;
+}
+
+int KyraEngine::gui_controlsChangeVoice(Button *button) {
+ debugC(9, kDebugLevelGUI, "KyraEngine::gui_controlsChangeVoice()");
+ processMenuButton(button);
+
+ _configVoice = ++_configVoice % 3;
+ gui_setupControls(_menu[5]);
+ return 0;
+}
+
int KyraEngine::gui_scrollUp(Button *button) {
debugC(9, kDebugLevelGUI, "KyraEngine::gui_scrollUp()");
processMenuButton(button);
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index 775718e439..292bbab980 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -440,7 +440,12 @@ int KyraEngine::init(GameDetector &detector) {
assert(_movFacingTable);
_movFacingTable[0] = 8;
- _configTalkspeed = 1;
+ _configTextspeed = 1;
+ _configWalkspeed = 2;
+ _configMusic = true;
+ _configSounds = true;
+ _configVoice = 1;
+
_skipFlag = false;
_marbleVaseItem = -1;
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index 119cfe4c80..833877c95d 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -201,8 +201,8 @@ struct MenuItem {
int (KyraEngine::*callback)(Button*);
int16 field_1b;
const char *labelString;
- uint16 field_21;
- uint8 field_23;
+ uint16 labelX;
+ uint8 labelY;
uint8 field_24;
uint32 field_25;
};
@@ -641,7 +641,8 @@ protected:
void updateAnimFlag2(int timerNum);
void drawAmulet();
void setTextFadeTimerCountdown(int16 countdown);
-
+ void setWalkspeed(uint8 newSpeed);
+
int buttonInventoryCallback(Button *caller);
int buttonAmuletCallback(Button *caller);
int buttonMenuCallback(Button *caller);
@@ -663,6 +664,7 @@ protected:
int gui_resumeGame(Button *button);
int gui_loadGameMenu(Button *button);
int gui_saveGameMenu(Button *button);
+ int gui_gameControlsMenu(Button *button);
int gui_quitPlaying(Button *button);
int gui_quitConfirmYes(Button *button);
int gui_quitConfirmNo(Button *button);
@@ -672,6 +674,11 @@ protected:
int gui_cancelSubMenu(Button *button);
int gui_scrollUp(Button *button);
int gui_scrollDown(Button *button);
+ int gui_controlsChangeMusic(Button *button);
+ int gui_controlsChangeSounds(Button *button);
+ int gui_controlsChangeWalk(Button *button);
+ int gui_controlsChangeText(Button *button);
+ int gui_controlsChangeVoice(Button *button);
bool gui_quitConfirm(const char *str);
void gui_getInput();
@@ -682,6 +689,7 @@ protected:
void gui_redrawTextfield();
void gui_fadePalette();
void gui_restorePalette();
+ void gui_setupControls(Menu &menu);
uint8 _game;
bool _quitFlag;
@@ -781,8 +789,12 @@ protected:
int8 _startSentencePalIndex;
bool _fadeText;
- uint8 _configTalkspeed;
-
+ uint8 _configTextspeed;
+ uint8 _configWalkspeed;
+ bool _configMusic;
+ bool _configSounds;
+ uint8 _configVoice;
+
Common::String _targetName;
int _curMusicTheme;
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index 346ef7bf86..4404214ee2 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -28,7 +28,7 @@
#include "common/savefile.h"
#include "common/system.h"
-#define CURRENT_VERSION 3
+#define CURRENT_VERSION 4
namespace Kyra {
void KyraEngine::loadGame(const char *fileName) {
@@ -178,6 +178,14 @@ void KyraEngine::loadGame(const char *fileName) {
snd_playWanderScoreViaMap(_lastMusicCommand, 1);
}
+ if (version >= 4) {
+ _configTextspeed = in->readByte();
+ _configWalkspeed = in->readByte();
+ _configMusic = in->readByte();
+ _configSounds = in->readByte();
+ _configVoice = in->readByte();
+ }
+
if (queryGameFlag(0x2D)) {
loadMainScreen(8);
loadBitmap("AMULET3.CPS", 10, 10, 0);
@@ -310,6 +318,12 @@ void KyraEngine::saveGame(const char *fileName, const char *saveName) {
out->writeSint16BE(_lastMusicCommand);
+ out->writeByte(_configTextspeed);
+ out->writeByte(_configWalkspeed);
+ out->writeByte(_configMusic);
+ out->writeByte(_configSounds);
+ out->writeByte(_configVoice);
+
out->flush();
// check for errors
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp
index a8a8ed6fad..916e328daa 100644
--- a/engines/kyra/script_v1.cpp
+++ b/engines/kyra/script_v1.cpp
@@ -44,9 +44,12 @@ int KyraEngine::cmd_characterSays(ScriptState *script) {
_skipFlag = false;
if (_features & GF_TALKIE) {
debugC(3, kDebugLevelScriptFuncs, "cmd_characterSays(%p) (%d, '%s', %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
- snd_voiceWaitForFinish();
- snd_playVoiceFile(stackPos(0));
- characterSays(stackPosString(1), stackPos(2), stackPos(3));
+ if (_configVoice == 1 || _configVoice == 2) {
+ snd_voiceWaitForFinish();
+ snd_playVoiceFile(stackPos(0));
+ }
+ if (_configVoice == 0 || _configVoice == 1)
+ 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));
characterSays(stackPosString(0), stackPos(1), stackPos(2));
@@ -613,10 +616,14 @@ int KyraEngine::cmd_loadPageFromDisk(ScriptState *script) {
int KyraEngine::cmd_customPrintTalkString(ScriptState *script) {
if (_features & GF_TALKIE) {
debugC(3, kDebugLevelScriptFuncs, "cmd_customPrintTalkString(%p) (%d, '%s', %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
- snd_voiceWaitForFinish();
- snd_playVoiceFile(stackPos(0));
+
+ if (_configVoice == 1 || _configVoice == 2) {
+ snd_voiceWaitForFinish();
+ snd_playVoiceFile(stackPos(0));
+ }
_skipFlag = false;
- _text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2);
+ if (_configVoice == 0 || _configVoice == 1)
+ _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);
_skipFlag = false;
@@ -1447,8 +1454,7 @@ int KyraEngine::cmd_totalItemsInScene(ScriptState *script) {
int KyraEngine::cmd_restoreBrandonsMovementDelay(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "cmd_restoreBrandonsMovementDelay(%p) ()", (const void *)script);
- //TODO: Use movement set by menu, instead of 5.
- setTimerDelay(5, 5);
+ setWalkspeed(_configWalkspeed);
return 0;
}
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 63e2cc12ab..26f2165d1f 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -907,55 +907,88 @@ Menu KyraEngine::_menu[] = {
{ -1, -1, 208, 136, 248, 249, 250, "The Legend of Kyrandia", 251, -1, 8, 0, 5, -1, -1, -1, -1,
{
{1, 0, 0, "Load a Game", -1, -1, 30, 148, 15, 252, 253, 24, 0,
- 248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, "Save this Game", -1, -1, 47, 148, 15, 252, 253, 24, 0,
- 248, 249, 250, &KyraEngine::gui_saveGameMenu, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, &KyraEngine::gui_saveGameMenu, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, "Game Controls", -1, -1, 64, 148, 15, 252, 253, 24, 0,
- 248, 249, 250, /*&menu_gameControls*/ 0, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, &KyraEngine::gui_gameControlsMenu, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, "Quit playing", -1, -1, 81, 148, 15, 252, 253, 24, 0,
- 248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, "Resume game", 86, 0, 110, 92, 15, 252, 253, -1, 255,
- 248, 249, 250, &KyraEngine::gui_resumeGame, -1, 0, 0, 0, 0, 0}
+ 248, 249, 250, &KyraEngine::gui_resumeGame, -1, 0, 0, 0, 0, 0}
}
},
{ -1, -1, 288, 56, 248, 249, 250, 0, 254,-1, 8, 0, 2, -1, -1, -1, -1,
{
{1, 0, 0, "Yes", 24, 0, 30, 72, 15, 252, 253, -1, 255,
- 248, 249, 250, &KyraEngine::gui_quitConfirmYes, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, &KyraEngine::gui_quitConfirmYes, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, "No", 192, 0, 30, 72, 15, 252, 253, -1, 255,
- 248, 249, 250, &KyraEngine::gui_quitConfirmNo, -1, 0, 0, 0, 0, 0}
+ 248, 249, 250, &KyraEngine::gui_quitConfirmNo, -1, 0, 0, 0, 0, 0}
}
},
{ -1, -1, 288, 160, 248, 249, 250, 0, 251, -1, 8, 0, 6, 132, 22, 132, 124,
{
{1, 0, 0, 0, -1, 255, 39, 256, 15, 252, 253, 5, 0,
- 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, 0, -1, 255, 56, 256, 15, 252, 253, 5, 0,
- 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, 0, -1, 255, 73, 256, 15, 252, 253, 5, 0,
- 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, 0, -1, 255, 90, 256, 15, 252, 253, 5, 0,
- 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, 0, -1, 255, 107, 256, 15, 252, 253, 5, 0,
- 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, 0, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, "Cancel", 184, 0, 134, 88, 15, 252, 253, -1, 255,
- 248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0},
}
},
{ -1, -1, 288, 67, 248, 249, 250, "Enter a description of your saved game:", 251, -1, 8, 0, 3, -1, -1, -1, -1,
{
{1, 0, 0, "Save", 24, 0, 44, 72, 15, 252, 253, -1, 255,
- 248, 249, 250, &KyraEngine::gui_savegameConfirm, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, &KyraEngine::gui_savegameConfirm, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, "Cancel", 192, 0, 44, 72, 15, 252, 253, -1, 255,
- 248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0}
+ 248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, 0, 0, 0, 0, 0}
}
},
{ -1, -1, 208, 76, 248, 249, 250, "Rest in peace, Brandon.", 251, -1, 8, 0, 2, -1, -1, -1, -1,
{
{1, 0, 0, "Load a game", -1, -1, 30, 148, 15, 252, 253, 24, 0,
- 248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0},
+ 248, 249, 250, &KyraEngine::gui_loadGameMenu, -1, 0, 0, 0, 0, 0},
+
{1, 0, 0, "Quit playing", -1, -1, 47, 148, 15, 252, 253, 24, 0,
- 248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0}
+ 248, 249, 250, &KyraEngine::gui_quitPlaying, -1, 0, 0, 0, 0, 0}
+ }
+ },
+ { -1, -1, 208, 153, 248, 249, 250, "Game Controls", 251, -1, 8, 0, 6, -1, -1, -1, -1,
+ {
+ {1, 0, 0, 0, 110, 0, 30, 64, 15, 252, 253, 5, 0,
+ 248, 249, 250, &KyraEngine::gui_controlsChangeMusic, -1, "Music is ", 34, 32, 0, 0},
+
+ {1, 0, 0, 0, 110, 0, 47, 64, 15, 252, 253, 5, 0,
+ 248, 249, 250, &KyraEngine::gui_controlsChangeSounds, -1, "Sounds are ", 34, 49, 0, 0},
+
+ {1, 0, 0, 0, 110, 0, 64, 64, 15, 252, 253, 5, 0,
+ 248, 249, 250, &KyraEngine::gui_controlsChangeWalk, -1, "Walk speed ", 34, 66, 0, 0},
+
+ {1, 0, 0, 0, 110, 0, 81, 64, 15, 252, 253, 5, 0,
+ 248, 249, 250, 0, -1, 0, 34, 83, 0, 0 },
+
+ {1, 0, 0, 0, 110, 0, 98, 64, 15, 252, 253, 5, 0,
+ 248, 249, 250, &KyraEngine::gui_controlsChangeText, -1, "Text speed ", 34, 100, 0, 0 },
+
+ {1, 0, 0, "Main Menu", 64, 0, 127, 92, 15, 252, 253, -1, 255,
+ 248, 249, 250, &KyraEngine::gui_cancelSubMenu, -1, -0, 0, 0, 0, 0}
}
}
};
diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp
index 1f7284c9c1..f47136ced4 100644
--- a/engines/kyra/text.cpp
+++ b/engines/kyra/text.cpp
@@ -46,7 +46,7 @@ void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 ch
uint32 timeToEnd = strlen(chatStr) * 8 * _tickLength + _system->getMillis();
if (chatDuration != -1 ) {
- switch (_configTalkspeed) {
+ switch (_configTextspeed) {
case 0: chatDuration *= 2;
break;
case 2: chatDuration /= 4;
diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp
index fa16a8b008..10353f97ca 100644
--- a/engines/kyra/timer.cpp
+++ b/engines/kyra/timer.cpp
@@ -276,5 +276,14 @@ void KyraEngine::drawAmulet() {
}
_screen->showMouse();
}
+
+void KyraEngine::setWalkspeed(uint8 newSpeed) {
+ debugC(9, kDebugLevelMain, "KyraEngine::setWalkspeed(%i)", newSpeed);
+ static const uint8 speeds[] = {11, 9, 6, 5, 3};
+
+ assert(newSpeed < ARRAYSIZE(speeds));
+ setTimerDelay(5, speeds[newSpeed]);
+}
+
} // end of namespace Kyra