]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_wav.c
fixed signed/unsigned mismatch warnings
[xonotic/darkplaces.git] / snd_wav.c
index 3904df5022af1ad52edd48f54d9ea7cfed07afa1..439ec73cbaf4cab9dd281e75976cdb516785c966 100644 (file)
--- a/snd_wav.c
+++ b/snd_wav.c
@@ -204,7 +204,10 @@ static wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
        if (info.samples)
        {
                if (samples < info.samples)
-                       Host_Error ("Sound %s has a bad loop length", name);
+               {
+                       Con_Printf ("Sound %s has a bad loop length", name);
+                       info.samples = samples;
+               }
        }
        else
                info.samples = samples;
@@ -261,7 +264,7 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s)
 
        Con_DPrintf ("Loading WAV file \"%s\"\n", filename);
 
-       info = GetWavinfo (s->name, data, fs_filesize);
+       info = GetWavinfo (s->name, data, (int)fs_filesize);
        // Stereo sounds are allowed (intended for music)
        if (info.channels < 1 || info.channels > 2)
        {
@@ -269,6 +272,8 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s)
                Mem_FreePool (&s->mempool);
                return false;
        }
+       //if (info.channels == 2)
+       //      Log_Printf("stereosounds.log", "%s\n", s->name);
 
        // calculate resampled length
        len = (int) ((double) info.samples * (double) shm->format.speed / (double) info.rate);
@@ -308,7 +313,7 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s)
        }
 #endif
 
-       sb->length = ResampleSfx (data + info.dataofs, info.samples, &s->format, sb->data, s->name);
+       sb->length = (int)ResampleSfx (data + info.dataofs, info.samples, &s->format, sb->data, s->name);
        s->format.speed = shm->format.speed;
        s->total_length = sb->length;
        sb->offset = 0;