[Scummvm-cvs-logs] CVS: scummvm/sword2 sword2.cpp,1.100,1.101
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Tue Jan 6 08:50:11 CET 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm script.cpp,1.141,1.142
- Next message: [Scummvm-cvs-logs] CVS: scummvm/queen journal.cpp,1.17,1.18 logic.cpp,1.158,1.159 logic.h,1.101,1.102 queen.cpp,1.68,1.69 queen.h,1.24,1.25
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1:/tmp/cvs-serv7969
Modified Files:
sword2.cpp
Log Message:
Never call _system->quit() directly. Let ScummVM handle that so that the
engine can be properly deleted first. Apart from being the nice thing to
do, this should make it easier to Valgrind for memory leaks.
Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.cpp,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- sword2.cpp 6 Jan 2004 13:44:17 -0000 1.100
+++ sword2.cpp 6 Jan 2004 16:49:04 -0000 1.101
@@ -253,9 +253,7 @@
}
void Sword2Engine::closeGame(void) {
- // Stop music instantly!
- killMusic();
- _system->quit();
+ _quit = true;
}
void Sword2Engine::gameCycle(void) {
@@ -299,10 +297,8 @@
_gui->readOptionSettings();
debug(5, "CALLING: initialiseGame");
- if (initialiseGame()) {
- closeGame();
+ if (initialiseGame())
return;
- }
if (_saveSlot != -1) {
if (saveExists(_saveSlot))
@@ -322,6 +318,7 @@
// 1 in 4 frames, to speed up game
_gameCycle = 0;
+ _quit = false;
while (1) {
if (_debugger->isAttached())
@@ -387,6 +384,13 @@
gameCycle();
}
+ // We can't use this as termination condition for the looop,
+ // because we want the break to happen before updating the
+ // screen again.
+
+ if (_quit)
+ break;
+
// creates the debug text blocks
_debugger->buildDebugText();
@@ -402,7 +406,8 @@
#endif
}
- closeGame(); // close engine systems down
+ // Stop music instantly!
+ killMusic();
}
void Sword2Engine::startGame(void) {
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm script.cpp,1.141,1.142
- Next message: [Scummvm-cvs-logs] CVS: scummvm/queen journal.cpp,1.17,1.18 logic.cpp,1.158,1.159 logic.h,1.101,1.102 queen.cpp,1.68,1.69 queen.h,1.24,1.25
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list