Commented the rest of the loop() logic

svn-id: r45606
This commit is contained in:
Robert Špalek 2009-11-01 23:20:46 +00:00
parent 9ad86a800a
commit 9f711bd0ce
2 changed files with 13 additions and 10 deletions

View File

@ -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);

View File

@ -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 {