diff --git a/SpaceCadetPinball/Sound.cpp b/SpaceCadetPinball/Sound.cpp index dfcc4bd..4fa9336 100644 --- a/SpaceCadetPinball/Sound.cpp +++ b/SpaceCadetPinball/Sound.cpp @@ -1,21 +1,13 @@ #include "pch.h" #include "Sound.h" -#ifndef SDL_MIXER_VERSION_ATLEAST -#define SDL_MIXER_VERSION_ATLEAST(X, Y, Z) (SDL_MIXER_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) -#endif - int Sound::num_channels; bool Sound::enabled_flag = false; int* Sound::TimeStamps = nullptr; bool Sound::Init(int channels, bool enableFlag) { -#if SDL_MIXER_VERSION_ATLEAST(2, 0, 3) - Mix_Init(MIX_INIT_MID); -#else - Mix_Init(MIX_INIT_FLUIDSYNTH); -#endif + Mix_Init(MIX_INIT_MID_Proxy); auto result = Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024); SetChannels(channels); Enable(enableFlag); diff --git a/SpaceCadetPinball/pch.h b/SpaceCadetPinball/pch.h index c1fa767..9a49af3 100644 --- a/SpaceCadetPinball/pch.h +++ b/SpaceCadetPinball/pch.h @@ -34,6 +34,14 @@ #include "SDL.h" #include +// MIX_INIT_FLUIDSYNTH was renamed to MIX_INIT_MID in SDL_mixer v2.0.2 +constexpr int MIX_INIT_MID_Proxy = +#if SDL_MIXER_PATCHLEVEL >= 2 + MIX_INIT_MID; +#else + MIX_INIT_FLUIDSYNTH; +#endif + //https://github.com/ocornut/imgui 7b913db1ce9dd2fd98e5790aa59974dd4496be3b #include "imgui.h" #include "imgui_internal.h"