]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
fix errors and warnings in MSVC when compiling as C++
[xonotic/darkplaces.git] / snd_main.c
index 83b05959d1a020a2348c32fce4dd02391f9cb5b7..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: