X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=snd_mem.c;h=519ef0e27924a3049b533a8c6ee33ed64208161e;hp=3991356c1be7f87f599cef2c98d45950b32fae4a;hb=00b6d96fd1220b1df82036c445389ae19a08709e;hpb=48669036b4be979d997c27227942ed9c430277d5 diff --git a/snd_mem.c b/snd_mem.c index 3991356c..519ef0e2 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -19,12 +19,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "quakedef.h" +#include "darkplaces.h" #include "snd_main.h" #include "snd_ogg.h" #include "snd_wav.h" +#ifdef USEXMP +#include "snd_xmp.h" +#endif +#include "sound.h" +void SCR_PushLoadingScreen (const char *, float); +void SCR_PopLoadingScreen (qbool); /* ==================== @@ -78,7 +84,7 @@ snd_ringbuffer_t *Snd_CreateRingBuffer (const snd_format_t* format, unsigned int S_LoadSound ============== */ -qboolean S_LoadSound (sfx_t *sfx, qboolean complain) +qbool S_LoadSound (sfx_t *sfx, qbool complain) { char namebuffer[MAX_QPATH + 16]; size_t len; @@ -102,7 +108,7 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (developer_loading.integer) Con_Printf("loading sound %s\n", sfx->name); - SCR_PushLoadingScreen(true, sfx->name, 1); + SCR_PushLoadingScreen(sfx->name, 1); // LadyHavoc: if the sound filename does not begin with sound/, try adding it if (strncasecmp(sfx->name, "sound/", 6)) @@ -120,6 +126,13 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (OGG_LoadVorbisFile (namebuffer, sfx)) goto loaded; } +#ifdef USEXMP + else if (len >= 1) + { + if (XMP_LoadModFile (namebuffer, sfx)) + goto loaded; + } +#endif } // LadyHavoc: then try without the added sound/ as wav and ogg @@ -139,11 +152,18 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (OGG_LoadVorbisFile (namebuffer, sfx)) goto loaded; } +#ifdef USEXMP + else if (len >= 1) + { + if (XMP_LoadModFile (namebuffer, sfx)) + goto loaded; + } +#endif // Can't load the sound! sfx->flags |= SFXFLAG_FILEMISSING; if (complain) - Con_DPrintf("failed to load sound \"%s\"\n", sfx->name); + Con_Printf(CON_ERROR "Failed to load sound \"%s\"\n", sfx->name); SCR_PopLoadingScreen(false); return false;