]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
Merge branch 'master' into Cloudwalk/Host_Init-overhaul
[xonotic/darkplaces.git] / snd_main.c
index 3e8d52a86ccd8dcb3c44123b32cbc6b54a0918d6..d9a70325bf1e40bc0bd9117df73683eec3cb1d77 100644 (file)
@@ -702,6 +702,31 @@ S_Init
 ================
 */
 void S_Init(void)
+{
+// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
+       if (Sys_CheckParm("-nosound"))
+               return;
+
+       snd_mempool = Mem_AllocPool("sound", 0, NULL);
+
+// COMMANDLINEOPTION: Sound: -simsound runs sound mixing but with no output
+       if (Sys_CheckParm("-simsound"))
+               simsound = true;
+
+       Cvar_SetValueQuick(&snd_initialized, true);
+
+       known_sfx = NULL;
+
+       total_channels = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS;   // no statics
+       memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
+
+       OGG_OpenLibrary ();
+#ifdef USEXMP
+       XMP_OpenLibrary ();
+#endif
+}
+
+void S_Init_Commands(void)
 {
        Cvar_RegisterVariable(&volume);
        Cvar_RegisterVariable(&bgmvolume);
@@ -773,8 +798,6 @@ void S_Init(void)
 
        Cvar_RegisterVariable(&snd_identicalsoundrandomization_time);
        Cvar_RegisterVariable(&snd_identicalsoundrandomization_tics);
-
-// COMMANDLINEOPTION: Sound: -nosound disables sound (including CD audio)
        if (Sys_CheckParm("-nosound"))
        {
                // dummy out Play and Play2 because mods stuffcmd that
@@ -783,12 +806,6 @@ void S_Init(void)
                return;
        }
 
-       snd_mempool = Mem_AllocPool("sound", 0, NULL);
-
-// COMMANDLINEOPTION: Sound: -simsound runs sound mixing but with no output
-       if (Sys_CheckParm("-simsound"))
-               simsound = true;
-
        Cmd_AddCommand(CF_CLIENT, "play", S_Play_f, "play a sound at your current location (not heard by anyone else)");
        Cmd_AddCommand(CF_CLIENT, "play2", S_Play2_f, "play a sound globally throughout the level (not heard by anyone else)");
        Cmd_AddCommand(CF_CLIENT, "playvol", S_PlayVol_f, "play a sound at the specified volume level at your current location (not heard by anyone else)");
@@ -812,21 +829,8 @@ void S_Init(void)
        Cvar_RegisterVariable(&snd_swapstereo); // for people with backwards sound wiring
        Cvar_RegisterVariable(&snd_channellayout);
        Cvar_RegisterVariable(&snd_soundradius);
-
-       Cvar_SetValueQuick(&snd_initialized, true);
-
-       known_sfx = NULL;
-
-       total_channels = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS;   // no statics
-       memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
-
-       OGG_OpenLibrary ();
-#ifdef USEXMP
-       XMP_OpenLibrary ();
-#endif
 }
 
-
 /*
 ================
 S_Terminate