]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
Fix engine not starting on Windows if linked against SDL > 2.0.5
[xonotic/darkplaces.git] / snd_main.c
index d54267bdb6d44b7a57b346ea8ed45cba1c2dbd2a..53e63d5202eb4344b138c639231a32385fdb7f92 100644 (file)
@@ -25,9 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "snd_ogg.h"
 #include "csprogs.h"
 #include "cl_collision.h"
-#ifdef CONFIG_CD
 #include "cdaudio.h"
-#endif
 
 
 #define SND_MIN_SPEED 8000
@@ -51,24 +49,24 @@ static const speakerlayout_t snd_speakerlayouts[] =
        {
                "surround71", 8,
                {
-                       {0, 45, 0.2, 0.2, 0.5}, // front left
-                       {1, 315, 0.2, 0.2, 0.5}, // front right
-                       {2, 135, 0.2, 0.2, 0.5}, // rear left
-                       {3, 225, 0.2, 0.2, 0.5}, // rear right
-                       {4, 0, 0.2, 0.2, 0.5}, // front center
+                       {0, 45, 0.2f, 0.2f, 0.5f}, // front left
+                       {1, 315, 0.2f, 0.2f, 0.5f}, // front right
+                       {2, 135, 0.2f, 0.2f, 0.5f}, // rear left
+                       {3, 225, 0.2f, 0.2f, 0.5f}, // rear right
+                       {4, 0, 0.2f, 0.2f, 0.5f}, // front center
                        {5, 0, 0, 0, 0}, // lfe (we don't have any good lfe sound sources and it would take some filtering work to generate them (and they'd probably still be wrong), so...  no lfe)
-                       {6, 90, 0.2, 0.2, 0.5}, // side left
-                       {7, 180, 0.2, 0.2, 0.5}, // side right
+                       {6, 90, 0.2f, 0.2f, 0.5f}, // side left
+                       {7, 180, 0.2f, 0.2f, 0.5f}, // side right
                }
        },
        {
                "surround51", 6,
                {
-                       {0, 45, 0.2, 0.2, 0.5}, // front left
-                       {1, 315, 0.2, 0.2, 0.5}, // front right
-                       {2, 135, 0.2, 0.2, 0.5}, // rear left
-                       {3, 225, 0.2, 0.2, 0.5}, // rear right
-                       {4, 0, 0.2, 0.2, 0.5}, // front center
+                       {0, 45, 0.2f, 0.2f, 0.5f}, // front left
+                       {1, 315, 0.2f, 0.2f, 0.5f}, // front right
+                       {2, 135, 0.2f, 0.2f, 0.5f}, // rear left
+                       {3, 225, 0.2f, 0.2f, 0.5f}, // rear right
+                       {4, 0, 0.2f, 0.2f, 0.5f}, // front center
                        {5, 0, 0, 0, 0}, // lfe (we don't have any good lfe sound sources and it would take some filtering work to generate them (and they'd probably still be wrong), so...  no lfe)
                        {0, 0, 0, 0, 0},
                        {0, 0, 0, 0, 0},
@@ -79,10 +77,10 @@ static const speakerlayout_t snd_speakerlayouts[] =
                // channel of its own
                "surround40", 4,
                {
-                       {0, 45, 0.3, 0.3, 0.8}, // front left
-                       {1, 315, 0.3, 0.3, 0.8}, // front right
-                       {2, 135, 0.3, 0.3, 0.8}, // rear left
-                       {3, 225, 0.3, 0.3, 0.8}, // rear right
+                       {0, 45, 0.3f, 0.3f, 0.8f}, // front left
+                       {1, 315, 0.3f, 0.3f, 0.8f}, // front right
+                       {2, 135, 0.3f, 0.3f, 0.8f}, // rear left
+                       {3, 225, 0.3f, 0.3f, 0.8f}, // rear right
                        {0, 0, 0, 0, 0},
                        {0, 0, 0, 0, 0},
                        {0, 0, 0, 0, 0},
@@ -94,8 +92,8 @@ static const speakerlayout_t snd_speakerlayouts[] =
                // channel of its own
                "stereo", 2,
                {
-                       {0, 90, 0.5, 0.5, 1}, // side left
-                       {1, 270, 0.5, 0.5, 1}, // side right
+                       {0, 90, 0.5f, 0.5f, 1}, // side left
+                       {1, 270, 0.5f, 0.5f, 1}, // side right
                        {0, 0, 0, 0, 0},
                        {0, 0, 0, 0, 0},
                        {0, 0, 0, 0, 0},
@@ -1502,7 +1500,7 @@ static void SND_Spatialize_WithSfx(channel_t *ch, qboolean isstatic, sfx_t *sfx)
 
                                if(snd_spatialization_occlusion.integer & 2)
                                        if(!occluded)
-                                               if(cl.worldmodel && cl.worldmodel->brush.TraceLineOfSight && !cl.worldmodel->brush.TraceLineOfSight(cl.worldmodel, listener_origin, ch->origin))
+                                               if(cl.worldmodel && cl.worldmodel->brush.TraceLineOfSight && !cl.worldmodel->brush.TraceLineOfSight(cl.worldmodel, listener_origin, ch->origin, ch->origin, ch->origin))
                                                        occluded = true;
                        }
                        if(occluded)
@@ -1820,10 +1818,8 @@ 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 ())
        {