]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
Revert "Revert "Build in subdirs"", as the issues seem to be ironed out now.
[xonotic/darkplaces.git] / snd_main.c
index 7788a774a4138fb24e1cbbe8e8ae3d05b37b93fd..d79857f4298caf075b08f89a168c0e402564c9a9 100644 (file)
@@ -23,10 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "snd_main.h"
 #include "snd_ogg.h"
-#include "snd_modplug.h"
 #include "csprogs.h"
 #include "cl_collision.h"
+#ifdef CONFIG_CD
 #include "cdaudio.h"
+#endif
 
 
 #define SND_MIN_SPEED 8000
@@ -915,7 +916,6 @@ void S_Init(void)
        memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
 
        OGG_OpenLibrary ();
-       ModPlug_OpenLibrary ();
 }
 
 
@@ -929,7 +929,6 @@ Shutdown and free all resources
 void S_Terminate (void)
 {
        S_Shutdown ();
-       ModPlug_CloseLibrary ();
        OGG_CloseLibrary ();
 
        // Free all SFXs
@@ -1695,7 +1694,7 @@ int S_StartSound_StartPosition_Flags (int entnum, int entchannel, sfx_t *sfx, ve
                                S_SetChannelSpeed(ch_idx, fspeed);
                                for(i = 1; i > 0 && (i <= flags || i <= (int) channels[ch_idx].flags); i <<= 1)
                                        if((flags ^ channels[ch_idx].flags) & i)
-                                               S_SetChannelFlag(ch_idx, i, flags & i);
+                                               S_SetChannelFlag(ch_idx, i, (flags & i) != 0);
                                ch->distfade = attenuation / snd_soundradius.value;
                                SND_Spatialize(ch, false);
                                return ch_idx;
@@ -1821,8 +1820,10 @@ void S_StopAllSounds (void)
        if (snd_renderbuffer == NULL)
                return;
 
+#ifdef CONFIG_CD
        // stop CD audio because it may be using a faketrack
        CDAudio_Stop();
+#endif
 
        if (simsound || SndSys_LockRenderBuffer ())
        {