aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/input.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-03-10 00:26:40 +0000
committerTravis Howell2009-03-10 00:26:40 +0000
commit2809c23fc9f70ce6542dcd2d1ee713d67965754c (patch)
tree8175022aa6c3831de70eb28c89710ab7fd8e98e0 /engines/scumm/input.cpp
parent940f19dc232b61092cc60f118053a4ad1551bee4 (diff)
downloadscummvm-rg350-2809c23fc9f70ce6542dcd2d1ee713d67965754c.tar.gz
scummvm-rg350-2809c23fc9f70ce6542dcd2d1ee713d67965754c.tar.bz2
scummvm-rg350-2809c23fc9f70ce6542dcd2d1ee713d67965754c.zip
Add snap scroll option from original games (SCUMM3-5), and enable for earlier games too.
svn-id: r39283
Diffstat (limited to 'engines/scumm/input.cpp')
-rw-r--r--engines/scumm/input.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 77a7301913..fed41778d9 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -451,6 +451,7 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
bool talkstopKeyEnabled = (VAR_TALKSTOP_KEY == 0xFF || VAR(VAR_TALKSTOP_KEY) != 0);
bool cutsceneExitKeyEnabled = (VAR_CUTSCENEEXIT_KEY == 0xFF || VAR(VAR_CUTSCENEEXIT_KEY) != 0);
bool mainmenuKeyEnabled = (VAR_MAINMENU_KEY == 0xFF || VAR(VAR_MAINMENU_KEY) != 0);
+ bool snapScrollKeyEnabled = (_game.version <= 2 || VAR_CAMERA_FAST_X != 0xFF);
// In FM-TOWNS games F8 / restart is always enabled
if (_game.platform == Common::kPlatformFMTowns)
@@ -485,10 +486,21 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
} else if (cutsceneExitKeyEnabled && (lastKeyHit.keycode == Common::KEYCODE_ESCAPE && lastKeyHit.flags == 0)) {
abortCutscene();
- // FIXME: Is the following line really necessary?
- if (VAR_CUTSCENEEXIT_KEY != 0xFF)
+ // VAR_CUTSCENEEXIT_KEY doesn't exist in SCUMM0
+ if (VAR_CUTSCENEEXIT_KEY != 0xFF) {
_mouseAndKeyboardStat = VAR(VAR_CUTSCENEEXIT_KEY);
+ }
+ } else if (snapScrollKeyEnabled && lastKeyHit.keycode == Common::KEYCODE_r &&
+ lastKeyHit.flags == Common::KBD_CTRL) {
+ _snapScroll ^= 1;
+ if (_snapScroll) {
+ messageDialog((const char *)"Snap scroll on");
+ } else {
+ messageDialog((const char *)"Snap scroll off");
+ }
+ if (VAR_CAMERA_FAST_X != 0xFF)
+ VAR(VAR_CAMERA_FAST_X) = _snapScroll;
} else if (lastKeyHit.ascii == '[' || lastKeyHit.ascii == ']') { // Change music volume
int vol = ConfMan.getInt("music_volume") / 16;
if (lastKeyHit.ascii == ']' && vol < 16)