From 240871aa2020c5bfc86b6d997465a12fc9a2e3b8 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Sat, 1 Aug 2009 03:07:18 +0000 Subject: * Added support for loop substatus * Set loop substatus to Ordinary when changing rooms svn-id: r42971 --- engines/draci/game.cpp | 14 ++++++++++++++ engines/draci/game.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 3665c09d71..995cd5d013 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -154,16 +154,22 @@ Game::Game(DraciEngine *vm) : _vm(vm) { void Game::start() { while (!shouldQuit()) { + // If the scheduled room differs from the current one, do a room change if (_newRoom != _currentRoom._roomNum) { + setLoopSubstatus(kStatusOrdinary); + + // Do the actual change changeRoom(_newRoom); + // Set the current room / gate to the new value _currentRoom._roomNum = _newRoom; _currentGate = _newGate; // HACK: Won't be needed once I've implemented the loop properly _roomChange = false; + // Run the program for the gate the dragon came through runGateProgram(_newGate); } @@ -679,10 +685,18 @@ void Game::setLoopStatus(LoopStatus status) { _loopStatus = status; } +void Game::setLoopSubstatus(LoopStatus status) { + _loopSubstatus = status; +} + LoopStatus Game::getLoopStatus() { return _loopStatus; } +LoopStatus Game::getLoopSubstatus() { + return _loopSubstatus; +} + int Game::getVariable(int numVar) { return _variables[numVar]; } diff --git a/engines/draci/game.h b/engines/draci/game.h index 1e488ca083..a38b71a256 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -216,7 +216,9 @@ public: void setMarkedAnimationIndex(int index); void setLoopStatus(LoopStatus status); + void setLoopSubstatus(LoopStatus status); LoopStatus getLoopStatus(); + LoopStatus getLoopSubstatus(); bool shouldQuit() { return _shouldQuit; } void setQuit(bool quit) { _shouldQuit = quit; } @@ -245,6 +247,7 @@ private: int _newGate; LoopStatus _loopStatus; + LoopStatus _loopSubstatus; bool _shouldQuit; bool _shouldExitLoop; -- cgit v1.2.3