aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2013-07-24 13:38:32 +0200
committeruruk2013-07-24 13:38:32 +0200
commite8841fbe5c39ff07aa099f8207cd8d571779585e (patch)
tree466ce41f46e4e6afcb335fe0e49f7dc035e5abfd /engines
parentbddc0e5cbf1046aef3d6dfe543954477791d4b3b (diff)
downloadscummvm-rg350-e8841fbe5c39ff07aa099f8207cd8d571779585e.tar.gz
scummvm-rg350-e8841fbe5c39ff07aa099f8207cd8d571779585e.tar.bz2
scummvm-rg350-e8841fbe5c39ff07aa099f8207cd8d571779585e.zip
AVALANCHE: Implement Trip::handleMoveKey(), update Avalot::handleKeyDown().
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/avalot.cpp1
-rw-r--r--engines/avalanche/trip6.cpp67
2 files changed, 67 insertions, 1 deletions
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 7b315b3c07..1d62e0b96c 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -164,6 +164,7 @@ void Avalot::handleKeyDown(const Common::Event &event) {
case Common::KEYCODE_PAGEDOWN:
case Common::KEYCODE_HOME:
case Common::KEYCODE_END:
+ case Common::KEYCODE_KP5:
_vm->_trip.handleMoveKey(event); // Fallthroughs are intended.
break;
}
diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp
index b90c50009b..3d8d540ef3 100644
--- a/engines/avalanche/trip6.cpp
+++ b/engines/avalanche/trip6.cpp
@@ -1570,7 +1570,72 @@ void Trip::new_game_for_trippancy() { /* Called by gyro.newgame */
void Trip::handleMoveKey(const Common::Event &event) {
- warning("STUB: Avalot::handleMoveKey()");
+ //if ((_vm->_gyro.ctrl == cjoy) | (!_vm->_gyro.dna.user_moves_avvy))
+ // return;
+ //
+ // We don't mess around with the joystick.
+
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_UP:
+ if (_vm->_gyro.dna.rw != up) {
+ _vm->_gyro.dna.rw = up;
+ rwsp(0, _vm->_gyro.dna.rw);
+ } else
+ stopwalking();
+ break;
+ case Common::KEYCODE_DOWN:
+ if (_vm->_gyro.dna.rw != down) {
+ _vm->_gyro.dna.rw = down;
+ rwsp(0, _vm->_gyro.dna.rw);
+ } else
+ stopwalking();
+ break;
+ case Common::KEYCODE_LEFT:
+ if (_vm->_gyro.dna.rw != left) {
+ _vm->_gyro.dna.rw = left;
+ rwsp(0, _vm->_gyro.dna.rw);
+ } else
+ stopwalking();
+ break;
+ case Common::KEYCODE_RIGHT:
+ if (_vm->_gyro.dna.rw != right) {
+ _vm->_gyro.dna.rw = right;
+ rwsp(0, _vm->_gyro.dna.rw);
+ } else
+ stopwalking();
+ break;
+ case Common::KEYCODE_PAGEUP:
+ if (_vm->_gyro.dna.rw != ur) {
+ _vm->_gyro.dna.rw = ur;
+ rwsp(0, _vm->_gyro.dna.rw);
+ } else
+ stopwalking();
+ break;
+ case Common::KEYCODE_PAGEDOWN:
+ if (_vm->_gyro.dna.rw != dr) {
+ _vm->_gyro.dna.rw = dr;
+ rwsp(0, _vm->_gyro.dna.rw);
+ } else
+ stopwalking();
+ break;
+ case Common::KEYCODE_END:
+ if (_vm->_gyro.dna.rw != dl) {
+ _vm->_gyro.dna.rw = dl;
+ rwsp(0, _vm->_gyro.dna.rw);
+ } else
+ stopwalking();
+ break;
+ case Common::KEYCODE_HOME:
+ if (_vm->_gyro.dna.rw != ul) {
+ _vm->_gyro.dna.rw = ul;
+ rwsp(0, _vm->_gyro.dna.rw);
+ } else
+ stopwalking();
+ break;
+ case Common::KEYCODE_KP5:
+ stopwalking();
+ break;
+ }
}