summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2008-04-19 16:41:58 +0000
committerSimon Howard2008-04-19 16:41:58 +0000
commitc83f0c2d0885479ac03edc5b0759db19f6794163 (patch)
treeaf84de9685bc5b4d7a63d4a6aa401b6d4e5c4b03 /src
parent3fd3abaf9084d89388d0a2fa021db4e72b2e78e0 (diff)
downloadchocolate-doom-c83f0c2d0885479ac03edc5b0759db19f6794163.tar.gz
chocolate-doom-c83f0c2d0885479ac03edc5b0759db19f6794163.tar.bz2
chocolate-doom-c83f0c2d0885479ac03edc5b0759db19f6794163.zip
Fix build problem when libsamplerate support is enabled.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1124
Diffstat (limited to 'src')
-rw-r--r--src/i_sdlsound.c74
1 files changed, 39 insertions, 35 deletions
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index 6f756987..429581e2 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -216,41 +216,6 @@ static uint32_t ExpandSoundData_SRC(byte *data,
return clipped;
}
-// Preload all the sound effects - stops nasty ingame freezes
-
-static void I_PrecacheSounds(void)
-{
- char namebuf[9];
- int i;
-
- printf("I_PrecacheSounds: Precaching all sound effects..");
-
- for (i=sfx_pistol; i<NUMSFX; ++i)
- {
- if ((i % 6) == 0)
- {
- printf(".");
- fflush(stdout);
- }
-
- sprintf(namebuf, "ds%s", DEH_String(S_sfx[i].name));
-
- S_sfx[i].lumpnum = W_CheckNumForName(namebuf);
-
- if (S_sfx[i].lumpnum != -1)
- {
- CacheSFX(i);
-
- if (sound_chunks[i].abuf != NULL)
- {
- Z_ChangeTag(sound_chunks[i].abuf, PU_CACHE);
- }
- }
- }
-
- printf("\n");
-}
-
#endif
static boolean ConvertibleRatio(int freq1, int freq2)
@@ -450,6 +415,45 @@ static boolean CacheSFX(int sound)
return true;
}
+#ifdef HAVE_LIBSAMPLERATE
+
+// Preload all the sound effects - stops nasty ingame freezes
+
+static void I_PrecacheSounds(void)
+{
+ char namebuf[9];
+ int i;
+
+ printf("I_PrecacheSounds: Precaching all sound effects..");
+
+ for (i=sfx_pistol; i<NUMSFX; ++i)
+ {
+ if ((i % 6) == 0)
+ {
+ printf(".");
+ fflush(stdout);
+ }
+
+ sprintf(namebuf, "ds%s", DEH_String(S_sfx[i].name));
+
+ S_sfx[i].lumpnum = W_CheckNumForName(namebuf);
+
+ if (S_sfx[i].lumpnum != -1)
+ {
+ CacheSFX(i);
+
+ if (sound_chunks[i].abuf != NULL)
+ {
+ Z_ChangeTag(sound_chunks[i].abuf, PU_CACHE);
+ }
+ }
+ }
+
+ printf("\n");
+}
+
+#endif
+
static Mix_Chunk *GetSFXChunk(int sound_id)
{
if (sound_chunks[sound_id].abuf == NULL)