* A better fix to the "doppler" bug

This commit is contained in:
Tim Angus 2005-09-29 22:53:31 +00:00
parent 24d3c6b2a2
commit 52dcaa45fd
2 changed files with 4 additions and 3 deletions

View file

@ -780,9 +780,8 @@ void S_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocit
loopSounds[entityNum].dopplerScale = lenb/(lena*100); loopSounds[entityNum].dopplerScale = lenb/(lena*100);
if (loopSounds[entityNum].dopplerScale<=1.0) { if (loopSounds[entityNum].dopplerScale<=1.0) {
loopSounds[entityNum].doppler = qfalse; // don't bother doing the math loopSounds[entityNum].doppler = qfalse; // don't bother doing the math
} } else if (loopSounds[entityNum].dopplerScale>MAX_DOPPLER_SCALE) {
else if (loopSounds[entityNum].dopplerScale>(float)SND_CHUNK_SIZE) { loopSounds[entityNum].dopplerScale = MAX_DOPPLER_SCALE;
loopSounds[entityNum].dopplerScale = (float)SND_CHUNK_SIZE;
} }
} }

View file

@ -72,6 +72,8 @@ typedef struct {
#define START_SAMPLE_IMMEDIATE 0x7fffffff #define START_SAMPLE_IMMEDIATE 0x7fffffff
#define MAX_DOPPLER_SCALE 50.0f //arbitrary
typedef struct loopSound_s { typedef struct loopSound_s {
vec3_t origin; vec3_t origin;
vec3_t velocity; vec3_t velocity;