X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=snd_main.c;h=62807eb0983a79cb7529913aea7aaf29b46b5599;hb=85a33377d64ae8438e6582a7b8472f5a4bd41942;hp=ceb230defb46e4f8c0e486f163e4799fec20b001;hpb=97b79884ee55276e90c4dd60f9bfde8b9dbbff68;p=xonotic%2Fdarkplaces.git diff --git a/snd_main.c b/snd_main.c index ceb230de..62807eb0 100644 --- a/snd_main.c +++ b/snd_main.c @@ -23,7 +23,6 @@ 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 @@ -52,24 +51,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}, @@ -80,10 +79,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}, @@ -95,8 +94,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}, @@ -328,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' : ' ', @@ -917,7 +916,6 @@ void S_Init(void) memset(channels, 0, MAX_CHANNELS * sizeof(channel_t)); OGG_OpenLibrary (); - ModPlug_OpenLibrary (); } @@ -931,7 +929,6 @@ Shutdown and free all resources void S_Terminate (void) { S_Shutdown (); - ModPlug_CloseLibrary (); OGG_CloseLibrary (); // Free all SFXs @@ -1496,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)) @@ -1505,7 +1502,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)