From: divverent Date: Thu, 13 Dec 2007 16:06:35 +0000 (+0000) Subject: support the upcoming -DSND_MODPLUG_STATIC flag X-Git-Tag: xonotic-v0.1.0preview~2698 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6e832abc3f8b89e7e9ede8f905fecf8c360bbbca;p=xonotic%2Fdarkplaces.git support the upcoming -DSND_MODPLUG_STATIC flag git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7792 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_modplug.c b/snd_modplug.c index 81f00b62..0612d00f 100644 --- a/snd_modplug.c +++ b/snd_modplug.c @@ -26,6 +26,19 @@ #include "snd_main.h" #include "snd_modplug.h" +#ifdef SND_MODPLUG_STATIC + +#include "libmodplug/modplug.h" +qboolean ModPlug_OpenLibrary (void) +{ + return true; // statically linked +} +void ModPlug_CloseLibrary (void) +{ +} +#define modplug_dll 1 + +#else // BEGIN SECTION FROM modplug.h /* @@ -165,6 +178,7 @@ void ModPlug_CloseLibrary (void) { Sys_UnloadLibrary (&modplug_dll); } +#endif /* @@ -213,7 +227,7 @@ static const snd_buffer_t* ModPlug_FetchSound (void *sfxfetcher, void **chfetche modplug_stream_perchannel_t* per_ch = (modplug_stream_perchannel_t *)*chfetcherpointer; modplug_stream_persfx_t* per_sfx = (modplug_stream_persfx_t *)sfxfetcher; snd_buffer_t* sb; - int newlength, done, ret, bigendian; + int newlength, done, ret; unsigned int real_start; unsigned int factor; @@ -327,11 +341,6 @@ static const snd_buffer_t* ModPlug_FetchSound (void *sfxfetcher, void **chfetche newlength = sizeof(resampling_buffer); // Decompress in the resampling_buffer -#if BYTE_ORDER == BIG_ENDIAN - bigendian = 1; -#else - bigendian = 0; -#endif done = 0; while ((ret = ModPlug_Read (per_ch->mf, (char *)&resampling_buffer[done], (int)(newlength - done))) > 0) done += ret;