shithub: qk1

Download patch

ref: 35722088b80018e49c5b1707a1028eefb8a9dee9
parent: 6e674de088f8ce0b55bd4f51369b46f90d63abba
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Dec 27 14:23:39 EST 2023

openal: get rid of another variable

--- a/unix/snd_openal.c
+++ b/unix/snd_openal.c
@@ -238,10 +238,8 @@
 alplay(alchan_t *c, albuf_t *b, vec3_t zp, float vol, float att, bool rel, bool loop)
 {
 	ALint src;
-	float x;
 	int n;
 
-	x = att * 0.001f;
 	src = c->src;
 	if(rel){
 		alSourcefv(src, AL_POSITION, vec3_origin); ALERR();
@@ -251,7 +249,7 @@
 	}else{
 		alSourcefv(src, AL_POSITION, zp); ALERR();
 		alSourcei(src, AL_SOURCE_RELATIVE, AL_FALSE); ALERR();
-		alSourcef(src, AL_ROLLOFF_FACTOR, x * (8192.0f - 1.0f)); ALERR();
+		alSourcef(src, AL_ROLLOFF_FACTOR, att * 8.191); ALERR();
 		alSourcef(src, AL_REFERENCE_DISTANCE, 1.0f); ALERR();
 		alSourcef(src, AL_MAX_DISTANCE, 8192.0f); ALERR();
 	}