From 9f711bd0ced5368a0dd5a28be7db5d7128849c01 Mon Sep 17 00:00:00 2001 From: Robert Špalek Date: Sun, 1 Nov 2009 23:20:46 +0000 Subject: Commented the rest of the loop() logic svn-id: r45606 --- engines/draci/game.cpp | 7 +++++-- engines/draci/game.h | 16 ++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'engines/draci') diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index d8f9f899c0..67b7b04ef6 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -242,8 +242,9 @@ void Game::init() { void Game::loop() { // Can run both as an outer and inner loop. In both mode it updates - // the screen according to the timer. It the outer mode it also reacts - // to user events. In the inner mode, the loop runs until its stopping + // the screen according to the timer. It the outer mode + // (kSubstatusOrdinary) it also reacts to user events. In the inner + // mode (all other kSubstatus* enums), the loop runs until its stopping // condition, possibly stopping earlier if the user interrupts it, // however no other user intervention is allowed. Surface *surface = _vm->_screen->getSurface(); @@ -303,6 +304,8 @@ void Game::loop() { updateCursor(); updateTitle(); + // During the normal game-play, in particular not when + // running the init-scripts, enable interactivity. if (_loopStatus == kStatusOrdinary && _loopSubstatus == kSubstatusOrdinary) { if (_vm->_mouse->lButtonPressed()) { _vm->_mouse->lButtonSet(false); diff --git a/engines/draci/game.h b/engines/draci/game.h index 3ac27a2997..3cd55a77ea 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -159,17 +159,17 @@ struct Room { }; enum LoopStatus { - kStatusOrdinary, - kStatusGate, - kStatusInventory, - kStatusDialogue + kStatusOrdinary, // normal game-play: everything allowed + kStatusGate, // during running init-scripts when entering a room: disable interactivity + kStatusInventory, // inventory is open: cannot change the room or go to map + kStatusDialogue // during a dialogue: cannot change the room, go to inventory }; enum LoopSubstatus { - kSubstatusOrdinary, - kSubstatusTalk, - kSubstatusFade, - kSubstatusStrange + kSubstatusOrdinary, // outer loop: everything is allowed + kSubstatusTalk, // playing a voice: inner loop will exit afterwards + kSubstatusFade, // fading a palette: inner loop will exit when done + kSubstatusStrange // other inner loop: either immediately exiting or waiting for an animation to end (whose callback ends the loop) }; class Game { -- cgit v1.2.3