diff --git a/projects/unix/Makefile b/projects/unix/Makefile old mode 100755 new mode 100644 index e03a765..30ffbb6 --- a/projects/unix/Makefile +++ b/projects/unix/Makefile @@ -149,23 +149,6 @@ ifeq ($(OS), OSX) endif endif -# test for presence of SDL -ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined) - SDL_CONFIG = $(CROSS_COMPILE)sdl2-config - ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) - SDL_CONFIG = $(CROSS_COMPILE)sdl-config - ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),) - $(error No SDL development libraries found!) - else - $(warning Using SDL 1.2 libraries) - endif - endif - SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags) - SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs) -endif -CFLAGS += $(SDL_CFLAGS) -LDLIBS += $(SDL_LDLIBS) - # test for essential build dependencies ifeq ($(origin PKG_CONFIG), undefined) PKG_CONFIG = $(CROSS_COMPILE)pkg-config @@ -174,6 +157,17 @@ ifeq ($(origin PKG_CONFIG), undefined) endif endif +# test for presence of SDL +ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined) + ifeq ($(shell $(PKG_CONFIG) --modversion sdl2 2>/dev/null),) + $(error No SDL2 development libraries found!) + endif + SDL_CFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2) + SDL_LDLIBS += $(shell $(PKG_CONFIG) --libs sdl2) +endif +CFLAGS += $(SDL_CFLAGS) +LDLIBS += $(SDL_LDLIBS) + # test for presence of speexdsp ifneq ($(NO_SPEEX), 1) ifeq ($(origin SPEEX_CFLAGS) $(origin SPEEX_LDLIBS), undefined undefined) diff --git a/src/main.c b/src/main.c index a0895fa..d4dbe4d 100644 --- a/src/main.c +++ b/src/main.c @@ -76,9 +76,7 @@ They tend to rely on a default frequency, apparently, never the same one ;)*/ #define DEFAULT_FREQUENCY 33600 -#if SDL_VERSION_ATLEAST(2,0,0) #define SDL_MixAudio(A, B, C, D) SDL_MixAudioFormat(A, B, AUDIO_S16SYS, C, D) -#endif /* local variables */ static void (*l_DebugCallback)(void *, int, const char *) = NULL; diff --git a/src/sdl_backend.c b/src/sdl_backend.c index 71aecda..572aae3 100644 --- a/src/sdl_backend.c +++ b/src/sdl_backend.c @@ -37,22 +37,6 @@ #define N64_SAMPLE_BYTES 4 #define SDL_SAMPLE_BYTES 4 -/* For SDL < 1.3 */ -#if !SDL_VERSION_ATLEAST(1,3,0) -#define SDL_AUDIO_MASK_BITSIZE (0xFF) -#define SDL_AUDIO_MASK_DATATYPE (1<<8) -#define SDL_AUDIO_MASK_ENDIAN (1<<12) -#define SDL_AUDIO_MASK_SIGNED (1<<15) -#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) -#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) -#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) -#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) -#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) -#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) -#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) -#endif - -#if SDL_VERSION_ATLEAST(2,0,0) #define SDL_LockAudio() SDL_LockAudioDevice(sdl_backend->device) #define SDL_UnlockAudio() SDL_UnlockAudioDevice(sdl_backend->device) #define SDL_PauseAudio(A) SDL_PauseAudioDevice(sdl_backend->device, A) @@ -61,10 +45,6 @@ struct sdl_backend { SDL_AudioDeviceID device; -#else -struct sdl_backend -{ -#endif m64p_handle config; struct circular_buffer primary_buffer;