diff options
author | Matthew Michelotti <michelotti.matthew@gmail.com> | 2018-08-02 19:10:53 -0500 |
---|---|---|
committer | Matthew Michelotti <michelotti.matthew@gmail.com> | 2018-08-02 19:10:53 -0500 |
commit | ed76abcec6b4ec5444f893425e9a8a4c0509546b (patch) | |
tree | ff757885159c0e55aad8d2d0fb1f35a9d7842be2 | |
parent | ed85c839eead3e94e50924744a9624e9b34403b1 (diff) |
Hack: ignoring Mix_Init error flag, fixes #2
-rw-r--r-- | gate/src/core/sdl/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gate/src/core/sdl/mod.rs b/gate/src/core/sdl/mod.rs index b8b4ca5..60831c9 100644 --- a/gate/src/core/sdl/mod.rs +++ b/gate/src/core/sdl/mod.rs @@ -132,7 +132,13 @@ fn build_renderer<AS: AppAssetId>(info: &AppInfo, sdl_renderer: &SdlRenderer) -> } fn mixer_init() -> Sdl2MixerContext { - sdl2::mixer::init(INIT_OGG).unwrap() + match sdl2::mixer::init(INIT_OGG) { + Ok(ctx) => ctx, + // HACK TODO remove special handling once SDL2 mixer 2.0.3 is released + // (see https://bugzilla.libsdl.org/show_bug.cgi?id=3929 for details) + Err(ref msg) if msg.as_str() == "OGG support not available" => Sdl2MixerContext, + Err(msg) => panic!("sdl2::mixer::init failed: {}", msg), + } } fn mixer_setup() { |