From c0cf058bf3c8d866dd2279b2ae418550803360cd Mon Sep 17 00:00:00 2001 From: molivier Date: Thu, 8 Apr 2004 12:59:34 +0000 Subject: [PATCH] "soundlist" now tells you if a sound is streamed and whether it is mono or stereo git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4089 d7cf8633-e32d-0410-b094-e92efae38249 --- snd_dma.c | 8 +++++++- snd_ogg.c | 2 ++ snd_wav.c | 1 + sound.h | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/snd_dma.c b/snd_dma.c index dd19c690..11fb8c32 100644 --- a/snd_dma.c +++ b/snd_dma.c @@ -1087,7 +1087,13 @@ void S_SoundList(void) { size = sfx->mempool->totalsize; total += size; - Con_Printf("%c(%2db) %7i : %s\n", sfx->loopstart >= 0 ? 'L' : ' ', sfx->format.width * 8, size, sfx->name); + Con_Printf ("%c%c(%2db, %6s) %8i : %s\n", + (sfx->loopstart >= 0) ? 'L' : ' ', + (sfx->flags & SFXFLAG_STREAMED) ? 'S' : ' ', + sfx->format.width * 8, + (sfx->format.channels == 2) ? "stereo" : "mono", + size, + sfx->name); } } Con_Printf("Total resident: %i\n", total); diff --git a/snd_ogg.c b/snd_ogg.c index 18c500f7..6c78a676 100644 --- a/snd_ogg.c +++ b/snd_ogg.c @@ -555,6 +555,7 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *s) s->format.width = 2; // We always work with 16 bits samples s->format.channels = vi->channels; s->loopstart = -1; + s->flags |= SFXFLAG_STREAMED; s->total_length = (size_t)len / (vi->channels * 2) * (float)(shm->format.speed / vi->rate); } else @@ -590,6 +591,7 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *s) s->format.width = 2; // We always work with 16 bits samples s->format.channels = vi->channels; s->loopstart = -1; + s->flags &= ~SFXFLAG_STREAMED; sb->length = ResampleSfx (buff, (size_t)done / (vi->channels * 2), &s->format, sb->data, s->name); s->format.speed = shm->format.speed; diff --git a/snd_wav.c b/snd_wav.c index e11c2456..a9440735 100644 --- a/snd_wav.c +++ b/snd_wav.c @@ -290,6 +290,7 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s) s->loopstart = -1; else s->loopstart = (double)info.loopstart * (double)shm->format.speed / (double)s->format.speed; + s->flags &= ~SFXFLAG_STREAMED; #if BYTE_ORDER != LITTLE_ENDIAN // We must convert the WAV data from little endian diff --git a/sound.h b/sound.h index b6a44bc1..4d463c2a 100644 --- a/sound.h +++ b/sound.h @@ -43,6 +43,7 @@ typedef struct #define SFXFLAG_NONE 0 #define SFXFLAG_SILENTLYMISSING (1 << 0) // if the sfx is missing and loaded with complain = false #define SFXFLAG_USED (1 << 1) +#define SFXFLAG_STREAMED (1 << 2) // informative only. You shouldn't need to know that typedef struct snd_fetcher_s snd_fetcher_t; typedef struct sfx_s -- 2.39.2