} wavinfo_t;
-static qbyte *data_p;
-static qbyte *iff_end;
-static qbyte *last_chunk;
-static qbyte *iff_data;
+static unsigned char *data_p;
+static unsigned char *iff_end;
+static unsigned char *last_chunk;
+static unsigned char *iff_data;
static int iff_chunk_len;
GetWavinfo
============
*/
-static wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
+static wavinfo_t GetWavinfo (char *name, unsigned char *wav, int wavlength)
{
wavinfo_t info;
int i;
{
if (samples < info.samples)
{
- Con_Printf ("Sound %s has a bad loop length", name);
+ Con_Printf ("Sound %s has a bad loop length\n", name);
info.samples = samples;
}
}
*/
qboolean S_LoadWavFile (const char *filename, sfx_t *s)
{
- qbyte *data;
+ fs_offset_t filesize;
+ unsigned char *data;
wavinfo_t info;
int len;
size_t memsize;
return true;
// Load the file
- data = FS_LoadFile(filename, snd_mempool, false);
+ data = FS_LoadFile(filename, snd_mempool, false, &filesize);
if (!data)
return false;
Con_DPrintf ("Loading WAV file \"%s\"\n", filename);
- info = GetWavinfo (s->name, data, (int)fs_filesize);
+ info = GetWavinfo (s->name, data, (int)filesize);
// Stereo sounds are allowed (intended for music)
if (info.channels < 1 || info.channels > 2)
{
if (info.loopstart < 0)
s->loopstart = -1;
else
- s->loopstart = (double)info.loopstart * (double)shm->format.speed / (double)s->format.speed;
+ s->loopstart = (int)((double)info.loopstart * (double)shm->format.speed / (double)s->format.speed);
s->flags &= ~SFXFLAG_STREAMED;
#if BYTE_ORDER != LITTLE_ENDIAN