From e0e06fc9e065466e4092e983056d67d1469e6752 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Sat, 1 Aug 2009 17:52:16 +0000 Subject: * Made the engine set the appropriate loop status before running a gate program or entering the main loop * Removed hack which ran programs for all gates when the room was changed svn-id: r42977 --- engines/draci/game.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'engines/draci') diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index c4f1161945..4f83f135c6 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -184,6 +184,10 @@ void Game::start() { runGateProgram(_newGate); } + // Mimic the original engine by setting the loop status to Ordinary before + // entering the main loop + setLoopStatus(kStatusOrdinary); + loop(); } } @@ -433,13 +437,6 @@ void Game::loadRoom(int roomNum) { debugC(4, kDraciLogicDebugLevel, "Running room init program..."); _vm->_script->run(_currentRoom._program, _currentRoom._init); - // HACK: Gates' scripts shouldn't be run unconditionally - // This is for testing - //for (uint i = 0; i < _currentRoom._numGates; ++i) { - // debugC(6, kDraciLogicDebugLevel, "Running program for gate %d", i); - // _vm->_script->run(_currentRoom._program, gates[i]); - //} - // Set room palette f = _vm->_paletteArchive->getFile(_currentRoom._palette); _vm->_screen->setPalette(f->_data, 0, kNumColours); @@ -651,6 +648,11 @@ void Game::changeRoom(uint roomNum) { void Game::runGateProgram(int gate) { + debugC(6, kDraciLogicDebugLevel, "Running program for gate %d", gate); + + // Set the appropriate loop statu before executing the gate program + setLoopStatus(kStatusGate); + // Mark last animation int lastAnimIndex = _vm->_anims->getLastIndex(); -- cgit v1.2.3