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.
This commit is contained in:
Rafael Kitover 2018-12-26 07:35:42 -08:00
parent 3ed08e8d68
commit edf2c0c461
1 changed files with 8 additions and 4 deletions

View File

@ -449,8 +449,8 @@ enum renderer {
enum audioapi { AUD_SDL, enum audioapi { AUD_SDL,
AUD_OPENAL, AUD_OPENAL,
AUD_DIRECTSOUND, AUD_DIRECTSOUND,
AUD_FAUDIO, AUD_XAUDIO2,
AUD_XAUDIO2 }; AUD_FAUDIO };
// an unfortunate legacy default; should have a non-digit preceding %d // 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 // the only reason to keep it is that user can set slotdir to old dir
@ -703,11 +703,15 @@ private:
#include "opts.h" #include "opts.h"
class SoundDriver;
extern SoundDriver* newOpenAL();
// I should add this to SoundDriver, but wxArrayString is wx-specific // I should add this to SoundDriver, but wxArrayString is wx-specific
// I suppose I could make subclass wxSoundDriver. maybe later. // I suppose I could make subclass wxSoundDriver. maybe later.
#ifndef NO_OAL
class SoundDriver;
extern SoundDriver* newOpenAL();
extern bool GetOALDevices(wxArrayString& names, wxArrayString& ids); extern bool GetOALDevices(wxArrayString& names, wxArrayString& ids);
#endif
#ifdef __WXMSW__ #ifdef __WXMSW__
extern SoundDriver* newDirectSound(); extern SoundDriver* newDirectSound();
extern bool GetDSDevices(wxArrayString& names, wxArrayString& ids); extern bool GetDSDevices(wxArrayString& names, wxArrayString& ids);