From edf2c0c461cb2914eafd7695f7205673d690dcde Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Wed, 26 Dec 2018 07:35:42 -0800 Subject: [PATCH] fix xaudio2 when openal is disabled Move the new faudio driver constant AUD_FAUDIO to the end of the sound driver enum, otherwise the wrong is used. Also check for NO_OAL before instantiating an openal driver. --- src/wx/wxvbam.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index d213751a..5ff50f87 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -449,8 +449,8 @@ enum renderer { enum audioapi { AUD_SDL, AUD_OPENAL, AUD_DIRECTSOUND, - AUD_FAUDIO, - AUD_XAUDIO2 }; + AUD_XAUDIO2, + AUD_FAUDIO }; // an unfortunate legacy default; should have a non-digit preceding %d // the only reason to keep it is that user can set slotdir to old dir @@ -703,11 +703,15 @@ private: #include "opts.h" -class SoundDriver; -extern SoundDriver* newOpenAL(); // I should add this to SoundDriver, but wxArrayString is wx-specific // I suppose I could make subclass wxSoundDriver. maybe later. + +#ifndef NO_OAL +class SoundDriver; +extern SoundDriver* newOpenAL(); extern bool GetOALDevices(wxArrayString& names, wxArrayString& ids); +#endif + #ifdef __WXMSW__ extern SoundDriver* newDirectSound(); extern bool GetDSDevices(wxArrayString& names, wxArrayString& ids);