ambient sounds always loop now... hopefully.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@504 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
27aea7b7ba
commit
2f1329a1fe
2 changed files with 8 additions and 1 deletions
|
@ -847,6 +847,7 @@ void S_StartSoundCard(soundcardinfo_t *sc, int entnum, int entchannel, sfx_t *sf
|
|||
target_chan->sfx = sfx;
|
||||
target_chan->pos = startpos;
|
||||
target_chan->end = sc->paintedtime + scache->length;
|
||||
target_chan->looping = false;
|
||||
|
||||
// if an identical sound has also been started this frame, offset the pos
|
||||
// a bit to keep it from just making the first one louder
|
||||
|
@ -1046,7 +1047,8 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
|
|||
VectorCopy (origin, ss->origin);
|
||||
ss->master_vol = vol;
|
||||
ss->dist_mult = (attenuation/64) / sound_nominal_clip_dist;
|
||||
ss->end = scard->paintedtime + scache->length;
|
||||
ss->end = scard->paintedtime + scache->length;
|
||||
ss->looping = true;
|
||||
|
||||
SND_Spatialize (scard, ss);
|
||||
}
|
||||
|
|
|
@ -700,6 +700,11 @@ void S_PaintChannels(soundcardinfo_t *sc, int endtime)
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (ch->looping && scache->length)
|
||||
{
|
||||
ch->pos = 0;
|
||||
ch->end = ltime + scache->length - ch->pos;
|
||||
}
|
||||
else
|
||||
{ // channel just stopped
|
||||
s = ch->sfx;
|
||||
|
|
Loading…
Reference in a new issue