aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/game.cpp
diff options
context:
space:
mode:
authorRobert Špalek2009-10-01 16:47:34 +0000
committerRobert Špalek2009-10-01 16:47:34 +0000
commit4a7cea681360d21a9be983bf75942a1c693cdbb9 (patch)
treef8147564c5d20222fe45cc8ac068aa15d942dff8 /engines/draci/game.cpp
parent2fa7fbc1a53b7f158dfe9c70395d1b8a2cd442d1 (diff)
downloadscummvm-rg350-4a7cea681360d21a9be983bf75942a1c693cdbb9.tar.gz
scummvm-rg350-4a7cea681360d21a9be983bf75942a1c693cdbb9.tar.bz2
scummvm-rg350-4a7cea681360d21a9be983bf75942a1c693cdbb9.zip
Fixed event handling. ValGrind fixups.
My yesterday's fix on handling 1 event per call caused the game to be unbearably slow on Linux. The old way was much faster. I have solved too fast a succession of mouse button down and up by not clearing the mouse flag when the button goes up instead. Fixed a memory leak and uninitialized variable after my refactoring of game location changes; found by ValGrind. svn-id: r44525
Diffstat (limited to 'engines/draci/game.cpp')
-rw-r--r--engines/draci/game.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 44a77f8f22..2593d5f763 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -157,6 +157,8 @@ void Game::init() {
_shouldQuit = false;
_shouldExitLoop = false;
_scheduledPalette = 0;
+ setLoopStatus(kStatusGate);
+ setLoopSubstatus(kSubstatusOrdinary);
_animUnderCursor = kOverlayImage;
@@ -851,8 +853,7 @@ void Game::dialogueDone() {
_vm->_anims->stop(_dialogueAnims[i]->getID());
}
- _dialogueArchive->closeArchive();
-
+ delete _dialogueArchive;
delete[] _dialogueBlocks;
setLoopStatus(kStatusOrdinary);
@@ -1286,6 +1287,10 @@ void Game::enterNewRoom() {
_persons[kDragonObject]._y = 0;
}
+ // Set the appropriate loop statu before loading the room
+ setLoopStatus(kStatusGate);
+ setLoopSubstatus(kSubstatusOrdinary);
+
loadRoom(_newRoom);
loadOverlays();
@@ -1309,10 +1314,6 @@ void Game::enterNewRoom() {
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);
- setLoopSubstatus(kSubstatusOrdinary);
-
// Mark last animation
int lastAnimIndex = _vm->_anims->getLastIndex();