]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
removed modplug support, the library is too insecure and barely used by
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 Jul 2013 19:01:50 +0000 (19:01 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 Jul 2013 19:01:50 +0000 (19:01 +0000)
anyone

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11982 d7cf8633-e32d-0410-b094-e92efae38249

19 files changed:
BSDmakefile
DPiOS.xcodeproj/project.pbxproj
darkplaces-dedicated-vs2010.vcxproj
darkplaces-dedicated-vs2012.vcxproj
darkplaces-dedicated.vcproj
darkplaces-sdl-vs2010.vcxproj
darkplaces-sdl-vs2012.vcxproj
darkplaces-sdl.dsp
darkplaces-sdl.vcproj
darkplaces-wgl-vs2010.vcxproj
darkplaces-wgl-vs2012.vcxproj
darkplaces-wgl.vcproj
darkplaces.dsp
makefile
makefile.inc
snd_main.c
snd_mem.c
snd_modplug.c [deleted file]
snd_modplug.h [deleted file]

index 61189afef4c2ba38f724e3fdb09bf568ac4ad76f..ee3f74023831cd33fab8045fa957ac9d9c39fe7e 100644 (file)
@@ -90,13 +90,6 @@ CFLAGS_CRYPTO=
 LIB_CRYPTO_RIJNDAEL=
 CFLAGS_CRYPTO_RIJNDAEL=
 
-# modplug
-# now ogg is mostly used, modplug is required rarely, keep it dlopen by default
-# LIB_SND_MODPLUG=-lmodplug
-# CFLAGS_SND_MODPLUG=-DLINK_TO_LIBMODPLUG
-LIB_SND_MODPLUG=
-CFLAGS_SND_MODPLUG=
-
 .endif
 
 
index f55f5fa640fe8c9eeed9e8dd6024b2f3bb268f1b..a0488e90077decf2b295c6d4a155c27eeaa15adc 100755 (executable)
@@ -87,7 +87,6 @@
                7463B7BD12F9CE6B00983F6A /* snd_main.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B75212F9CE6B00983F6A /* snd_main.c */; };
                7463B7BE12F9CE6B00983F6A /* snd_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B75412F9CE6B00983F6A /* snd_mem.c */; };
                7463B7BF12F9CE6B00983F6A /* snd_mix.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B75512F9CE6B00983F6A /* snd_mix.c */; };
-               7463B7C012F9CE6B00983F6A /* snd_modplug.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B75612F9CE6B00983F6A /* snd_modplug.c */; };
                7463B7C112F9CE6B00983F6A /* snd_ogg.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B75812F9CE6B00983F6A /* snd_ogg.c */; };
                7463B7C212F9CE6B00983F6A /* snd_sdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B75A12F9CE6B00983F6A /* snd_sdl.c */; };
                7463B7C312F9CE6B00983F6A /* snd_wav.c in Sources */ = {isa = PBXBuildFile; fileRef = 7463B75B12F9CE6B00983F6A /* snd_wav.c */; };
                7463B75312F9CE6B00983F6A /* snd_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snd_main.h; sourceTree = "<group>"; };
                7463B75412F9CE6B00983F6A /* snd_mem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snd_mem.c; sourceTree = "<group>"; };
                7463B75512F9CE6B00983F6A /* snd_mix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snd_mix.c; sourceTree = "<group>"; };
-               7463B75612F9CE6B00983F6A /* snd_modplug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snd_modplug.c; sourceTree = "<group>"; };
-               7463B75712F9CE6B00983F6A /* snd_modplug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snd_modplug.h; sourceTree = "<group>"; };
                7463B75812F9CE6B00983F6A /* snd_ogg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snd_ogg.c; sourceTree = "<group>"; };
                7463B75912F9CE6B00983F6A /* snd_ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snd_ogg.h; sourceTree = "<group>"; };
                7463B75A12F9CE6B00983F6A /* snd_sdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snd_sdl.c; sourceTree = "<group>"; };
                                7463B75312F9CE6B00983F6A /* snd_main.h */,
                                7463B75412F9CE6B00983F6A /* snd_mem.c */,
                                7463B75512F9CE6B00983F6A /* snd_mix.c */,
-                               7463B75612F9CE6B00983F6A /* snd_modplug.c */,
-                               7463B75712F9CE6B00983F6A /* snd_modplug.h */,
                                7463B75812F9CE6B00983F6A /* snd_ogg.c */,
                                7463B75912F9CE6B00983F6A /* snd_ogg.h */,
                                7463B75A12F9CE6B00983F6A /* snd_sdl.c */,
                                7463B7BD12F9CE6B00983F6A /* snd_main.c in Sources */,
                                7463B7BE12F9CE6B00983F6A /* snd_mem.c in Sources */,
                                7463B7BF12F9CE6B00983F6A /* snd_mix.c in Sources */,
-                               7463B7C012F9CE6B00983F6A /* snd_modplug.c in Sources */,
                                7463B7C112F9CE6B00983F6A /* snd_ogg.c in Sources */,
                                7463B7C212F9CE6B00983F6A /* snd_sdl.c in Sources */,
                                7463B7C312F9CE6B00983F6A /* snd_wav.c in Sources */,
index f2b994cb91c19185d16e46f08c91869a31a58975..e757f4f80d1b94eab26be9c8806886cfb53c5992 100644 (file)
     <ClInclude Include="shader_glsl.h" />\r
     <ClInclude Include="shader_hlsl.h" />\r
     <ClInclude Include="snd_main.h" />\r
-    <ClInclude Include="snd_modplug.h" />\r
     <ClInclude Include="snd_ogg.h" />\r
     <ClInclude Include="snd_wav.h" />\r
     <ClInclude Include="sound.h" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index a8688b3d764f9487f95e433e2b6d2b875cb88525..e28e719ab39c338cf11d68a0a3314445b3eb096d 100644 (file)
     <ClInclude Include="shader_glsl.h" />\r
     <ClInclude Include="shader_hlsl.h" />\r
     <ClInclude Include="snd_main.h" />\r
-    <ClInclude Include="snd_modplug.h" />\r
     <ClInclude Include="snd_ogg.h" />\r
     <ClInclude Include="snd_wav.h" />\r
     <ClInclude Include="sound.h" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index b96bdd594a03f4a4456c684e61b22d8658da8e79..4d676f9687fe6861c4e3a95b7c953026aabf99b2 100755 (executable)
                                RelativePath=".\snd_main.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\snd_modplug.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath=".\snd_ogg.h"\r
                                >\r
index eb45b0100f18a36ec891208a4a85e111fdff56a3..adeebeb4ae388682108e6edd1361fbcd799cc315 100644 (file)
     <ClCompile Include="snd_main.c" />\r
     <ClCompile Include="snd_mem.c" />\r
     <ClCompile Include="snd_mix.c" />\r
-    <ClCompile Include="snd_modplug.c" />\r
     <ClCompile Include="snd_ogg.c" />\r
     <ClCompile Include="snd_sdl.c" />\r
     <ClCompile Include="snd_wav.c" />\r
     <ClInclude Include="shader_glsl.h" />\r
     <ClInclude Include="shader_hlsl.h" />\r
     <ClInclude Include="snd_main.h" />\r
-    <ClInclude Include="snd_modplug.h" />\r
     <ClInclude Include="snd_ogg.h" />\r
     <ClInclude Include="snd_wav.h" />\r
     <ClInclude Include="sound.h" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index 5f16c7d1045b8e9fd6222eeff58e9470bc5b9292..c33877500502f0c5c044b1c36e5b6b074ced363d 100644 (file)
     <ClCompile Include="snd_main.c" />\r
     <ClCompile Include="snd_mem.c" />\r
     <ClCompile Include="snd_mix.c" />\r
-    <ClCompile Include="snd_modplug.c" />\r
     <ClCompile Include="snd_ogg.c" />\r
     <ClCompile Include="snd_sdl.c" />\r
     <ClCompile Include="snd_wav.c" />\r
     <ClInclude Include="shader_glsl.h" />\r
     <ClInclude Include="shader_hlsl.h" />\r
     <ClInclude Include="snd_main.h" />\r
-    <ClInclude Include="snd_modplug.h" />\r
     <ClInclude Include="snd_ogg.h" />\r
     <ClInclude Include="snd_wav.h" />\r
     <ClInclude Include="sound.h" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index 69425882891b7fa07936b99de1d03bd5d474e78c..11fac69270a04b72cee6568894648874ead76ed1 100644 (file)
@@ -362,10 +362,6 @@ SOURCE=.\snd_mix.c
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\snd_modplug.c\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\snd_ogg.c\r
 # End Source File\r
 # Begin Source File\r
@@ -710,10 +706,6 @@ SOURCE=.\snd_main.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\snd_modplug.h\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\snd_ogg.h\r
 # End Source File\r
 # Begin Source File\r
index aeebb0d8d6b99361952369d15db8d7cde1d2ced4..b76d7fd0197bf07e4fb97f39a8c641e988f7b00e 100755 (executable)
                                RelativePath=".\snd_mix.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\snd_modplug.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath=".\snd_ogg.c"\r
                                >\r
                                RelativePath=".\snd_main.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\snd_modplug.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath=".\snd_ogg.h"\r
                                >\r
index 49ec7f4a8b1062b64b9155983bdb72184edc1543..ed0842b2241465f612d30d9ace279ccb50970e18 100644 (file)
     <ClCompile Include="snd_main.c" />\r
     <ClCompile Include="snd_mem.c" />\r
     <ClCompile Include="snd_mix.c" />\r
-    <ClCompile Include="snd_modplug.c" />\r
     <ClCompile Include="snd_ogg.c" />\r
     <ClCompile Include="snd_wav.c" />\r
     <ClCompile Include="snd_win.c" />\r
     <ClInclude Include="shader_glsl.h" />\r
     <ClInclude Include="shader_hlsl.h" />\r
     <ClInclude Include="snd_main.h" />\r
-    <ClInclude Include="snd_modplug.h" />\r
     <ClInclude Include="snd_ogg.h" />\r
     <ClInclude Include="snd_wav.h" />\r
     <ClInclude Include="sound.h" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index 297de1213396c5224a55f3d0ef2539f9eb90515e..086fe0b7a98ce537af9ce5c7b9cfe40e4b6d8cdf 100644 (file)
     <ClCompile Include="snd_main.c" />\r
     <ClCompile Include="snd_mem.c" />\r
     <ClCompile Include="snd_mix.c" />\r
-    <ClCompile Include="snd_modplug.c" />\r
     <ClCompile Include="snd_ogg.c" />\r
     <ClCompile Include="snd_wav.c" />\r
     <ClCompile Include="snd_win.c" />\r
     <ClInclude Include="shader_glsl.h" />\r
     <ClInclude Include="shader_hlsl.h" />\r
     <ClInclude Include="snd_main.h" />\r
-    <ClInclude Include="snd_modplug.h" />\r
     <ClInclude Include="snd_ogg.h" />\r
     <ClInclude Include="snd_wav.h" />\r
     <ClInclude Include="sound.h" />\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
   </ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
index 00a9beadb8ab6d3007a08c53bddec6372d46f0d5..23396853c0eb425cea594a254225bea45bc11e09 100644 (file)
                                RelativePath=".\snd_mix.c"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\snd_modplug.c"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath=".\snd_ogg.c"\r
                                >\r
                                RelativePath=".\snd_main.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath=".\snd_modplug.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath=".\snd_ogg.h"\r
                                >\r
index 672e25cb5c47e92858eda87f83319e05daa981aa..5cf31799de005448a05b8903cfd63d4ae5055e7c 100644 (file)
@@ -366,10 +366,6 @@ SOURCE=.\snd_mix.c
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\snd_modplug.c\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\snd_ogg.c\r
 # End Source File\r
 # Begin Source File\r
@@ -714,10 +710,6 @@ SOURCE=.\snd_main.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\snd_modplug.h\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\snd_ogg.h\r
 # End Source File\r
 # Begin Source File\r
index 95e3da5951b1f4df0feb4afd04c72d041f7e7196..ba2716953a25195cd01a9954619f6f707794079a 100644 (file)
--- a/makefile
+++ b/makefile
@@ -98,7 +98,9 @@ ifeq ($(DP_MAKE_TARGET), linux)
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
-       DP_LINK_LIBS=shared
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 endif
 
 # Mac OS X configuration
@@ -129,7 +131,9 @@ ifeq ($(DP_MAKE_TARGET), macosx)
                CFLAGS_MAKEDEP=
        endif
 
-       DP_LINK_LIBS=dlopen
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 
        # on OS X, we don't build the CL by default because it uses deprecated
        # and not-implemented-in-64bit Carbon
@@ -166,7 +170,9 @@ ifeq ($(DP_MAKE_TARGET), sunos)
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
-       DP_LINK_LIBS=shared
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 endif
 
 # BSD configuration
@@ -197,7 +203,9 @@ endif
        EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ)
 
-       DP_LINK_LIBS=shared
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 endif
 
 # Win32 configuration
@@ -252,37 +260,39 @@ ifeq ($(DP_MAKE_TARGET), mingw)
        EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ)
        EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ)
 
-       DP_LINK_LIBS=shared
+       DP_LINK_ZLIB?=shared
+       DP_LINK_JPEG?=shared
+       DP_LINK_ODE?=dlopen
 endif
 
 # set these to "" if you want to use dynamic loading instead
 # zlib
-ifeq ($(DP_LINK_LIBS), shared)
+ifeq ($(DP_LINK_ZLIB), shared)
        CFLAGS_LIBZ=-DLINK_TO_ZLIB
        LIB_Z=-lz
 endif
-ifeq ($(DP_LINK_LIBS), dlopen)
+ifeq ($(DP_LINK_ZLIB), dlopen)
        CFLAGS_LIBZ=
        LIB_Z=
 endif
 
 # jpeg
-ifeq ($(DP_LINK_LIBS), shared)
+ifeq ($(DP_LINK_JPEG), shared)
        CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
        LIB_JPEG=-ljpeg
 endif
-ifeq ($(DP_LINK_LIBS), dlopen)
+ifeq ($(DP_LINK_JPEG), dlopen)
        CFLAGS_LIBJPEG=
        LIB_JPEG=
 endif
 
 # ode
-ifeq ($(DP_LINK_LIBS), shared)
+ifeq ($(DP_LINK_ODE), shared)
        ODE_CONFIG?=ode-config
        LIB_ODE=`$(ODE_CONFIG) --libs`
        CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
 endif
-ifeq ($(DP_LINK_LIBS), dlopen)
+ifeq ($(DP_LINK_ODE), dlopen)
        LIB_ODE=
        CFLAGS_ODE=-DUSEODE
 endif
@@ -298,13 +308,6 @@ CFLAGS_CRYPTO=
 LIB_CRYPTO_RIJNDAEL=
 CFLAGS_CRYPTO_RIJNDAEL=
 
-# modplug
-# now ogg is mostly used, modplug is required rarely, keep it dlopen by default
-# LIB_SND_MODPLUG=-lmodplug
-# CFLAGS_SND_MODPLUG=-DLINK_TO_LIBMODPLUG
-LIB_SND_MODPLUG=
-CFLAGS_SND_MODPLUG=
-
 ##### Sound configuration #####
 
 ifndef DP_SOUND_API
index c3c18ae6a1dac5b9b51e3032754f28f04ad3aa23..13ab52b204b8afd1cfc97c6a5ad704a6c3279467 100644 (file)
@@ -40,7 +40,7 @@ STRIP?=strip
 
 ###### Sound and audio CD #####
 
-OBJ_SND_COMMON=snd_main.o snd_mem.o snd_mix.o snd_ogg.o snd_wav.o snd_modplug.o
+OBJ_SND_COMMON=snd_main.o snd_mem.o snd_mix.o snd_ogg.o snd_wav.o
 
 # No sound
 OBJ_SND_NULL=snd_null.o
@@ -48,23 +48,23 @@ LIB_SND_NULL=
 
 # Open Sound System (Linux, FreeBSD and Solaris)
 OBJ_SND_OSS=$(OBJ_SND_COMMON) snd_oss.o
-LIB_SND_OSS=$(LIB_SND_MODPLUG)
+LIB_SND_OSS=
 
 # Advanced Linux Sound Architecture (Linux)
 OBJ_SND_ALSA=$(OBJ_SND_COMMON) snd_alsa.o
-LIB_SND_ALSA=-lasound $(LIB_SND_MODPLUG)
+LIB_SND_ALSA=-lasound
 
 # Core Audio (Mac OS X)
 OBJ_SND_COREAUDIO=$(OBJ_SND_COMMON) snd_coreaudio.o
-LIB_SND_COREAUDIO=-framework CoreAudio $(LIB_SND_MODPLUG)
+LIB_SND_COREAUDIO=-framework CoreAudio
 
 # BSD / Sun audio API (NetBSD and OpenBSD)
 OBJ_SND_BSD=$(OBJ_SND_COMMON) snd_bsd.o
-LIB_SND_BSD=$(LIB_SND_MODPLUG)
+LIB_SND_BSD=
 
 # DirectX and Win32 WAVE output (Win32)
 OBJ_SND_WIN=$(OBJ_SND_COMMON) snd_win.o
-LIB_SND_WIN=$(LIB_SND_MODPLUG)
+LIB_SND_WIN=
 
 # Qantourisc's 3D Realtime Acoustic Lib (3D RAS)
 OBJ_SND_3DRAS=snd_3dras.o
@@ -206,12 +206,12 @@ OBJ_GLX= builddate.c sys_linux.o vid_glx.o thread_pthread.o keysym2ucs.o $(OBJ_S
 
 LDFLAGS_UNIXCOMMON=-lm $(LIB_ODE) $(LIB_Z) $(LIB_JPEG) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL)
 LDFLAGS_UNIXCL=-L$(UNIX_X11LIBPATH) -lX11 -lXpm -lXext -lXxf86vm -pthread $(LIB_SOUND)
-LDFLAGS_UNIXCL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl -lmodplug
+LDFLAGS_UNIXCL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl
 LDFLAGS_UNIXSV_PRELOAD=-lz -ljpeg -lpng -lcurl
-LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl -lmodplug
+LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -logg -ltheora -lvorbis -lvorbisenc -lvorbisfile -lcurl
 CFLAGS_UNIX_PRELOAD=-DPREFER_PRELOAD
 
-LDFLAGS_UNIXSDL=$(SDLCONFIG_LIBS) $(LIB_SND_MODPLUG)
+LDFLAGS_UNIXSDL=$(SDLCONFIG_LIBS)
 EXE_UNIXCL=darkplaces-glx
 EXE_UNIXSV=darkplaces-dedicated
 EXE_UNIXSDL=darkplaces-sdl
@@ -279,7 +279,7 @@ OBJ_WGL= builddate.c sys_win.o vid_wgl.o thread_null.o $(OBJ_SND_WIN) $(OBJ_WINC
 # see LDFLAGS_WINCOMMON in makefile
 LDFLAGS_WINCL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) -mwindows -lwinmm -luser32 -lgdi32 -ldxguid -ldinput -lcomctl32 -lws2_32 $(LDFLAGS_D3D) $(LIB_Z) $(LIB_JPEG)
 LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) -mconsole -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG)
-LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(SDLCONFIG_LIBS) $(LIB_SND_MODPLUG) -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG)
+LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(LIB_CRYPTO) $(LIB_CRYPTO_RIJNDAEL) $(SDLCONFIG_LIBS) -lwinmm -lws2_32 $(LIB_Z) $(LIB_JPEG)
 EXE_WINCL=darkplaces.exe
 EXE_WINSV=darkplaces-dedicated.exe
 EXE_WINSDL=darkplaces-sdl.exe
@@ -468,10 +468,6 @@ prepare :
        $(CMD_MKDIR) $(BUILD_DIR)
        $(CMD_CP) makefile.inc $(BUILD_DIR)/
 
-snd_modplug.o: snd_modplug.c
-       $(CHECKLEVEL2)
-       $(DO_CC) $(CFLAGS_SND_MODPLUG)
-
 #this checks USEODE when compiling so it needs the ODE flags as well
 prvm_cmds.o: prvm_cmds.c
        $(CHECKLEVEL2)
index ceb230defb46e4f8c0e486f163e4799fec20b001..d79857f4298caf075b08f89a168c0e402564c9a9 100644 (file)
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "snd_main.h"
 #include "snd_ogg.h"
-#include "snd_modplug.h"
 #include "csprogs.h"
 #include "cl_collision.h"
 #ifdef CONFIG_CD
@@ -917,7 +916,6 @@ void S_Init(void)
        memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
 
        OGG_OpenLibrary ();
-       ModPlug_OpenLibrary ();
 }
 
 
@@ -931,7 +929,6 @@ Shutdown and free all resources
 void S_Terminate (void)
 {
        S_Shutdown ();
-       ModPlug_CloseLibrary ();
        OGG_CloseLibrary ();
 
        // Free all SFXs
index 635bdd3ffb63407d8a27378fb83756a6b73b8c46..f6e6fcb35d1f8d878ae40705e41a05173be86a52 100644 (file)
--- a/snd_mem.c
+++ b/snd_mem.c
@@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "snd_main.h"
 #include "snd_ogg.h"
 #include "snd_wav.h"
-#include "snd_modplug.h"
 
 
 /*
@@ -344,11 +343,6 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain)
                        if (OGG_LoadVorbisFile (namebuffer, sfx))
                                goto loaded;
                }
-               else
-               {
-                       if (ModPlug_LoadModPlugFile (namebuffer, sfx))
-                               goto loaded;
-               }
        }
 
        // LordHavoc: then try without the added sound/ as wav and ogg
@@ -368,11 +362,6 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain)
                if (OGG_LoadVorbisFile (namebuffer, sfx))
                        goto loaded;
        }
-       else
-       {
-               if (ModPlug_LoadModPlugFile (namebuffer, sfx))
-                       goto loaded;
-       }
 
        // Can't load the sound!
        sfx->flags |= SFXFLAG_FILEMISSING;
diff --git a/snd_modplug.c b/snd_modplug.c
deleted file mode 100644 (file)
index fa0e57f..0000000
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
-       Copyright (C) 2003-2005  Mathieu Olivier
-
-       This program is free software; you can redistribute it and/or
-       modify it under the terms of the GNU General Public License
-       as published by the Free Software Foundation; either version 2
-       of the License, or (at your option) any later version.
-
-       This program is distributed in the hope that it will be useful,
-       but WITHOUT ANY WARRANTY; without even the implied warranty of
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-       See the GNU General Public License for more details.
-
-       You should have received a copy of the GNU General Public License
-       along with this program; if not, write to:
-
-               Free Software Foundation, Inc.
-               59 Temple Place - Suite 330
-               Boston, MA  02111-1307, USA
-
-*/
-
-
-#include "quakedef.h"
-#include "snd_main.h"
-#include "snd_modplug.h"
-
-#ifdef LINK_TO_LIBMODPLUG
-
-#include <libmodplug/modplug.h>
-qboolean ModPlug_OpenLibrary (void)
-{
-       return true; // statically linked
-}
-void ModPlug_CloseLibrary (void)
-{
-}
-#define modplug_dll 1
-#define qModPlug_Load ModPlug_Load
-#define qModPlug_Unload ModPlug_Unload
-#define qModPlug_Read ModPlug_Read
-#define qModPlug_Seek ModPlug_Seek
-#define qModPlug_GetSettings ModPlug_GetSettings
-#define qModPlug_SetSettings ModPlug_SetSettings
-#define qModPlug_SetMasterVolume ModPlug_SetMasterVolume
-
-#else
-// BEGIN SECTION FROM modplug.h
-
-       /*
-        * This source code is public domain.
-        *
-        * Authors: Kenton Varda <temporal@gauge3d.org> (C interface wrapper)
-        */
-
-       enum _ModPlug_Flags
-       {
-                       MODPLUG_ENABLE_OVERSAMPLING     = 1 << 0,  /* Enable oversampling (*highly* recommended) */
-                       MODPLUG_ENABLE_NOISE_REDUCTION  = 1 << 1,  /* Enable noise reduction */
-                       MODPLUG_ENABLE_REVERB           = 1 << 2,  /* Enable reverb */
-                       MODPLUG_ENABLE_MEGABASS         = 1 << 3,  /* Enable megabass */
-                       MODPLUG_ENABLE_SURROUND         = 1 << 4   /* Enable surround sound. */
-       };
-
-       enum _ModPlug_ResamplingMode
-       {
-                       MODPLUG_RESAMPLE_NEAREST = 0,  /* No interpolation (very fast, extremely bad sound quality) */
-                       MODPLUG_RESAMPLE_LINEAR  = 1,  /* Linear interpolation (fast, good quality) */
-                       MODPLUG_RESAMPLE_SPLINE  = 2,  /* Cubic spline interpolation (high quality) */
-                       MODPLUG_RESAMPLE_FIR     = 3   /* 8-tap fir filter (extremely high quality) */
-       };
-
-       typedef struct _ModPlug_Settings
-       {
-                       int mFlags;  /* One or more of the MODPLUG_ENABLE_* flags above, bitwise-OR'ed */
-                       
-                       /* Note that ModPlug always decodes sound at 44100kHz, 32 bit, stereo and then
-                        * down-mixes to the settings you choose. */
-                       int mChannels;       /* Number of channels - 1 for mono or 2 for stereo */
-                       int mBits;           /* Bits per sample - 8, 16, or 32 */
-                       int mFrequency;      /* Sampling rate - 11025, 22050, or 44100 */
-                       int mResamplingMode; /* One of MODPLUG_RESAMPLE_*, above */
-
-                       int mStereoSeparation; /* Stereo separation, 1 - 256 */
-                       int mMaxMixChannels; /* Maximum number of mixing channels (polyphony), 32 - 256 */
-                       
-                       int mReverbDepth;    /* Reverb level 0(quiet)-100(loud)      */
-                       int mReverbDelay;    /* Reverb delay in ms, usually 40-200ms */
-                       int mBassAmount;     /* XBass level 0(quiet)-100(loud)       */
-                       int mBassRange;      /* XBass cutoff in Hz 10-100            */
-                       int mSurroundDepth;  /* Surround level 0(quiet)-100(heavy)   */
-                       int mSurroundDelay;  /* Surround delay in ms, usually 5-40ms */
-                       int mLoopCount;      /* Number of times to loop.  Zero prevents looping.
-                                                                       -1 loops forever. */
-       } ModPlug_Settings;
-
-       struct _ModPlugFile;
-       typedef struct _ModPlugFile ModPlugFile;
-
-// END SECTION FROM modplug.h
-
-static ModPlugFile* (*qModPlug_Load) (const void* data, int size);
-static void (*qModPlug_Unload) (ModPlugFile* file);
-static int (*qModPlug_Read) (ModPlugFile* file, void* buffer, int size);
-static void (*qModPlug_Seek) (ModPlugFile* file, int millisecond);
-static void (*qModPlug_GetSettings) (ModPlug_Settings* settings);
-static void (*qModPlug_SetSettings) (const ModPlug_Settings* settings);
-typedef void (ModPlug_SetMasterVolume_t) (ModPlugFile* file,unsigned int cvol) ;
-ModPlug_SetMasterVolume_t *qModPlug_SetMasterVolume;
-
-
-static dllfunction_t modplugfuncs[] =
-{
-       {"ModPlug_Load",                        (void **) &qModPlug_Load},
-       {"ModPlug_Unload",                      (void **) &qModPlug_Unload},
-       {"ModPlug_Read",                        (void **) &qModPlug_Read},
-       {"ModPlug_Seek",                        (void **) &qModPlug_Seek},
-       {"ModPlug_GetSettings",         (void **) &qModPlug_GetSettings},
-       {"ModPlug_SetSettings",         (void **) &qModPlug_SetSettings},
-       {NULL, NULL}
-};
-
-// Handles for the modplug and modplugfile DLLs
-static dllhandle_t modplug_dll = NULL;
-
-/*
-=================================================================
-
-  DLL load & unload
-
-=================================================================
-*/
-
-/*
-====================
-ModPlug_OpenLibrary
-
-Try to load the modplugFile DLL
-====================
-*/
-qboolean ModPlug_OpenLibrary (void)
-{
-       const char* dllnames_modplug [] =
-       {
-#if defined(WIN32)
-               "libmodplug-1.dll",
-               "modplug.dll",
-#elif defined(MACOSX)
-               "libmodplug.dylib",
-#else
-               "libmodplug.so.1",
-               "libmodplug.so",
-#endif
-               NULL
-       };
-
-       // Already loaded?
-       if (modplug_dll)
-               return true;
-
-// COMMANDLINEOPTION: Sound: -nomodplug disables modplug sound support
-       if (COM_CheckParm("-nomodplug"))
-               return false;
-
-#ifdef __ANDROID__
-       Con_Print("Warning: no modplug support in Android yet.\n");
-       return false;
-#endif
-
-       // Load the DLLs
-       // We need to load both by hand because some OSes seem to not load
-       // the modplug DLL automatically when loading the modplugFile DLL
-       if(Sys_LoadLibrary (dllnames_modplug, &modplug_dll, modplugfuncs))
-       {
-               qModPlug_SetMasterVolume = (ModPlug_SetMasterVolume_t *) Sys_GetProcAddress(modplug_dll, "ModPlug_SetMasterVolume");
-               if(!qModPlug_SetMasterVolume)
-                       Con_Print("Warning: modplug volume control not supported. Try getting a newer version of libmodplug.\n");
-               return true;
-       }
-       else
-               return false;
-}
-
-
-/*
-====================
-ModPlug_CloseLibrary
-
-Unload the modplugFile DLL
-====================
-*/
-void ModPlug_CloseLibrary (void)
-{
-       Sys_UnloadLibrary (&modplug_dll);
-}
-#endif
-
-
-/*
-=================================================================
-
-       modplug decoding
-
-=================================================================
-*/
-
-// Per-sfx data structure
-typedef struct
-{
-       unsigned char   *file;
-       size_t                  filesize;
-} modplug_stream_persfx_t;
-
-// Per-channel data structure
-typedef struct
-{
-       ModPlugFile     *mf;
-       int                             bs;
-       int                             buffer_firstframe;
-       int                             buffer_numframes;
-       unsigned char   buffer[STREAM_BUFFERSIZE*4];
-} modplug_stream_perchannel_t;
-
-
-/*
-====================
-ModPlug_GetSamplesFloat
-====================
-*/
-static void ModPlug_GetSamplesFloat(channel_t *ch, sfx_t *sfx, int firstsampleframe, int numsampleframes, float *outsamplesfloat)
-{
-       modplug_stream_perchannel_t* per_ch = (modplug_stream_perchannel_t *)ch->fetcher_data;
-       modplug_stream_persfx_t* per_sfx = (modplug_stream_persfx_t *)sfx->fetcher_data;
-       int newlength, done, ret;
-       int f = sfx->format.width * sfx->format.channels; // bytes per frame
-       short *buf;
-       int i, len;
-
-       // If there's no fetcher structure attached to the channel yet
-       if (per_ch == NULL)
-       {
-               per_ch = (modplug_stream_perchannel_t *)Mem_Alloc(snd_mempool, sizeof(*per_ch));
-
-               // Open it with the modplugFile API
-               per_ch->mf = qModPlug_Load(per_sfx->file, per_sfx->filesize);
-               if (!per_ch->mf)
-               {
-                       // we can't call Con_Printf here, not thread safe
-//                     Con_Printf("error while reading ModPlug stream \"%s\"\n", per_sfx->name);
-                       Mem_Free(per_ch);
-                       return;
-               }
-
-#ifndef LINK_TO_LIBMODPLUG
-               if(qModPlug_SetMasterVolume)
-#endif
-                       qModPlug_SetMasterVolume(per_ch->mf, 512); // max volume, DP scales down!
-
-               per_ch->bs = 0;
-
-               per_ch->buffer_firstframe = 0;
-               per_ch->buffer_numframes = 0;
-               ch->fetcher_data = per_ch;
-       }
-
-       // if the request is too large for our buffer, loop...
-       while (numsampleframes * f > (int)sizeof(per_ch->buffer))
-       {
-               done = sizeof(per_ch->buffer) / f;
-               ModPlug_GetSamplesFloat(ch, sfx, firstsampleframe, done, outsamplesfloat);
-               firstsampleframe += done;
-               numsampleframes -= done;
-               outsamplesfloat += done * sfx->format.channels;
-       }
-
-       // seek if the request is before the current buffer (loop back)
-       // seek if the request starts beyond the current buffer by at least one frame (channel was zero volume for a while)
-       // do not seek if the request overlaps the buffer end at all (expected behavior)
-       if (per_ch->buffer_firstframe > firstsampleframe || per_ch->buffer_firstframe + per_ch->buffer_numframes < firstsampleframe)
-       {
-               // we expect to decode forward from here so this will be our new buffer start
-               per_ch->buffer_firstframe = firstsampleframe;
-               per_ch->buffer_numframes = 0;
-               // we don't actually seek - we don't care much about timing on silent mod music streams and looping never happens
-               //qModPlug_Seek(per_ch->mf, firstsampleframe * 1000.0 / sfx->format.speed);
-       }
-
-       // decompress the file as needed
-       if (firstsampleframe + numsampleframes > per_ch->buffer_firstframe + per_ch->buffer_numframes)
-       {
-               // first slide the buffer back, discarding any data preceding the range we care about
-               int offset = firstsampleframe - per_ch->buffer_firstframe;
-               int keeplength = per_ch->buffer_numframes - offset;
-               if (keeplength > 0)
-                       memmove(per_ch->buffer, per_ch->buffer + offset * sfx->format.width * sfx->format.channels, keeplength * sfx->format.width * sfx->format.channels);
-               per_ch->buffer_firstframe = firstsampleframe;
-               per_ch->buffer_numframes -= offset;
-               // decompress as much as we can fit in the buffer
-               newlength = sizeof(per_ch->buffer) - per_ch->buffer_numframes * f;
-               done = 0;
-               while (newlength > done && (ret = qModPlug_Read(per_ch->mf, (void *)((unsigned char *)per_ch->buffer + done), (int)(newlength - done))) > 0)
-                       done += ret;
-               // clear the missing space if any
-               if (done < newlength)
-               {
-                       memset(per_ch->buffer + done, 0, newlength - done);
-                       // Argh. We didn't get as many samples as we wanted. Probably
-                       // libmodplug forgot what mLoopCount==-1 means... basically, this means
-                       // we can't loop like this. Try to let DP fix it later...
-                       sfx->total_length = firstsampleframe + done / f;
-                       sfx->loopstart = 0;
-                       // can't Con_Printf from this thread
-                       //if (newlength != done)
-                       //      Con_DPrintf("ModPlug_Fetch: wanted: %d, got: %d\n", newlength, done);
-               }
-               // we now have more data in the buffer
-               per_ch->buffer_numframes += done / f;
-       }
-
-       // convert the sample format for the caller
-       buf = (short *)(per_ch->buffer + (firstsampleframe - per_ch->buffer_firstframe) * f);
-       len = numsampleframes * sfx->format.channels;
-       for (i = 0;i < len;i++)
-               outsamplesfloat[i] = buf[i] * (1.0f / 32768.0f);
-}
-
-
-/*
-====================
-ModPlug_StopChannel
-====================
-*/
-static void ModPlug_StopChannel(channel_t *ch)
-{
-       modplug_stream_perchannel_t *per_ch = (modplug_stream_perchannel_t *)ch->fetcher_data;
-
-       if (per_ch != NULL)
-       {
-               // Free the modplug decoder
-               qModPlug_Unload(per_ch->mf);
-
-               Mem_Free(per_ch);
-       }
-}
-
-
-/*
-====================
-ModPlug_FreeSfx
-====================
-*/
-static void ModPlug_FreeSfx (sfx_t *sfx)
-{
-       modplug_stream_persfx_t* per_sfx = (modplug_stream_persfx_t *)sfx->fetcher_data;
-
-       // Free the modplug file
-       Mem_Free(per_sfx->file);
-
-       // Free the stream structure
-       Mem_Free(per_sfx);
-}
-
-
-static const snd_fetcher_t modplug_fetcher = { ModPlug_GetSamplesFloat, ModPlug_StopChannel, ModPlug_FreeSfx };
-
-
-/*
-====================
-ModPlug_LoadmodplugFile
-
-Load an modplug file into memory
-====================
-*/
-qboolean ModPlug_LoadModPlugFile (const char *filename, sfx_t *sfx)
-{
-       unsigned char *data;
-       fs_offset_t filesize;
-       ModPlugFile *mf;
-       modplug_stream_persfx_t* per_sfx;
-       ModPlug_Settings s;
-
-       if (!modplug_dll)
-               return false;
-
-       // Already loaded?
-       if (sfx->fetcher != NULL)
-               return true;
-
-       // Load the file
-       data = FS_LoadFile (filename, snd_mempool, false, &filesize);
-       if (data == NULL)
-               return false;
-
-       if (developer_loading.integer >= 2)
-               Con_Printf ("Loading ModPlug file \"%s\"\n", filename);
-
-       qModPlug_GetSettings(&s);
-       s.mFlags = MODPLUG_ENABLE_OVERSAMPLING | MODPLUG_ENABLE_NOISE_REDUCTION | MODPLUG_ENABLE_REVERB;
-       s.mChannels = 2;
-       s.mBits = 16;
-       s.mFrequency = 44100;
-       s.mResamplingMode = MODPLUG_RESAMPLE_SPLINE;
-       s.mLoopCount = -1;
-       qModPlug_SetSettings(&s);
-
-       // Open it with the modplugFile API
-       if (!(mf = qModPlug_Load (data, filesize)))
-       {
-               Con_Printf ("error while opening ModPlug file \"%s\"\n", filename);
-               Mem_Free(data);
-               return false;
-       }
-
-#ifndef LINK_TO_LIBMODPLUG
-       if(qModPlug_SetMasterVolume)
-#endif
-               qModPlug_SetMasterVolume(mf, 512); // max volume, DP scales down!
-
-       if (developer_loading.integer >= 2)
-               Con_Printf ("\"%s\" will be streamed\n", filename);
-       per_sfx = (modplug_stream_persfx_t *)Mem_Alloc (snd_mempool, sizeof (*per_sfx));
-       per_sfx->file = data;
-       per_sfx->filesize = filesize;
-       sfx->memsize += sizeof(*per_sfx);
-       sfx->memsize += filesize;
-       sfx->format.speed = 44100; // modplug always works at that rate
-       sfx->format.width = 2;  // We always work with 16 bits samples
-       sfx->format.channels = 2; // stereo rulez ;) (MAYBE default to mono because Amiga MODs sound better then?)
-       sfx->fetcher_data = per_sfx;
-       sfx->fetcher = &modplug_fetcher;
-       sfx->flags |= SFXFLAG_STREAMED;
-       sfx->total_length = 1<<30; // 2147384647; // they always loop (FIXME this breaks after 6 hours, we need support for a real "infinite" value!)
-       sfx->loopstart = sfx->total_length; // modplug does it
-
-       return true;
-}
diff --git a/snd_modplug.h b/snd_modplug.h
deleted file mode 100644 (file)
index 0811080..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-       Copyright (C) 2003  Mathieu Olivier
-
-       This program is free software; you can redistribute it and/or
-       modify it under the terms of the GNU General Public License
-       as published by the Free Software Foundation; either version 2
-       of the License, or (at your option) any later version.
-
-       This program is distributed in the hope that it will be useful,
-       but WITHOUT ANY WARRANTY; without even the implied warranty of
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-       See the GNU General Public License for more details.
-
-       You should have received a copy of the GNU General Public License
-       along with this program; if not, write to:
-
-               Free Software Foundation, Inc.
-               59 Temple Place - Suite 330
-               Boston, MA  02111-1307, USA
-
-*/
-
-#ifndef SND_ModPlug_H
-#define SND_ModPlug_H
-
-
-qboolean ModPlug_OpenLibrary (void);
-void ModPlug_CloseLibrary (void);
-qboolean ModPlug_LoadModPlugFile (const char *filename, sfx_t *sfx);
-
-
-#endif