]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_wav.c
make precache_sound return the sound index (for using WriteStuff to send a sound...
[xonotic/darkplaces.git] / snd_wav.c
index c40986e2dcc87b4b0c45e5adc1e3a1e3c1ec31a6..7ce6b2744d3b164ecfd0e0a7a038a1d17f5bd32c 100644 (file)
--- a/snd_wav.c
+++ b/snd_wav.c
@@ -223,10 +223,10 @@ static wavinfo_t GetWavinfo (char *name, unsigned char *wav, int wavlength)
 WAV_FetchSound
 ====================
 */
-static const snd_buffer_t* WAV_FetchSound (channel_t* ch, unsigned int *start, unsigned int nbsampleframes)
+static const snd_buffer_t* WAV_FetchSound (void *sfxfetcher, void **chfetcherpointer, unsigned int *start, unsigned int nbsampleframes)
 {
        *start = 0;
-       return (snd_buffer_t *)ch->sfx->fetcher_data;
+       return (snd_buffer_t *)sfxfetcher;
 }
 
 /*
@@ -234,16 +234,11 @@ static const snd_buffer_t* WAV_FetchSound (channel_t* ch, unsigned int *start, u
 WAV_FreeSfx
 ====================
 */
-static void WAV_FreeSfx (sfx_t* sfx)
+static void WAV_FreeSfx (void *sfxfetcherdata)
 {
-       snd_buffer_t* sb = (snd_buffer_t *)sfx->fetcher_data;
-
+       snd_buffer_t* sb = (snd_buffer_t *)sfxfetcherdata;
        // Free the sound buffer
-       sfx->memsize -= (sb->maxframes * sb->format.channels * sb->format.width) + sizeof (*sb) - sizeof (sb->samples);
        Mem_Free(sb);
-
-       sfx->fetcher_data = NULL;
-       sfx->fetcher = NULL;
 }
 
 /*