aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorVladimir Menshakov2011-06-14 12:07:59 +0400
committerAlyssa Milburn2011-06-15 17:35:00 +0200
commitcf942d930884be0c71f654403a15065385d61eb3 (patch)
treeed1990d1f7f581356b0d1f315010f2edd2f4740e /engines/dreamweb
parent5826ae88aee4f682d7a5b74b093e419db9b35f9f (diff)
downloadscummvm-rg350-cf942d930884be0c71f654403a15065385d61eb3.tar.gz
scummvm-rg350-cf942d930884be0c71f654403a15065385d61eb3.tar.bz2
scummvm-rg350-cf942d930884be0c71f654403a15065385d61eb3.zip
DREAMWEB: cleanup keys handling, added turbo shortcut
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamweb.cpp77
-rw-r--r--engines/dreamweb/dreamweb.h1
2 files changed, 39 insertions, 39 deletions
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index bbf25a7bcc..ea347d10a9 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -69,6 +69,7 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
_outSaveFile = 0;
_inSaveFile = 0;
_speed = 1;
+ _turbo = false;
_oldMouseState = 0;
_channel0 = 0;
_channel1 = 0;
@@ -94,10 +95,12 @@ void DreamWebEngine::setVSyncInterrupt(bool flag) {
void DreamWebEngine::waitForVSync() {
processEvents();
- while (!_vSyncInterrupt) {
- _system->delayMillis(10);
+ if (!_turbo) {
+ while (!_vSyncInterrupt) {
+ _system->delayMillis(10);
+ }
+ setVSyncInterrupt(false);
}
- setVSyncInterrupt(false);
dreamgen::doshake(_context);
dreamgen::dofade(_context);
@@ -118,52 +121,48 @@ void DreamWebEngine::processEvents() {
soundHandler();
Common::Event event;
while (event_manager->pollEvent(event)) {
- bool keyHandled = false;
switch(event.type) {
case Common::EVENT_KEYDOWN:
- switch (event.kbd.keycode) {
- case Common::KEYCODE_d:
- if (event.kbd.flags & Common::KBD_CTRL) {
+ if (event.kbd.flags & Common::KBD_CTRL) {
+ switch (event.kbd.keycode) {
+
+ case Common::KEYCODE_d:
_console->attach();
_console->onFrame();
- keyHandled = true;
- }
- break;
- case Common::KEYCODE_f:
- if (event.kbd.flags & Common::KBD_CTRL) {
- if (_speed != 10)
- setSpeed(10);
- else
- setSpeed(1);
- keyHandled = true;
- }
- break;
- case Common::KEYCODE_c: //skip statue puzzle
- if (event.kbd.flags & Common::KBD_CTRL) {
+ break;
+
+ case Common::KEYCODE_f:
+ setSpeed(_speed != 20? 20: 1);
+ break;
+
+ case Common::KEYCODE_g:
+ _turbo = !_turbo;
+ break;
+
+ case Common::KEYCODE_c: //skip statue puzzle
_context.data.byte(dreamgen::kSymbolbotnum) = 3;
_context.data.byte(dreamgen::kSymboltopnum) = 5;
- keyHandled = true;
+ break;
+
+ default:
+ break;
}
- break;
- default:
- break;
- }
- if (!keyHandled) {
- // As far as I can see, the only keys checked
- // for in 'lasthardkey' are 1 (ESC) and 57
- // (space) so add special cases for them and
- // treat everything else as 0.
- if (event.kbd.keycode == Common::KEYCODE_ESCAPE)
- _context.data.byte(dreamgen::kLasthardkey) = 1;
- else if (event.kbd.keycode == Common::KEYCODE_SPACE)
- _context.data.byte(dreamgen::kLasthardkey) = 57;
- else
- _context.data.byte(dreamgen::kLasthardkey) = 0;
- if (event.kbd.ascii)
- keyPressed(event.kbd.ascii);
+ return; //do not pass ctrl + key to the engine
}
+ // As far as I can see, the only keys checked
+ // for in 'lasthardkey' are 1 (ESC) and 57
+ // (space) so add special cases for them and
+ // treat everything else as 0.
+ if (event.kbd.keycode == Common::KEYCODE_ESCAPE)
+ _context.data.byte(dreamgen::kLasthardkey) = 1;
+ else if (event.kbd.keycode == Common::KEYCODE_SPACE)
+ _context.data.byte(dreamgen::kLasthardkey) = 57;
+ else
+ _context.data.byte(dreamgen::kLasthardkey) = 0;
+ if (event.kbd.ascii)
+ keyPressed(event.kbd.ascii);
break;
default:
break;
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index f683fca4d5..0f5e5bdc98 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -120,6 +120,7 @@ private:
Common::InSaveFile *_inSaveFile;
uint _speed;
+ bool _turbo;
uint _oldMouseState;
struct Sample {