Skip to content

Commit

Permalink
Switched from mikmod to libmodplug, which is now in the public domain.
Browse files Browse the repository at this point in the history
This allows us to add MOD support for iOS and Android, yay!
  • Loading branch information
slouken committed Jun 9, 2013
1 parent bf19d22 commit 1c6d630
Show file tree
Hide file tree
Showing 97 changed files with 76,519 additions and 2,741 deletions.
61 changes: 53 additions & 8 deletions Android.mk
Expand Up @@ -4,15 +4,20 @@ include $(CLEAR_VARS)

LOCAL_MODULE := SDL2_mixer

# Enable this if you want to support loading MOD music via modplug
# The library path should be a relative path to this directory.
SUPPORT_MOD_MODPLUG := true
MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.8.4

# Enable this if you want to support loading MOD music via mikmod
# The library path should be a relative path to this directory.
SUPPORT_MOD := true
MOD_LIBRARY_PATH := external/libmikmod-3.1.12
SUPPORT_MOD_MIKMOD := true
MIKMOD_LIBRARY_PATH := external/libmikmod-3.1.12

# Enable this if you want to support loading MP3 music via SMPEG
# The library path should be a relative path to this directory.
SUPPORT_MP3 := true
MP3_LIBRARY_PATH := external/smpeg2-2.0.0
SUPPORT_MP3_SMPEG := true
SMPEG_LIBRARY_PATH := external/smpeg2-2.0.0

# Enable this if you want to support loading OGG Vorbis music via Tremor
# The library path should be a relative path to this directory.
Expand All @@ -30,14 +35,54 @@ LOCAL_LDLIBS :=
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := SDL2

ifeq ($(SUPPORT_MOD),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MOD_LIBRARY_PATH)/include
ifeq ($(SUPPORT_MOD_MODPLUG),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
LOCAL_CFLAGS += -DMODPLUG_MUSIC -DHAVE_SETENV -DHAVE_SINF
LOCAL_SRC_FILES += \
$(MODPLUG_LIBRARY_PATH)/src/fastmix.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_669.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_abc.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_amf.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_ams.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_dbm.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_dmf.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_dsm.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_far.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_it.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_j2b.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_mdl.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_med.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_mid.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_mod.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_mt2.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_mtm.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_okt.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_pat.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_psm.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_ptm.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_s3m.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_stm.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_ult.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_umx.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_wav.cpp \
$(MODPLUG_LIBRARY_PATH)/src/load_xm.cpp \
$(MODPLUG_LIBRARY_PATH)/src/mmcmp.cpp \
$(MODPLUG_LIBRARY_PATH)/src/modplug.cpp \
$(MODPLUG_LIBRARY_PATH)/src/snd_dsp.cpp \
$(MODPLUG_LIBRARY_PATH)/src/snd_flt.cpp \
$(MODPLUG_LIBRARY_PATH)/src/snd_fx.cpp \
$(MODPLUG_LIBRARY_PATH)/src/sndfile.cpp \
$(MODPLUG_LIBRARY_PATH)/src/sndmix.cpp
endif

ifeq ($(SUPPORT_MOD_MIKMOD),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MIKMOD_LIBRARY_PATH)/include
LOCAL_CFLAGS += -DMOD_MUSIC
LOCAL_SHARED_LIBRARIES += mikmod
endif

ifeq ($(SUPPORT_MP3),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MP3_LIBRARY_PATH)
ifeq ($(SUPPORT_MP3_SMPEG),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(SMPEG_LIBRARY_PATH)
LOCAL_CFLAGS += -DMP3_MUSIC
LOCAL_SHARED_LIBRARIES += smpeg2
endif
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.txt
@@ -1,4 +1,6 @@
2.0.0:
Sam Lantinga - Sun Jun 9 14:45:30 PDT 2013
* Made libmodplug the default MOD player as it is now in the public domain
Sam Lantinga - Sat Jun 1 19:11:08 PDT 2013
* Updated for SDL 2.0 release
* SDL_LoadMUS_RW() now takes an argument telling whether or not the data source should be freed when done.
Expand Down
7 changes: 4 additions & 3 deletions SDL_mixer.h
Expand Up @@ -68,9 +68,10 @@ typedef enum
{
MIX_INIT_FLAC = 0x00000001,
MIX_INIT_MOD = 0x00000002,
MIX_INIT_MP3 = 0x00000004,
MIX_INIT_OGG = 0x00000008,
MIX_INIT_FLUIDSYNTH = 0x00000010
MIX_INIT_MODPLUG = 0x00000004,
MIX_INIT_MP3 = 0x00000008,
MIX_INIT_OGG = 0x00000010,
MIX_INIT_FLUIDSYNTH = 0x00000020
} MIX_InitFlags;

/* Loads dynamic libraries and prepares them for use. Flags should be
Expand Down
24 changes: 20 additions & 4 deletions VisualC/SDL_mixer_VS2008.vcproj
Expand Up @@ -53,7 +53,7 @@
AdditionalOptions="/D OGG_DYNAMIC=\"libvorbisfile-3.dll\""
Optimization="0"
AdditionalIncludeDirectories="..\timidity;..\native_midi;external\include"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WAV_MUSIC;MOD_MUSIC;MOD_DYNAMIC=\"libmikmod-2.dll\";OGG_MUSIC;OGG_DYNAMIC=\"libvorbisfile-3.dll\";FLAC_MUSIC;FLAC_DYNAMIC=\"libFLAC-8.dll\";MP3_MUSIC;MP3_DYNAMIC=\"smpeg2.dll\";MID_MUSIC;USE_TIMIDITY_MIDI;USE_NATIVE_MIDI"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WAV_MUSIC;MODPLUG_MUSIC;MODPLUG_DYNAMIC=\"libmodplug-1.dll\";OGG_MUSIC;OGG_DYNAMIC=\"libvorbisfile-3.dll\";FLAC_MUSIC;FLAC_DYNAMIC=\"libFLAC-8.dll\";MP3_MUSIC;MP3_DYNAMIC=\"smpeg2.dll\";MID_MUSIC;USE_TIMIDITY_MIDI;USE_NATIVE_MIDI"
MinimalRebuild="true"
RuntimeLibrary="2"
PrecompiledHeaderFile=".\Debug/SDL2_mixer.pch"
Expand Down Expand Up @@ -140,7 +140,7 @@
AdditionalOptions="/D OGG_DYNAMIC=\"libvorbisfile-3.dll\""
Optimization="0"
AdditionalIncludeDirectories="..\timidity;..\native_midi;external\include"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WAV_MUSIC;MOD_MUSIC;MOD_DYNAMIC=\"libmikmod-2.dll\";OGG_MUSIC;OGG_DYNAMIC=\"libvorbisfile-3.dll\";FLAC_MUSIC;FLAC_DYNAMIC=\"libFLAC-8.dll\";MP3_MUSIC;MP3_DYNAMIC=\"smpeg2.dll\";MID_MUSIC;USE_TIMIDITY_MIDI;USE_NATIVE_MIDI"
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WAV_MUSIC;MODPLUG_MUSIC;MODPLUG_DYNAMIC=\"libmodplug-1.dll\";OGG_MUSIC;OGG_DYNAMIC=\"libvorbisfile-3.dll\";FLAC_MUSIC;FLAC_DYNAMIC=\"libFLAC-8.dll\";MP3_MUSIC;MP3_DYNAMIC=\"smpeg2.dll\";MID_MUSIC;USE_TIMIDITY_MIDI;USE_NATIVE_MIDI"
MinimalRebuild="true"
RuntimeLibrary="2"
PrecompiledHeaderFile=".\Debug/SDL2_mixer.pch"
Expand Down Expand Up @@ -228,7 +228,7 @@
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\timidity;..\native_midi;external\include"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WAV_MUSIC;MOD_MUSIC;MOD_DYNAMIC=\"libmikmod-2.dll\";OGG_MUSIC;OGG_DYNAMIC=\"libvorbisfile-3.dll\";FLAC_MUSIC;FLAC_DYNAMIC=\"libFLAC-8.dll\";MP3_MUSIC;MP3_DYNAMIC=\"smpeg2.dll\";MID_MUSIC;USE_TIMIDITY_MIDI;USE_NATIVE_MIDI"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WAV_MUSIC;MODPLUG_MUSIC;MODPLUG_DYNAMIC=\"libmodplug-1.dll\";OGG_MUSIC;OGG_DYNAMIC=\"libvorbisfile-3.dll\";FLAC_MUSIC;FLAC_DYNAMIC=\"libFLAC-8.dll\";MP3_MUSIC;MP3_DYNAMIC=\"smpeg2.dll\";MID_MUSIC;USE_TIMIDITY_MIDI;USE_NATIVE_MIDI"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
Expand Down Expand Up @@ -314,7 +314,7 @@
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\timidity;..\native_midi;external\include"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WAV_MUSIC;MOD_MUSIC;MOD_DYNAMIC=\"libmikmod-2.dll\";OGG_MUSIC;OGG_DYNAMIC=\"libvorbisfile-3.dll\";FLAC_MUSIC;FLAC_DYNAMIC=\"libFLAC-8.dll\";MP3_MUSIC;MP3_DYNAMIC=\"smpeg2.dll\";MID_MUSIC;USE_TIMIDITY_MIDI;USE_NATIVE_MIDI"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;WAV_MUSIC;MODPLUG_MUSIC;MODPLUG_DYNAMIC=\"libmodplug-1.dll\";OGG_MUSIC;OGG_DYNAMIC=\"libvorbisfile-3.dll\";FLAC_MUSIC;FLAC_DYNAMIC=\"libFLAC-8.dll\";MP3_MUSIC;MP3_DYNAMIC=\"smpeg2.dll\";MID_MUSIC;USE_TIMIDITY_MIDI;USE_NATIVE_MIDI"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
Expand Down Expand Up @@ -392,6 +392,14 @@
RelativePath="..\dynamic_mod.h"
>
</File>
<File
RelativePath="..\dynamic_modplug.c"
>
</File>
<File
RelativePath="..\dynamic_modplug.h"
>
</File>
<File
RelativePath="..\dynamic_mp3.c"
>
Expand Down Expand Up @@ -900,6 +908,14 @@
RelativePath="..\music_mod.h"
>
</File>
<File
RelativePath="..\music_modplug.c"
>
</File>
<File
RelativePath="..\music_modplug.h"
>
</File>
<File
RelativePath="..\music_ogg.c"
>
Expand Down

0 comments on commit 1c6d630

Please sign in to comment.