Skip to content

Commit

Permalink
Fixed building mod support on UNIX
Browse files Browse the repository at this point in the history
We always build in music SDL_RWops support
  • Loading branch information
slouken committed Dec 21, 2004
1 parent 1f63554 commit 1e5d77a
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 26 deletions.
4 changes: 1 addition & 3 deletions SDL_mixer.h
Expand Up @@ -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);
Expand Down
6 changes: 1 addition & 5 deletions configure.in
Expand Up @@ -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,
Expand All @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions mikmod/mikmod.h
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions mikmod/mikmod_internals.h
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions mikmod/mloader.c
Expand Up @@ -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'. */
Expand All @@ -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: */
4 changes: 0 additions & 4 deletions mikmod/mmio.c
Expand Up @@ -74,8 +74,6 @@ static long _mm_iobase=0,temp_iobase=0;
*/

#ifdef USE_RWOPS

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

#endif /* USE_RWOPS */

/*
End SDL_rwops section
Expand Down
10 changes: 2 additions & 8 deletions music.c
Expand Up @@ -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;
Expand Down Expand Up @@ -1228,8 +1226,6 @@ void close_music(void)
#endif
}

#ifdef USE_RWOPS

# ifdef LIBMIKMOD_MUSIC
typedef struct
{
Expand Down Expand Up @@ -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.