]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_wav.c
changed a lot of Host_Error calls to Con_Printf or Sys_Error according to severity
[xonotic/darkplaces.git] / snd_wav.c
index a9440735893744c4e95f993c6ffecddceed91f67..041a25524cd6ded477c4611eb71fd5ccfa0f856b 100644 (file)
--- a/snd_wav.c
+++ b/snd_wav.c
@@ -23,6 +23,7 @@
 
 
 #include "quakedef.h"
 
 
 #include "quakedef.h"
+#include "snd_main.h"
 #include "snd_wav.h"
 
 
 #include "snd_wav.h"
 
 
@@ -203,7 +204,10 @@ static wavinfo_t GetWavinfo (char *name, qbyte *wav, int wavlength)
        if (info.samples)
        {
                if (samples < info.samples)
        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;
        }
        else
                info.samples = samples;
@@ -241,7 +245,7 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s)
        sfxbuffer_t* sb;
 
        Mem_FreePool (&s->mempool);
        sfxbuffer_t* sb;
 
        Mem_FreePool (&s->mempool);
-       s->mempool = Mem_AllocPool(s->name);
+       s->mempool = Mem_AllocPool(s->name, 0, NULL);
 
        // Load the file
        data = FS_LoadFile(filename, s->mempool, false);
 
        // Load the file
        data = FS_LoadFile(filename, s->mempool, false);
@@ -268,6 +272,8 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s)
                Mem_FreePool (&s->mempool);
                return false;
        }
                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);
 
        // calculate resampled length
        len = (int) ((double) info.samples * (double) shm->format.speed / (double) info.rate);