diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 47351a1f7..6b5f66a3e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -865,12 +865,6 @@ set( NOT_COMPILED_SOURCE_FILES ) set( FASTMATH_SOURCES - nodebuild.cpp - nodebuild_classify_nosse2.cpp - nodebuild_events.cpp - nodebuild_extract.cpp - nodebuild_gl.cpp - nodebuild_utility.cpp r_swrenderer.cpp r_3dfloors.cpp r_bsp.cpp @@ -1026,6 +1020,12 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE memarena.cpp md5.cpp name.cpp + nodebuild.cpp + nodebuild_classify_nosse2.cpp + nodebuild_events.cpp + nodebuild_extract.cpp + nodebuild_gl.cpp + nodebuild_utility.cpp pathexpander.cpp p_3dfloors.cpp p_3dmidtex.cpp diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 768e7b7ba..f35cc8c3e 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -781,7 +781,20 @@ OpenALSoundRenderer::OpenALSoundRenderer() alcGetIntegerv(Device, ALC_MONO_SOURCES, 1, &numMono); alcGetIntegerv(Device, ALC_STEREO_SOURCES, 1, &numStereo); - Sources.Resize(MIN(MAX(*snd_channels, 2), numMono+numStereo)); + // OpenAL specification doesn't require alcGetIntegerv() to return + // meaningful values for ALC_MONO_SOURCES and ALC_MONO_SOURCES. + // At least Apple's OpenAL implementation returns zeroes, + // although it can generate reasonable number of sources. + + const int numChannels = MAX(*snd_channels, 2); + int numSources = numMono + numStereo; + + if (0 == numSources) + { + numSources = numChannels; + } + + Sources.Resize(MIN(numChannels, numSources)); for(unsigned i = 0;i < Sources.Size();i++) { alGenSources(1, &Sources[i]);