]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
equalization: reduce min ambient, it was too high
[xonotic/darkplaces.git] / snd_main.c
index 236bb5e0ae80994d88dd7523c3c4d7328adea07d..540a7f9e7c8f140e0978eedc5aaf277b68f0c902 100644 (file)
@@ -150,7 +150,7 @@ static int current_swapstereo = false;
 static int current_channellayout = SND_CHANNELLAYOUT_AUTO;
 static int current_channellayout_used = SND_CHANNELLAYOUT_AUTO;
 
-static double spatialpower, spatialmin, spatialdiff, spatialoffset, spatialfactor;
+static float spatialpower, spatialmin, spatialdiff, spatialoffset, spatialfactor;
 typedef enum { SPATIAL_NONE, SPATIAL_LOG, SPATIAL_POW, SPATIAL_THRESH } spatialmethod_t;
 spatialmethod_t spatialmethod;
 
@@ -1359,7 +1359,8 @@ void SND_Spatialize(channel_t *ch, qboolean isstatic)
                                                VectorScale(source_vec, f, source_vec);
                                                break;
                                        case SPATIAL_POW:
-                                               f = spatialmin + spatialdiff * bound(0, (pow(dist, spatialpower) - spatialoffset) * spatialfactor, 1);
+                                               f = (pow(dist, spatialpower) - spatialoffset) * spatialfactor;
+                                               f = spatialmin + spatialdiff * bound(0, f, 1);
                                                VectorScale(source_vec, f, source_vec);
                                                break;
                                        case SPATIAL_THRESH:
@@ -1377,7 +1378,7 @@ void SND_Spatialize(channel_t *ch, qboolean isstatic)
                                {
                                        if (cl.worldmodel
                                        && cl.worldmodel->brush.TraceLineOfSight
-                                       && !cl.worldmodel->brush.TraceLineOfSight(cl.worldmodel, listener_origin, source_vec))
+                                       && !cl.worldmodel->brush.TraceLineOfSight(cl.worldmodel, listener_origin, ch->origin))
                                        {
                                                vol *= 0.5f;
                                        }