mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
cleaner sfx handling in dynamic sounds
This commit is contained in:
parent
d9b7ccd5e3
commit
0f1cd876b2
2 changed files with 4 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue