don't compile any vorbis code if it's unavailable

This commit is contained in:
Bill Currie 2003-04-11 14:38:31 +00:00
parent f287e78030
commit 725f1d0595
2 changed files with 4 additions and 18 deletions

View file

@ -113,11 +113,13 @@ SND_Load (sfx_t *sfx)
}
Qread (file, buf, 4);
Qseek (file, 0, SEEK_SET);
#ifdef HAVE_VORBIS
if (strnequal ("OggS", buf, 4)) {
Sys_DPrintf ("SND_Load: ogg file\n");
SND_LoadOgg (file, sfx, realname);
return;
}
#endif
if (strnequal ("RIFF", buf, 4)) {
Sys_DPrintf ("SND_Load: wav file\n");
SND_LoadWav (file, sfx, realname);

View file

@ -34,6 +34,8 @@
static __attribute__ ((unused)) const char rcsid[] =
"$Id$";
#ifdef HAVE_VORBIS
#ifdef HAVE_STRING_H
# include "string.h"
#endif
@ -41,8 +43,6 @@ static __attribute__ ((unused)) const char rcsid[] =
# include "strings.h"
#endif
#ifdef HAVE_VORBIS
#include <stdlib.h>
#include <vorbis/vorbisfile.h>
@ -279,20 +279,4 @@ SND_LoadOgg (QFile *file, sfx_t *sfx, char *realname)
}
}
#else//HAVE_VORBIS
#include "QF/sound.h"
#include "QF/sys.h"
#include "QF/quakeio.h"
#include "snd_render.h"
void
SND_LoadOgg (QFile *file, sfx_t *sfx, char *realname)
{
Sys_Printf ("Ogg/Vorbis support not available, sorry.\n");
Qclose (file);
free (realname);
return;
}
#endif//HAVE_VORBIS