Skip to content
Permalink
Browse files

Fixed building mod support on UNIX

We always build in music SDL_RWops support
  • Loading branch information
slouken committed Dec 21, 2004
1 parent 1f63554 commit 1e5d77a69220524b163c8f1cb013a7098832eaca
Showing with 4 additions and 26 deletions.
  1. +1 −3 SDL_mixer.h
  2. +1 −5 configure.in
  3. +0 −2 mikmod/mikmod.h
  4. +0 −2 mikmod/mikmod_internals.h
  5. +0 −2 mikmod/mloader.c
  6. +0 −4 mikmod/mmio.c
  7. +2 −8 music.c
@@ -130,11 +130,9 @@ extern DECLSPEC Mix_Chunk * SDLCALL Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
#define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1)
extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS(const char *file);

#ifdef USE_RWOPS /* This hasn't been hooked into music.c yet */
/* Load a music file from an SDL_RWop object (MikMod-specific currently)
/* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently)
Matt Campbell (matt@campbellhome.dhs.org) April 2000 */
extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS_RW(SDL_RWops *rw);
#endif

/* Load a wave file of the mixer format from a memory buffer */
extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_WAV(Uint8 *mem);
@@ -85,10 +85,6 @@ AM_PATH_SDL($SDL_VERSION,
)
CFLAGS="$CFLAGS $SDL_CFLAGS"

dnl Flag for using SDL_RWops
dnl Matt Campbell (matt@campbellhome.dhs.org)
CFLAGS="$CFLAGS -DUSE_RWOPS"

dnl Check command-line options

AC_ARG_ENABLE(music-cmd,
@@ -114,7 +110,7 @@ AC_ARG_ENABLE(music-libmikmod,
if test x$enable_music_libmikmod = xyes; then
AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH])
if test "$LIBMIKMOD_CONFIG" = "no" ; then
no_libmikmod==yes
no_libmikmod=yes
else
CFLAGS_SAVED="$CFLAGS"
LIBS_SAVED="$LIBS"
@@ -522,10 +522,8 @@ MIKMODAPI extern struct MLOADER load_xm; /* FastTracker 2 (by Triton) */
*/

/* SDL_RWops compatability */
#ifdef USE_RWOPS
#include "SDL_rwops.h"
MIKMODAPI extern MODULE* Player_LoadRW(SDL_RWops*,int,BOOL);
#endif /* USE_RWOPS */
/* End SDL_RWops compatability */
MIKMODAPI extern MODULE* Player_Load(CHAR*,int,BOOL);
MIKMODAPI extern MODULE* Player_LoadFP(FILE*,int,BOOL);
@@ -136,10 +136,8 @@ DECLARE_MUTEX(vars);
/*========== Portable file I/O */

/* SDL_RWops compatability */
#ifdef USE_RWOPS
extern MREADER *_mm_new_rwops_reader(SDL_RWops * rw);
extern void _mm_delete_rwops_reader (MREADER*);
#endif /* USE_RWOPS */
/* End SDL_RWops compatability */

extern MREADER* _mm_new_file_reader(FILE* fp);
@@ -538,7 +538,6 @@ MODULE* Player_Load(CHAR* filename,int maxchan,BOOL curious)
}

/* SDL_RWops compatability */
#ifdef USE_RWOPS

/* Open a module via an SDL_rwop. The loader will initialize the specified
song-player 'player'. */
@@ -554,7 +553,6 @@ MODULE* Player_LoadRW(SDL_RWops *rw,int maxchan,BOOL curious)
return result;
}

#endif /* USE_RWOPS */
/* End SDL_RWops compatability */

/* ex:set ts=4: */
@@ -74,8 +74,6 @@ static long _mm_iobase=0,temp_iobase=0;
*/

#ifdef USE_RWOPS

typedef struct MRWOPSREADER {
MREADER core;
SDL_RWops* rw;
@@ -138,8 +136,6 @@ void _mm_delete_rwops_reader (MREADER* reader)
if(reader) free(reader);
}

#endif /* USE_RWOPS */

/*
End SDL_rwops section
10 music.c
@@ -56,10 +56,8 @@
# define UNIMOD MODULE
# define MikMod_Init() MikMod_Init(NULL)
# define MikMod_LoadSong(a,b) Player_Load(a,b,0)
# ifdef USE_RWOPS
# ifndef LIBMIKMOD_MUSIC
# define MikMod_LoadSongRW(a,b) Player_LoadRW(a,b,0)
# endif
# ifndef LIBMIKMOD_MUSIC
# define MikMod_LoadSongRW(a,b) Player_LoadRW(a,b,0)
# endif
# define MikMod_FreeSong Player_Free
extern int MikMod_errno;
@@ -1228,8 +1226,6 @@ void close_music(void)
#endif
}

#ifdef USE_RWOPS

# ifdef LIBMIKMOD_MUSIC
typedef struct
{
@@ -1354,5 +1350,3 @@ Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw) {
}
return(music);
}

#endif /* USE_RWOPS */

0 comments on commit 1e5d77a

Please sign in to comment.