diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-10-25 08:39:04 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-10-25 08:40:11 +0100 |
commit | aac0c3fb679401eab584cf91c07bd4353022c91c (patch) | |
tree | 10ae219d4c9ce000917d5ff319f281bc40d20431 /src/core | |
parent | Fix bindings not loaded on Linux (diff) | |
download | re3-aac0c3fb679401eab584cf91c07bd4353022c91c.tar re3-aac0c3fb679401eab584cf91c07bd4353022c91c.tar.gz re3-aac0c3fb679401eab584cf91c07bd4353022c91c.tar.bz2 re3-aac0c3fb679401eab584cf91c07bd4353022c91c.tar.lz re3-aac0c3fb679401eab584cf91c07bd4353022c91c.tar.xz re3-aac0c3fb679401eab584cf91c07bd4353022c91c.tar.zst re3-aac0c3fb679401eab584cf91c07bd4353022c91c.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Game.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 93f0d1b0..1be62611 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -277,12 +277,31 @@ bool CGame::InitialiseOnceAfterRW(void) if ( DMAudio.GetNum3DProvidersAvailable() == 0 ) FrontEndMenuManager.m_nPrefsAudio3DProviderIndex = -1; - if ( FrontEndMenuManager.m_nPrefsAudio3DProviderIndex == -99 || FrontEndMenuManager.m_nPrefsAudio3DProviderIndex == -2 ) - { + if ( FrontEndMenuManager.m_nPrefsAudio3DProviderIndex == -99 || FrontEndMenuManager.m_nPrefsAudio3DProviderIndex == -2 ) { CMenuManager::m_PrefsSpeakers = 0; - int8 provider = DMAudio.AutoDetect3DProviders(); - if ( provider != -1 ) - FrontEndMenuManager.m_nPrefsAudio3DProviderIndex = provider; + int32 i; + for (i = 0; i < DMAudio.GetNum3DProvidersAvailable(); i++) { + wchar buff[64]; + +#ifdef AUDIO_OAL + extern int defaultProvider; + if (defaultProvider >= 0 && defaultProvider < DMAudio.GetNum3DProvidersAvailable()) + break; +#endif + char *name = DMAudio.Get3DProviderName(i); + AsciiToUnicode(name, buff); + char *providername = UnicodeToAscii(buff); + strupr(providername); +#if defined(AUDIO_MSS) + if (strcmp(providername, "MILES FAST 2D POSITIONAL AUDIO") == 0) + break; +#elif defined(AUDIO_OAL) + if (strcmp(providername, "OPENAL SOFT") == 0) + break; +#endif + } + + FrontEndMenuManager.m_nPrefsAudio3DProviderIndex = i; } DMAudio.SetCurrent3DProvider(FrontEndMenuManager.m_nPrefsAudio3DProviderIndex); |