shithub: choc

Download patch

ref: 31f27c7a41f2aa2aac87052f85882a0eafbb1425
parent: e80278a9a67638739e2337f8cf3eb0334c61c4eb
author: Jonathan Dowland <jon+github@alcopop.org>
date: Mon Jun 29 13:38:40 EDT 2015

fix CacheSFX/WriteWAV debug procedure

Some debug code in CacheSFX is #ifdef'd out by default and hadn't
been updated to reflect more recent refactorings in the sound code.

--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -696,11 +696,12 @@
 #ifdef DEBUG_DUMP_WAVS
     {
         char filename[16];
+        allocated_sound_t * snd;
 
         M_snprintf(filename, sizeof(filename), "%s.wav",
-                   DEH_String(S_sfx[sound].name));
-        WriteWAV(filename, sound_chunks[sound].abuf,
-                 sound_chunks[sound].alen, mixer_freq);
+                   DEH_String(sfxinfo->name));
+        snd = GetAllocatedSoundBySfxInfoAndPitch(sfxinfo, NORM_PITCH);
+        WriteWAV(filename, snd->chunk.abuf, snd->chunk.alen,mixer_freq);
     }
 #endif