mixer.c
changeset 472 463ba3222193
parent 470 5cebd6c5be2d
child 473 60b7e1c4f6b2
     1.1 --- a/mixer.c	Sun Nov 08 16:39:26 2009 +0000
     1.2 +++ b/mixer.c	Sun Nov 08 17:03:07 2009 +0000
     1.3 @@ -145,24 +145,40 @@
     1.4  	int result = 0;
     1.5  
     1.6  	if ((flags & MIX_INIT_FLAC) && !(initialized & MIX_INIT_FLAC)) {
     1.7 +#ifdef FLAC_MUSIC
     1.8  		if (Mix_InitFLAC() == 0) {
     1.9  			result |= MIX_INIT_FLAC;
    1.10  		}
    1.11 +#else
    1.12 +		Mix_SetError("Mixer not built with FLAC support");
    1.13 +#endif
    1.14  	}
    1.15  	if ((flags & MIX_INIT_MOD) && !(initialized & MIX_INIT_MOD)) {
    1.16 +#ifdef MOD_MUSIC
    1.17  		if (Mix_InitMOD() == 0) {
    1.18  			result |= MIX_INIT_MOD;
    1.19  		}
    1.20 +#else
    1.21 +		Mix_SetError("Mixer not built with MOD support");
    1.22 +#endif
    1.23  	}
    1.24  	if ((flags & MIX_INIT_MP3) && !(initialized & MIX_INIT_MP3)) {
    1.25 +#ifdef MP3_MUSIC
    1.26  		if (Mix_InitMP3() == 0) {
    1.27  			result |= MIX_INIT_MP3;
    1.28  		}
    1.29 +#else
    1.30 +		Mix_SetError("Mixer not built with MP3 support");
    1.31 +#endif
    1.32  	}
    1.33  	if ((flags & MIX_INIT_OGG) && !(initialized & MIX_INIT_OGG)) {
    1.34 +#ifdef OGG_MUSIC
    1.35  		if (Mix_InitOgg() == 0) {
    1.36  			result |= MIX_INIT_OGG;
    1.37  		}
    1.38 +#else
    1.39 +		Mix_SetError("Mixer not built with Ogg Vorbis support");
    1.40 +#endif
    1.41  	}
    1.42  	initialized |= result;
    1.43  
    1.44 @@ -171,18 +187,26 @@
    1.45  
    1.46  void Mix_Quit()
    1.47  {
    1.48 +#ifdef FLAC_MUSIC
    1.49  	if (initialized & MIX_INIT_FLAC) {
    1.50  		Mix_QuitFLAC();
    1.51  	}
    1.52 +#endif
    1.53 +#ifdef MOD_MUSIC
    1.54  	if (initialized & MIX_INIT_MOD) {
    1.55  		Mix_QuitMOD();
    1.56  	}
    1.57 +#endif
    1.58 +#ifdef MP3_MUSIC
    1.59  	if (initialized & MIX_INIT_MP3) {
    1.60  		Mix_QuitMP3();
    1.61  	}
    1.62 +#endif
    1.63 +#ifdef OGG_MUSIC
    1.64  	if (initialized & MIX_INIT_OGG) {
    1.65  		Mix_QuitOgg();
    1.66  	}
    1.67 +#endif
    1.68  	initialized = 0;
    1.69  }
    1.70