cleaner sfx handling in dynamic sounds

This commit is contained in:
Bill Currie 2007-03-18 13:29:58 +00:00 committed by Jeff Teunissen
parent d9b7ccd5e3
commit 0f1cd876b2
2 changed files with 4 additions and 6 deletions

View file

@ -564,13 +564,8 @@ SND_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin,
return; // not audible at all
// new channel
if (!sfx->retain (sfx))
return; // couldn't load the sound's data
if (!(osfx = sfx->open (sfx))) {
sfx->release (sfx);
if (!(osfx = sfx->open (sfx)))
return;
}
target_chan->pos = 0.0;
target_chan->end = snd_paintedtime + osfx->length;
@ -589,6 +584,8 @@ SND_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin,
break;
}
}
if (!osfx->retain (osfx))
return; // couldn't load the sound's data
target_chan->sfx = osfx;
}

View file

@ -285,6 +285,7 @@ s_update (const vec3_t origin, const vec3_t forward, const vec3_t right,
// mix some sound
s_update_ ();
SND_ScanChannels ();
}
static void