]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameInitDispose.cpp
Switch to using «The Lean Mean C++ Option Parser»
[lugaru.git] / Source / GameInitDispose.cpp
index 05c7e196fbdfd38d549e7231a98d97394d8bf46b..935b69d0541af59df7623f0606b74620a451f611 100644 (file)
@@ -467,9 +467,6 @@ void FadeLoadingScreen(float howmuch)
     swap_gl_buffers();
 }
 
-
-extern bool cmdline(const char *cmd);
-
 void Game::InitGame()
 {
     LOGFUNC;
@@ -583,15 +580,14 @@ void Game::InitGame()
 #if PLATFORM_LINUX
     unsigned char rc = 0;
     int output = OPENAL_OUTPUT_ALSA;  // Try alsa first...
-    if (cmdline("forceoss"))      //  ...but let user override that.
-        output = OPENAL_OUTPUT_OSS;
-    else if (cmdline("nosound"))
-        output = OPENAL_OUTPUT_NOSOUND;
+    if (commandLineOptions[SOUND]) {
+        output = commandLineOptions[SOUND].last()->type(); //  ...but let user override that.
+    }
 
     OPENAL_SetOutput(output);
     if ((rc = OPENAL_Init(44100, 32, 0)) == false) {
         // if we tried ALSA and failed, fall back to OSS.
-        if ( (output == OPENAL_OUTPUT_ALSA) && (!cmdline("forcealsa")) ) {
+        if ( (output == OPENAL_OUTPUT_ALSA) && (commandLineOptions[SOUND].last()->type() != OPENAL_OUTPUT_ALSA) ) {
             OPENAL_Close();
             output = OPENAL_OUTPUT_OSS;
             OPENAL_SetOutput(output);