Skip to content
Permalink
Browse files

Fixed building with some audio support disabled

  • Loading branch information
slouken committed Nov 8, 2009
1 parent 2944433 commit da4949acfb8bd1e00cb1e7d75ffe2a10d3979893
Showing with 24 additions and 48 deletions.
  1. +0 −12 dynamic_flac.c
  2. +0 −12 dynamic_mod.c
  3. +0 −12 dynamic_mp3.c
  4. +0 −12 dynamic_ogg.c
  5. +24 −0 mixer.c
@@ -176,16 +176,4 @@ void Mix_QuitFLAC()
}
#endif /* FLAC_DYNAMIC */

#else

int Mix_InitFLAC()
{
Mix_SetError("FLAC audio is not supported");
return -1;
}

void Mix_QuitFLAC()
{
}

#endif /* FLAC_MUSIC */
@@ -273,16 +273,4 @@ void Mix_QuitMOD()
}
#endif /* MOD_DYNAMIC */

#else

int Mix_InitMOD()
{
Mix_SetError("MOD audio is not supported");
return -1;
}

void Mix_QuitMOD()
{
}

#endif /* MOD_MUSIC */
@@ -177,16 +177,4 @@ void Mix_QuitMP3()
}
#endif /* MP3_DYNAMIC */

#else

int Mix_InitMP3()
{
Mix_SetError("MP3 audio is not supported");
return -1;
}

void Mix_QuitMP3()
{
}

#endif /* MP3_MUSIC */
@@ -125,16 +125,4 @@ void Mix_QuitOgg()
}
#endif /* OGG_DYNAMIC */

#else

int Mix_InitOgg()
{
Mix_SetError("Ogg Vorbis audio is not supported");
return -1;
}

void Mix_QuitOgg()
{
}

#endif /* OGG_MUSIC */
24 mixer.c
@@ -145,24 +145,40 @@ int Mix_Init(int flags)
int result = 0;

if ((flags & MIX_INIT_FLAC) && !(initialized & MIX_INIT_FLAC)) {
#ifdef FLAC_MUSIC
if (Mix_InitFLAC() == 0) {
result |= MIX_INIT_FLAC;
}
#else
Mix_SetError("Mixer not built with FLAC support");
#endif
}
if ((flags & MIX_INIT_MOD) && !(initialized & MIX_INIT_MOD)) {
#ifdef MOD_MUSIC
if (Mix_InitMOD() == 0) {
result |= MIX_INIT_MOD;
}
#else
Mix_SetError("Mixer not built with MOD support");
#endif
}
if ((flags & MIX_INIT_MP3) && !(initialized & MIX_INIT_MP3)) {
#ifdef MP3_MUSIC
if (Mix_InitMP3() == 0) {
result |= MIX_INIT_MP3;
}
#else
Mix_SetError("Mixer not built with MP3 support");
#endif
}
if ((flags & MIX_INIT_OGG) && !(initialized & MIX_INIT_OGG)) {
#ifdef OGG_MUSIC
if (Mix_InitOgg() == 0) {
result |= MIX_INIT_OGG;
}
#else
Mix_SetError("Mixer not built with Ogg Vorbis support");
#endif
}
initialized |= result;

@@ -171,18 +187,26 @@ int Mix_Init(int flags)

void Mix_Quit()
{
#ifdef FLAC_MUSIC
if (initialized & MIX_INIT_FLAC) {
Mix_QuitFLAC();
}
#endif
#ifdef MOD_MUSIC
if (initialized & MIX_INIT_MOD) {
Mix_QuitMOD();
}
#endif
#ifdef MP3_MUSIC
if (initialized & MIX_INIT_MP3) {
Mix_QuitMP3();
}
#endif
#ifdef OGG_MUSIC
if (initialized & MIX_INIT_OGG) {
Mix_QuitOgg();
}
#endif
initialized = 0;
}

0 comments on commit da4949a

Please sign in to comment.