[Scummvm-cvs-logs] SF.net SVN: scummvm: [21145] scummvm/trunk/engines/kyra
vinterstum at users.sourceforge.net
vinterstum at users.sourceforge.net
Wed Mar 8 05:16:04 CET 2006
Revision: 21145
Author: vinterstum
Date: 2006-03-08 05:15:13 -0800 (Wed, 08 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21145&view=rev
Log Message:
-----------
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 :).
Modified Paths:
--------------
scummvm/trunk/engines/kyra/gui.cpp
scummvm/trunk/engines/kyra/kyra.cpp
scummvm/trunk/engines/kyra/kyra.h
scummvm/trunk/engines/kyra/saveload.cpp
scummvm/trunk/engines/kyra/script_v1.cpp
scummvm/trunk/engines/kyra/staticres.cpp
scummvm/trunk/engines/kyra/text.cpp
scummvm/trunk/engines/kyra/timer.cpp
Modified: scummvm/trunk/engines/kyra/gui.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui.cpp 2006-03-08 12:09:07 UTC (rev 21144)
+++ scummvm/trunk/engines/kyra/gui.cpp 2006-03-08 13:15:13 UTC (rev 21145)
@@ -414,10 +414,12 @@
_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 @@
_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 @@
}
gui_redrawTextfield();
- _keyboardEvent.pending = 0;
- _keyboardEvent.repeat = 0;
while (_displaySubMenu) {
gui_getInput();
gui_updateSavegameString();
@@ -905,6 +907,181 @@
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);
Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp 2006-03-08 12:09:07 UTC (rev 21144)
+++ scummvm/trunk/engines/kyra/kyra.cpp 2006-03-08 13:15:13 UTC (rev 21145)
@@ -440,7 +440,12 @@
assert(_movFacingTable);
_movFacingTable[0] = 8;
- _configTalkspeed = 1;
+ _configTextspeed = 1;
+ _configWalkspeed = 2;
+ _configMusic = true;
+ _configSounds = true;
+ _configVoice = 1;
+
_skipFlag = false;
_marbleVaseItem = -1;
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h 2006-03-08 12:09:07 UTC (rev 21144)
+++ scummvm/trunk/engines/kyra/kyra.h 2006-03-08 13:15:13 UTC (rev 21145)
@@ -201,8 +201,8 @@
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 @@
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 @@
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 @@
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 @@
void gui_redrawTextfield();
void gui_fadePalette();
void gui_restorePalette();
+ void gui_setupControls(Menu &menu);
uint8 _game;
bool _quitFlag;
@@ -781,8 +789,12 @@
int8 _startSentencePalIndex;
bool _fadeText;
- uint8 _configTalkspeed;
-
+ uint8 _configTextspeed;
+ uint8 _configWalkspeed;
+ bool _configMusic;
+ bool _configSounds;
+ uint8 _configVoice;
+
Common::String _targetName;
int _curMusicTheme;
Modified: scummvm/trunk/engines/kyra/saveload.cpp
===================================================================
--- scummvm/trunk/engines/kyra/saveload.cpp 2006-03-08 12:09:07 UTC (rev 21144)
+++ scummvm/trunk/engines/kyra/saveload.cpp 2006-03-08 13:15:13 UTC (rev 21145)
@@ -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 @@
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 @@
out->writeSint16BE(_lastMusicCommand);
+ out->writeByte(_configTextspeed);
+ out->writeByte(_configWalkspeed);
+ out->writeByte(_configMusic);
+ out->writeByte(_configSounds);
+ out->writeByte(_configVoice);
+
out->flush();
// check for errors
Modified: scummvm/trunk/engines/kyra/script_v1.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v1.cpp 2006-03-08 12:09:07 UTC (rev 21144)
+++ scummvm/trunk/engines/kyra/script_v1.cpp 2006-03-08 13:15:13 UTC (rev 21145)
@@ -44,9 +44,12 @@
_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_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_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;
}
Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp 2006-03-08 12:09:07 UTC (rev 21144)
+++ scummvm/trunk/engines/kyra/staticres.cpp 2006-03-08 13:15:13 UTC (rev 21145)
@@ -907,56 +907,89 @@
{ -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}
+ }
}
};
Modified: scummvm/trunk/engines/kyra/text.cpp
===================================================================
--- scummvm/trunk/engines/kyra/text.cpp 2006-03-08 12:09:07 UTC (rev 21144)
+++ scummvm/trunk/engines/kyra/text.cpp 2006-03-08 13:15:13 UTC (rev 21145)
@@ -46,7 +46,7 @@
uint32 timeToEnd = strlen(chatStr) * 8 * _tickLength + _system->getMillis();
if (chatDuration != -1 ) {
- switch (_configTalkspeed) {
+ switch (_configTextspeed) {
case 0: chatDuration *= 2;
break;
case 2: chatDuration /= 4;
Modified: scummvm/trunk/engines/kyra/timer.cpp
===================================================================
--- scummvm/trunk/engines/kyra/timer.cpp 2006-03-08 12:09:07 UTC (rev 21144)
+++ scummvm/trunk/engines/kyra/timer.cpp 2006-03-08 13:15:13 UTC (rev 21145)
@@ -276,5 +276,14 @@
}
_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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list