X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=snd_wav.c;h=b6cfe26cc83d683cf42ac55b20294c00bf76bacd;hp=a972ef41ff295375d3b94a7f6be5599f8d2f5dbf;hb=582c8871d441ba4659a646462143d917712d5c4b;hpb=aa33d8f8642530f7f266d6cde1422f95aa74b2be diff --git a/snd_wav.c b/snd_wav.c index a972ef41..b6cfe26c 100644 --- a/snd_wav.c +++ b/snd_wav.c @@ -27,7 +27,7 @@ #include "snd_wav.h" -typedef struct +typedef struct wavinfo_s { int rate; int width; @@ -38,10 +38,10 @@ typedef struct } 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; @@ -122,7 +122,7 @@ static void DumpChunks(void) 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; @@ -205,7 +205,7 @@ static wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength) { 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; } } @@ -255,7 +255,8 @@ S_LoadWavFile */ 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; @@ -266,7 +267,7 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s) return true; // Load the file - data = FS_LoadFile(filename, snd_mempool, false); + data = FS_LoadFile(filename, snd_mempool, false, &filesize); if (!data) return false; @@ -279,7 +280,7 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s) 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) {