[Scummvm-cvs-logs] SF.net SVN: scummvm:[38912] scummvm/trunk/engines/sci/engine/game.cpp

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Thu Feb 26 20:28:22 CET 2009


Revision: 38912
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38912&view=rev
Author:   dhewg
Date:     2009-02-26 19:28:21 +0000 (Thu, 26 Feb 2009)

Log Message:
-----------
reinit sfx in game_init() when it got deinitialized in game_exit(), this unmutes the game after a restart.
shutdown sfx in game_exit() only if there is no EngineState successor (restored game) since gamestate_restore() already reinitialized it.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/game.cpp

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2009-02-26 18:59:41 UTC (rev 38911)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2009-02-26 19:28:21 UTC (rev 38912)
@@ -799,18 +799,22 @@
 
 	s->menubar = menubar_new(); // Create menu bar
 
+	if (s->sfx_init_flags & SFX_STATE_FLAG_NOSOUND)
+		game_init_sound(s, 0);
+
 	return 0;
 }
 
 int game_exit(EngineState *s) {
-	if (s->execution_stack) {
+	if (s->execution_stack)
 		free(s->execution_stack);
+
+	if (!s->successor) {
+		sfx_exit(&s->sound);
+		// Reinit because some other code depends on having a valid state
+		game_init_sound(s, SFX_STATE_FLAG_NOSOUND);
 	}
 
-	sfx_exit(&s->sound);
-	// Reinit because some other code depends on having a valid state
-	game_init_sound(s, SFX_STATE_FLAG_NOSOUND);
-
 	delete s->seg_manager;
 
 	if (s->synonyms_nr) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list