aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur/events.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-01-03 20:11:00 -1000
committerPaul Gilbert2014-01-03 20:11:00 -1000
commitce5b8c54a92accf12d43fe1f681d277166b72fb9 (patch)
tree9645e1b946979e2c4e5e6c49bf488f7a7cd8a7cf /engines/voyeur/events.cpp
parent7d9680058ac51042524f17d2ead7b3a43fa66b35 (diff)
downloadscummvm-rg350-ce5b8c54a92accf12d43fe1f681d277166b72fb9.tar.gz
scummvm-rg350-ce5b8c54a92accf12d43fe1f681d277166b72fb9.tar.bz2
scummvm-rg350-ce5b8c54a92accf12d43fe1f681d277166b72fb9.zip
VOYEUR: Hooked up debugger, and added a 'time' command
Diffstat (limited to 'engines/voyeur/events.cpp')
-rw-r--r--engines/voyeur/events.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp
index 5053b38d85..a46de4740b 100644
--- a/engines/voyeur/events.cpp
+++ b/engines/voyeur/events.cpp
@@ -101,9 +101,14 @@ void EventsManager::startMainClockInt() {
void EventsManager::mainVoyeurIntFunc() {
if (!(_vm->_voy._field478 & 1)) {
++_vm->_voy._switchBGNum;
- ++_vm->_voy._RTVNum;
- if (_vm->_voy._RTVNum >= _vm->_voy._field4F2)
- _vm->_voy._field4F0 = 1;
+
+ if (_vm->_debugger._isTimeActive) {
+ // Increase camera discharge
+ ++_vm->_voy._RTVNum;
+
+ if (_vm->_voy._RTVNum >= _vm->_voy._field4F2)
+ _vm->_voy._field4F0 = 1;
+ }
}
}
@@ -145,6 +150,9 @@ void EventsManager::checkForNextFrameCounter() {
if ((_gameCounter % GAME_FRAME_RATE) == 0)
mainVoyeurIntFunc();
+ // Give time to the debugger
+ _vm->_debugger.onFrame();
+
// Display the frame
g_system->copyRectToScreen((byte *)_vm->_graphicsManager._screenSurface.getPixels(),
SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -238,7 +246,14 @@ void EventsManager::pollEvents() {
return;
case Common::EVENT_KEYDOWN:
- _keyState[(byte)toupper(event.kbd.ascii)] = true;
+ // Check for debugger
+ if (event.kbd.keycode == Common::KEYCODE_d && (event.kbd.flags & Common::KBD_CTRL)) {
+ // Attach to the debugger
+ _vm->_debugger.attach();
+ _vm->_debugger.onFrame();
+ } else {
+ _keyState[(byte)toupper(event.kbd.ascii)] = true;
+ }
return;
case Common::EVENT_KEYUP:
_keyState[(byte)toupper(event.kbd.ascii)] = false;