diff options
author | Andre Heider | 2009-02-26 19:28:21 +0000 |
---|---|---|
committer | Andre Heider | 2009-02-26 19:28:21 +0000 |
commit | 84daa0410f27571915d5b718f90e6d44e97b8f81 (patch) | |
tree | 5f32ad0e38f8efe503048f3ee4b5b3897a9a3814 /engines | |
parent | 73f1e8c85f9e3ab4769f42ec2e93900b00523bb9 (diff) | |
download | scummvm-rg350-84daa0410f27571915d5b718f90e6d44e97b8f81.tar.gz scummvm-rg350-84daa0410f27571915d5b718f90e6d44e97b8f81.tar.bz2 scummvm-rg350-84daa0410f27571915d5b718f90e6d44e97b8f81.zip |
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.
svn-id: r38912
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/game.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index e2ca19b51f..250610dfb7 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -799,17 +799,21 @@ int game_init(EngineState *s) { 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); - } - sfx_exit(&s->sound); - // Reinit because some other code depends on having a valid state - game_init_sound(s, SFX_STATE_FLAG_NOSOUND); + 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); + } delete s->seg_manager; |