]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
cl_movement: move crouch handling so that sv_maxairspeed*0.5 is maximum crouching...
[xonotic/darkplaces.git] / snd_main.c
index 8075c6c1e42a3f1d6d3f6d9378040582dcf800a7..e4a4934a2993458f8044e4bbd6e51e2fa3e00de8 100644 (file)
@@ -1598,6 +1598,22 @@ void S_SetChannelVolume (unsigned int ch_ind, float fvol)
        channels[ch_ind].master_vol = (int)(fvol * 255.0f);
 }
 
+float S_GetChannelPosition (unsigned int ch_ind)
+{
+       // note: this is NOT accurate yet
+       int s;
+       channel_t *ch = &channels[ch_ind];
+       sfx_t *sfx = ch->sfx;
+
+       s = ch->pos;
+       /*
+       if(!snd_usethreadedmixing)
+               s += _snd_mixahead.value * S_GetSoundRate();
+       */
+       return (s % sfx->total_length) / (float) S_GetSoundRate();
+}
+
+
 
 /*
 =================