Refactored running loop().

- shouldExitLoop() is a bool again and introduced new flag isReloaded() instead
  of adding special hacky value 2
- loop() accepts 2 parameters: loop substatus and shouldExit flag, because each
  caller previously had to set and restore these manually.  loop() now also
  tests whether the substatuses are properly nested.  reordered the
  loop-exitting code.
- renamed loop substatuses to logical names
- enterNewRoom() returns bool whether loop() should continue so that start()
  doesn't have to test and clear shouldEndProgram().  it doesn't need
  force_reload as a parameter anymore.
- dialog selections use new inner substatus instead of outer substatus, for
  consistency

svn-id: r45607
This commit is contained in:
Robert Špalek 2009-11-02 02:28:43 +00:00
parent 9f711bd0ce
commit c45f0343f4
5 changed files with 89 additions and 95 deletions

View file

@ -152,7 +152,7 @@ Common::Error loadSavegameData(int saveGameIdx, DraciEngine *vm) {
// Post-processing
vm->_game->scheduleEnteringRoomUsingGate(vm->_game->getRoomNum(), 0);
vm->_game->setRoomNum(vm->_game->getPreviousRoomNum());
vm->_game->setExitLoop(2); // 2 > true means immediate exit for the loop
vm->_game->setIsReloaded(true);
vm->_game->inventoryReload();