]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_wav.c
cvar: r_texture_dds_load_dxt1_noalpha; if set, DXT1 alpha detection is disabled,...
[xonotic/darkplaces.git] / snd_wav.c
index 7ce6b2744d3b164ecfd0e0a7a038a1d17f5bd32c..438db2ba8a0a95a189b5ac66f23b883c0496b453 100644 (file)
--- a/snd_wav.c
+++ b/snd_wav.c
@@ -284,7 +284,8 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *sfx)
                return false;
        }
 
-       Con_DPrintf ("Loading WAV file \"%s\"\n", filename);
+       if (developer_loading.integer >= 2)
+               Con_Printf ("Loading WAV file \"%s\"\n", filename);
 
        info = GetWavinfo (sfx->name, data, (int)filesize);
        if (info.channels < 1 || info.channels > 2)  // Stereo sounds are allowed (intended for music)
@@ -296,10 +297,9 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *sfx)
        //if (info.channels == 2)
        //      Log_Printf("stereosounds.log", "%s\n", sfx->name);
 
-#if BYTE_ORDER != LITTLE_ENDIAN
        // We must convert the WAV data from little endian
        // to the machine endianess before resampling it
-       if (info.width == 2)
+       if (info.width == 2 && mem_bigendian)
        {
                unsigned int len, i;
                short* ptr;
@@ -309,7 +309,6 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *sfx)
                for (i = 0; i < len; i++)
                        ptr[i] = LittleShort (ptr[i]);
        }
-#endif
 
        wav_format.speed = info.rate;
        wav_format.width = info.width;
@@ -329,7 +328,7 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *sfx)
        if (info.loopstart < 0)
                sfx->loopstart = sfx->total_length;
        else
-               sfx->loopstart = (double)info.loopstart * (double)snd_renderbuffer->format.speed / (double)sb->format.speed;
+               sfx->loopstart = (unsigned int) ((double)info.loopstart * (double)sb->format.speed / (double)info.rate);
        sfx->loopstart = min(sfx->loopstart, sfx->total_length);
        sfx->flags &= ~SFXFLAG_STREAMED;