aboutsummaryrefslogtreecommitdiff
path: root/scumm/input.cpp
diff options
context:
space:
mode:
authorMax Horn2005-03-06 18:00:54 +0000
committerMax Horn2005-03-06 18:00:54 +0000
commita0d5debc7a8f4b24b6888de668d18fa8e0aedab9 (patch)
tree376f92d6891a17f33b9bc1208b8e881bec97c669 /scumm/input.cpp
parente55d31ba39cab6384bfae0cac12ab4e9013a0b06 (diff)
downloadscummvm-rg350-a0d5debc7a8f4b24b6888de668d18fa8e0aedab9.tar.gz
scummvm-rg350-a0d5debc7a8f4b24b6888de668d18fa8e0aedab9.tar.bz2
scummvm-rg350-a0d5debc7a8f4b24b6888de668d18fa8e0aedab9.zip
Added dialogs which are shown when you modify the talkspeed or music volume using hotkeys (FR #1153300)
svn-id: r17009
Diffstat (limited to 'scumm/input.cpp')
-rw-r--r--scumm/input.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/scumm/input.cpp b/scumm/input.cpp
index ef5aa4bdb0..3836c40636 100644
--- a/scumm/input.cpp
+++ b/scumm/input.cpp
@@ -26,6 +26,7 @@
#include "common/system.h"
#include "scumm/debugger.h"
+#include "scumm/dialogs.h"
#include "scumm/imuse.h"
#include "scumm/insane/insane.h"
#include "scumm/scumm.h"
@@ -383,27 +384,37 @@ void ScummEngine::processKbd(bool smushMode) {
if (_sound->_sfxMode & 2)
stopTalk();
return;
- } else if (_lastKeyHit == '[') { // [ Music volume down
- int vol = ConfMan.getInt("music_volume");
- if (!(vol & 0xF) && vol)
- vol -= 16;
- vol = vol & 0xF0;
- ConfMan.set("music_volume", vol);
- setupVolumes();
- } else if (_lastKeyHit == ']') { // ] Music volume up
- int vol = ConfMan.getInt("music_volume");
- vol = (vol + 16) & 0xFF0;
- if (vol > 255) vol = 255;
+ } else if (_lastKeyHit == '[' || _lastKeyHit == ']') { // Change music volume
+ int vol = ConfMan.getInt("music_volume") / 16;
+ if (_lastKeyHit == ']' && vol < 16)
+ vol++;
+ else if (_lastKeyHit == '[' && vol > 0)
+ vol--;
+
+ // Display the music volume
+ // FIXME: Should we use runDialog here? It'll pause the sound/music and video
+ // which is both good and bad...
+ ValueDisplayDialog dlg("Music volume: ", 0, 16, vol, ']', '[');
+ vol = runDialog(dlg);
+
+ vol *= 16;
+ if (vol > SoundMixer::kMaxMixerVolume)
+ vol = SoundMixer::kMaxMixerVolume;
+
ConfMan.set("music_volume", vol);
setupVolumes();
- } else if (_lastKeyHit == '-') { // - text speed down
- if (_defaultTalkDelay < 9)
+ } else if (_lastKeyHit == '-' || _lastKeyHit == '+') { // Change text speed
+ if (_lastKeyHit == '+' && _defaultTalkDelay < 9)
_defaultTalkDelay++;
- if (VAR_CHARINC != 0xFF)
- VAR(VAR_CHARINC) = _defaultTalkDelay;
- } else if (_lastKeyHit == '+') { // + text speed up
- if (_defaultTalkDelay > 0)
+ else if (_lastKeyHit == '-' && _defaultTalkDelay > 0)
_defaultTalkDelay--;
+
+ // Display the talk speed
+ // FIXME: Should we use runDialog here? It'll pause the sound/music and video
+ // which is both good and bad...
+ ValueDisplayDialog dlg("Talk speed: ", 0, 10, _defaultTalkDelay, '+', '-');
+ _defaultTalkDelay = runDialog(dlg);
+
if (VAR_CHARINC != 0xFF)
VAR(VAR_CHARINC) = _defaultTalkDelay;
} else if (_lastKeyHit == '~' || _lastKeyHit == '#') { // Debug console