aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2013-08-16 19:24:40 +0200
committeruruk2013-08-16 19:24:40 +0200
commit4430e435d8c437cf236f432684fa5dba76f990e7 (patch)
treee49b8facb1faee7c674bda790e8ac1ddd6ee170a /engines
parentdc1e9022b1c6276af8065e72260b8ae9084bcd57 (diff)
downloadscummvm-rg350-4430e435d8c437cf236f432684fa5dba76f990e7.tar.gz
scummvm-rg350-4430e435d8c437cf236f432684fa5dba76f990e7.tar.bz2
scummvm-rg350-4430e435d8c437cf236f432684fa5dba76f990e7.zip
AVALANCHE: Upgrade Scrolls::normscroll().
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/avalot.cpp140
-rw-r--r--engines/avalanche/scrolls2.cpp13
2 files changed, 78 insertions, 75 deletions
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index fff969bc34..229159fafe 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -61,6 +61,76 @@ Avalot::Avalot(AvalancheEngine *vm) {
_vm = vm;
}
+void Avalot::handleKeyDown(Common::Event &event) {
+ //if (keyboardclick)
+ // click();
+ //
+ // To be implemented later with the sounds, I assume.
+
+ if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
+ _vm->_parser->handleInputText(event);
+ else
+ switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
+ case Common::KEYCODE_KP8:
+ event.kbd.keycode = Common::KEYCODE_UP;
+ break;
+ case Common::KEYCODE_KP2:
+ event.kbd.keycode = Common::KEYCODE_DOWN;
+ break;
+ case Common::KEYCODE_KP6:
+ event.kbd.keycode = Common::KEYCODE_RIGHT;
+ break;
+ case Common::KEYCODE_KP4:
+ event.kbd.keycode = Common::KEYCODE_LEFT;
+ break;
+ case Common::KEYCODE_KP9:
+ event.kbd.keycode = Common::KEYCODE_PAGEUP;
+ break;
+ case Common::KEYCODE_KP3:
+ event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
+ break;
+ case Common::KEYCODE_KP7:
+ event.kbd.keycode = Common::KEYCODE_HOME;
+ break;
+ case Common::KEYCODE_KP1:
+ event.kbd.keycode = Common::KEYCODE_END;
+ break;
+ }
+
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_UP:
+ case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_PAGEUP:
+ case Common::KEYCODE_PAGEDOWN:
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_KP5:
+ if (_vm->_gyro->alive) {
+ _vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
+ _vm->_lucerna->showrw();
+ if (_vm->_gyro->demo)
+ _vm->_basher->get_demorec();
+ return;
+ }
+ case Common::KEYCODE_BACKSPACE:
+ _vm->_parser->handleBackspace();
+ break;
+ case Common::KEYCODE_RETURN:
+ _vm->_parser->handleReturn();
+ break;
+ }
+
+ _vm->_lucerna->showrw();
+ if (_vm->_gyro->demo)
+ _vm->_basher->get_demorec();
+}
+
+
+
+
+
void Avalot::setup() {
int16 gd, gm;
@@ -150,76 +220,6 @@ void Avalot::setup() {
_vm->_visa->dixi('q', 83); // Info on the game, etc.
}
-
-
-void Avalot::handleKeyDown(Common::Event &event) {
- //if (keyboardclick)
- // click();
- //
- // To be implemented later with the sounds, I assume.
-
- if ((32 <= event.kbd.ascii) && (event.kbd.ascii <= 128) && (event.kbd.ascii != 47))
- _vm->_parser->handleInputText(event);
- else
- switch (event.kbd.keycode) { // We can control Avvy with the numpad as well.
- case Common::KEYCODE_KP8:
- event.kbd.keycode = Common::KEYCODE_UP;
- break;
- case Common::KEYCODE_KP2:
- event.kbd.keycode = Common::KEYCODE_DOWN;
- break;
- case Common::KEYCODE_KP6:
- event.kbd.keycode = Common::KEYCODE_RIGHT;
- break;
- case Common::KEYCODE_KP4:
- event.kbd.keycode = Common::KEYCODE_LEFT;
- break;
- case Common::KEYCODE_KP9:
- event.kbd.keycode = Common::KEYCODE_PAGEUP;
- break;
- case Common::KEYCODE_KP3:
- event.kbd.keycode = Common::KEYCODE_PAGEDOWN;
- break;
- case Common::KEYCODE_KP7:
- event.kbd.keycode = Common::KEYCODE_HOME;
- break;
- case Common::KEYCODE_KP1:
- event.kbd.keycode = Common::KEYCODE_END;
- break;
- }
-
- switch (event.kbd.keycode) {
- case Common::KEYCODE_UP:
- case Common::KEYCODE_DOWN:
- case Common::KEYCODE_RIGHT:
- case Common::KEYCODE_LEFT:
- case Common::KEYCODE_PAGEUP:
- case Common::KEYCODE_PAGEDOWN:
- case Common::KEYCODE_HOME:
- case Common::KEYCODE_END:
- case Common::KEYCODE_KP5:
- if (_vm->_gyro->alive) {
- _vm->_trip->handleMoveKey(event); // Fallthroughs are intended.
- _vm->_lucerna->showrw();
- if (_vm->_gyro->demo)
- _vm->_basher->get_demorec();
- return;
- }
- case Common::KEYCODE_BACKSPACE:
- _vm->_parser->handleBackspace();
- break;
- case Common::KEYCODE_RETURN:
- _vm->_parser->handleReturn();
- break;
- }
-
- _vm->_lucerna->showrw();
- if (_vm->_gyro->demo)
- _vm->_basher->get_demorec();
-}
-
-
-
void Avalot::run(Common::String arg) {
setup();
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index 4e7507a7d3..1457503a98 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -161,12 +161,14 @@ void Scrolls::normscroll() {
::Graphics::Surface temp;
temp.copyFrom(_vm->_graphics->_surface);
_vm->_graphics->_surface.copyFrom(_vm->_graphics->_scrolls); // TODO: Rework it using getSubArea !!!!!!!
- _vm->_graphics->refreshScreen();
-
+
Common::Event event;
while (!_vm->shouldQuit()) {
+ _vm->_graphics->refreshScreen();
+
_vm->getEvent(event);
- if ((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) || (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) || (event.kbd.keycode == Common::KEYCODE_PLUS)))
+ if ((event.type == Common::EVENT_LBUTTONUP) ||
+ ((event.type == Common::EVENT_KEYDOWN) && ((event.kbd.keycode == Common::KEYCODE_ESCAPE) || (event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_HASH) || (event.kbd.keycode == Common::KEYCODE_PLUS))))
break;
}
@@ -205,7 +207,8 @@ void Scrolls::normscroll() {
//
//#ifdef RECORD record_one(); #endif
//
- //_vm->_gyro->screturn = r == '#'; /* "back door" */
+// _vm->_gyro->screturn = r == '#'; /* "back door" */
+
state(0);
_vm->_gyro->seescroll = false;
_vm->_lucerna->mousepage(_vm->_gyro->cp);
@@ -558,7 +561,7 @@ void Scrolls::bubble(func2 gotoit) {
CursorMan.showMouse(false);
_vm->_gyro->dropsok = true;
- /*setvisualpage(cp);
+ //setvisualpage(cp);
CursorMan.showMouse(true); /*sink;*/
_vm->_gyro->oncandopageswap = true;
resetscrolldriver();