]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
Add darkplaces.rc to the vcxproj files for sdl, sdl2 and dedicated targets.
[xonotic/darkplaces.git] / snd_main.c
index 6bda6fd0d519eeaa47374c2b853ac1141cd4064f..d54267bdb6d44b7a57b346ea8ed45cba1c2dbd2a 100644 (file)
@@ -25,7 +25,9 @@ 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
@@ -325,7 +327,7 @@ static void S_SoundList_f (void)
                {
                        unsigned int size;
 
-                       size = sfx->memsize;
+                       size = (unsigned int)sfx->memsize;
                        Con_Printf ("%c%c%c(%5iHz %2db %6s) %8i : %s\n",
                                                (sfx->loopstart < sfx->total_length) ? 'L' : ' ',
                                                (sfx->flags & SFXFLAG_STREAMED) ? 'S' : ' ',
@@ -1491,7 +1493,7 @@ static void SND_Spatialize_WithSfx(channel_t *ch, qboolean isstatic, sfx_t *sfx)
                        if (snd_spatialization_occlusion.integer)
                        {
                                if(snd_spatialization_occlusion.integer & 1)
-                                       if(listener_pvs)
+                                       if(listener_pvs && cl.worldmodel)
                                        {
                                                int cluster = cl.worldmodel->brush.PointInLeaf(cl.worldmodel, ch->origin)->clusterindex;
                                                if(cluster >= 0 && cluster < 8 * listener_pvsbytes && !CHECKPVSBIT(listener_pvs, cluster))
@@ -1818,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 ())
        {