Last active
December 20, 2015 07:59
-
-
Save PilzAdam/6096947 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/main.cpp b/src/main.cpp | |
index 8ed164d..4a6d83e 100644 | |
--- a/src/main.cpp | |
+++ b/src/main.cpp | |
@@ -1535,6 +1535,18 @@ int main(int argc, char *argv[]) | |
std::string current_address = "does-not-exist"; | |
int current_port = 0; | |
+ MenuMusicFetcher soundfetcher; | |
+ ISoundManager *sound = NULL; | |
+#if USE_SOUND | |
+ sound = createOpenALSoundManager(&soundfetcher); | |
+#endif | |
+ if(!sound) | |
+ sound = &dummySoundManager; | |
+ SimpleSoundSpec spec; | |
+ spec.name = "main_menu"; | |
+ spec.gain = 1; | |
+ s32 handle = sound->playSound(spec, true); | |
+ | |
/* | |
Out-of-game menu loop. | |
@@ -1711,7 +1723,13 @@ int main(int argc, char *argv[]) | |
// Continue to game | |
break; | |
} | |
- | |
+ | |
+ sound->stopSound(handle); | |
+ if(sound != &dummySoundManager){ | |
+ delete sound; | |
+ sound = NULL; | |
+ } | |
+ | |
// Break out of menu-game loop to shut down cleanly | |
if(device->run() == false || kill == true) { | |
g_settings->updateConfigFile(configpath.c_str()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment