changeset 209:e63b9393f6ce

Added ModPlug support.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 10 Jan 2002 01:18:54 +0000
parents 32376317eedb
children 4861069841b9
files SDL_sound.c acconfig.h configure.in decoders/Makefile.am
diffstat 4 files changed, 30 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/SDL_sound.c	Thu Jan 10 01:16:24 2002 +0000
+++ b/SDL_sound.c	Thu Jan 10 01:18:54 2002 +0000
@@ -51,8 +51,12 @@
 extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_MP3;
 #endif
 
-#if (defined SOUND_SUPPORTS_MOD)
-extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_MOD;
+#if (defined SOUND_SUPPORTS_MIKMOD)
+extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_MIKMOD;
+#endif
+
+#if (defined SOUND_SUPPORTS_MODPLUG)
+extern const Sound_DecoderFunctions  __Sound_DecoderFunctions_MODPLUG;
 #endif
 
 #if (defined SOUND_SUPPORTS_WAV)
@@ -101,8 +105,12 @@
     { 0, &__Sound_DecoderFunctions_MP3 },
 #endif
 
-#if (defined SOUND_SUPPORTS_MOD)
-    { 0, &__Sound_DecoderFunctions_MOD },
+#if (defined SOUND_SUPPORTS_MIKMOD)
+    { 0, &__Sound_DecoderFunctions_MIKMOD },
+#endif
+
+#if (defined SOUND_SUPPORTS_MODPLUG)
+    { 0, &__Sound_DecoderFunctions_MODPLUG },
 #endif
 
 #if (defined SOUND_SUPPORTS_WAV)
--- a/acconfig.h	Thu Jan 10 01:16:24 2002 +0000
+++ b/acconfig.h	Thu Jan 10 01:18:54 2002 +0000
@@ -3,7 +3,8 @@
 #undef DEBUG_CHATTER
 #undef NDEBUG
 #undef SOUND_SUPPORTS_AIFF
-#undef SOUND_SUPPORTS_MOD
+#undef SOUND_SUPPORTS_MIKMOD
+#undef SOUND_SUPPORTS_MODPLUG
 #undef SOUND_SUPPORTS_MP3
 #undef SOUND_SUPPORTS_OGG
 #undef SOUND_SUPPORTS_RAW
--- a/configure.in	Thu Jan 10 01:16:24 2002 +0000
+++ b/configure.in	Thu Jan 10 01:18:54 2002 +0000
@@ -180,7 +180,20 @@
     CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS"
     LIBS="$LIBS $LIBMIKMOD_LIBS"
     LDADD="$LDADD $LIBMIKMOD_LDADD"
-    AC_DEFINE(SOUND_SUPPORTS_MOD)
+    AC_DEFINE(SOUND_SUPPORTS_MIKMOD)
+  fi
+fi
+
+dnl Check for libmodplug
+AC_ARG_ENABLE(modplug,
+[  --enable-modplug           enable MOD decoding via modplug [default=yes]],
+              , enable_modplug=yes)
+if test x$enable_modplug = xyes; then
+  AC_CHECK_HEADER(modplug.h, have_modplug_hdr=yes)
+  AC_CHECK_LIB(modplug, ModPlug_Load, have_modplug_lib=yes)
+  if test x$have_modplug_hdr = xyes -a x$have_modplug_lib = xyes; then
+    LIBS="$LIBS -lmodplug"
+    AC_DEFINE(SOUND_SUPPORTS_MODPLUG)
   fi
 fi
 
--- a/decoders/Makefile.am	Thu Jan 10 01:16:24 2002 +0000
+++ b/decoders/Makefile.am	Thu Jan 10 01:18:54 2002 +0000
@@ -6,7 +6,8 @@
 
 libdecoders_la_SOURCES =	\
 	aiff.c		\
-	mod.c		\
+	mikmod.c	\
+	modplug.c	\
 	mp3.c		\
 	ogg.c		\
 	raw.c		\