From 3829998889ea72cf56bbcbf3b83bf97e225cf6d1 Mon Sep 17 00:00:00 2001
From: mazmazz <mar.marcoz@outlook.com>
Date: Tue, 21 Aug 2018 14:57:53 -0400
Subject: [PATCH] Initial work on SDL Mixer X

---
 src/p_enemy.c         | 4 ++--
 src/sdl/Makefile.cfg  | 2 +-
 src/sdl/mixer_sound.c | 6 +++++-
 src/sdl/sdl_sound.c   | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/p_enemy.c b/src/p_enemy.c
index 9235a1d0f..6e931a704 100644
--- a/src/p_enemy.c
+++ b/src/p_enemy.c
@@ -11378,7 +11378,7 @@ void A_ConnectToGround(mobj_t *actor)
 	mobj_t *work;
 	fixed_t workz;
 	fixed_t workh;
-	INT8 dir;
+	SINT8 dir;
 	angle_t ang;
 	INT32 locvar1 = var1;
 	INT32 locvar2 = var2;
@@ -11636,4 +11636,4 @@ void A_CheckFlags2(mobj_t *actor)
 
 	if (actor->flags2 & locvar1)
 		P_SetMobjState(actor, (statenum_t)locvar2);
-}
\ No newline at end of file
+}
diff --git a/src/sdl/Makefile.cfg b/src/sdl/Makefile.cfg
index 58c4d0861..57d594835 100644
--- a/src/sdl/Makefile.cfg
+++ b/src/sdl/Makefile.cfg
@@ -80,7 +80,7 @@ ifdef NOMIXER
 else
 	i_sound_o=$(OBJDIR)/mixer_sound.o
 	OPTS+=-DHAVE_MIXER
-	SDL_LDFLAGS+=-lSDL2_mixer
+	SDL_LDFLAGS+=-lSDL2_mixer_ext
 endif
 
 ifdef SDL_TTF
diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c
index 5211efe0a..32c168f9a 100644
--- a/src/sdl/mixer_sound.c
+++ b/src/sdl/mixer_sound.c
@@ -20,7 +20,7 @@
 #pragma warning(default : 4214 4244)
 #endif
 
-#include "SDL_mixer.h"
+#include <SDL2/SDL_mixer_ext.h>
 
 /* This is the version number macro for the current SDL_mixer version: */
 #ifndef SDL_MIXER_COMPILEDVERSION
@@ -686,6 +686,9 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
 
 	if (loop_point != 0.0f)
 		Mix_HookMusicFinished(music_loop);
+
+	CONS_Printf("X Song length %.4f\n", Mix_GetMusicTotalTime(music));
+
 	return true;
 }
 
@@ -773,6 +776,7 @@ boolean I_SetSongTrack(int track)
 
 FUNCMATH void I_InitMIDIMusic(void)
 {
+	Mix_SetMidiPlayer(MIDI_Fluidsynth);
 }
 
 void I_ShutdownMIDIMusic(void)
diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c
index 63b51c625..38ed42fd3 100644
--- a/src/sdl/sdl_sound.c
+++ b/src/sdl/sdl_sound.c
@@ -32,7 +32,7 @@
 #endif
 
 #ifdef HAVE_MIXER
-#include "SDL_mixer.h"
+#include <SDL2/SDL_mixer_ext.h>
 /* This is the version number macro for the current SDL_mixer version: */
 #ifndef SDL_MIXER_COMPILEDVERSION
 #define SDL_MIXER_COMPILEDVERSION \
-- 
GitLab