From 4ee8df8863f767073d778b84a45626fee3ed8949 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Fri, 24 May 2019 14:12:04 -0500 Subject: [PATCH] windows and linux AL_ALEXT_PROTOTYPES blocks, as well as exposed the defining of it cmake side for the adventurous (windows and linux on by default, mac off till we sort why dylibs are freaking out) --- Engine/source/sfx/openal/linux/LoadOAL.linux.cpp | 3 ++- Engine/source/sfx/openal/win32/LoadOAL.cpp | 4 +++- Tools/CMake/torque3d.cmake | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Engine/source/sfx/openal/linux/LoadOAL.linux.cpp b/Engine/source/sfx/openal/linux/LoadOAL.linux.cpp index fbba1c01a..1ad9d5534 100644 --- a/Engine/source/sfx/openal/linux/LoadOAL.linux.cpp +++ b/Engine/source/sfx/openal/linux/LoadOAL.linux.cpp @@ -447,6 +447,7 @@ ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable warn("Failed to retrieve 'alcGetEnumValue' function address\n"); return AL_FALSE; } +#if defined(AL_ALEXT_PROTOTYPES) //efx lpOALFnTable->alGenEffects = (LPALGENEFFECTS)dlsym(openal_library, "alGenEffects"); if (lpOALFnTable->alGenEffects == NULL) @@ -586,7 +587,7 @@ ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable warn("Failed to retrieve 'alSource3i' function address\n"); return AL_FALSE; } - +#endif return AL_TRUE; } diff --git a/Engine/source/sfx/openal/win32/LoadOAL.cpp b/Engine/source/sfx/openal/win32/LoadOAL.cpp index df28cd440..f591c7477 100644 --- a/Engine/source/sfx/openal/win32/LoadOAL.cpp +++ b/Engine/source/sfx/openal/win32/LoadOAL.cpp @@ -439,6 +439,7 @@ ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable OutputDebugStringA("Failed to retrieve 'alcGetEnumValue' function address\n"); return AL_FALSE; } +#if defined(AL_ALEXT_PROTOTYPES) lpOALFnTable->alGenEffects = (LPALGENEFFECTS)GetProcAddress(g_hOpenALDLL, "alGenEffects"); if (lpOALFnTable->alGenEffects == NULL) { @@ -551,6 +552,7 @@ ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable OutputDebugStringA("Failed to retrieve 'alGetAuxiliaryEffectSlotiv' function address\n"); } lpOALFnTable->alSource3i = (LPALSOURCE3I)GetProcAddress(g_hOpenALDLL, "alSource3i"); +#endif return AL_TRUE; } @@ -562,4 +564,4 @@ ALvoid UnloadOAL10Library() FreeLibrary(g_hOpenALDLL); g_hOpenALDLL = NULL; } -} \ No newline at end of file +} diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 7a726ae3d..60ac085e1 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -394,18 +394,26 @@ endif() if(TORQUE_SFX_OPENAL AND NOT TORQUE_DEDICATED) addPath("${srcDir}/sfx/openal") if(WIN32) + option(AL_ALEXT_PROTOTYPES "Use Extended OpenAL options" ON) addPath("${srcDir}/sfx/openal/win32") addInclude("${libDir}/openal-soft/include") endif() if(UNIX AND NOT APPLE) + option(AL_ALEXT_PROTOTYPES "Use Extended OpenAL options" ON) addPath("${srcDir}/sfx/openal/linux") endif() if(APPLE) + option(AL_ALEXT_PROTOTYPES "Use Extended OpenAL options" OFF) addPath("${srcDir}/sfx/openal/mac") addFramework("OpenAL") endif() endif() +mark_as_advanced(AL_ALEXT_PROTOTYPES) +if(AL_ALEXT_PROTOTYPES) + addDef( "AL_ALEXT_PROTOTYPES" ) +endif() + # Vorbis if(TORQUE_SFX_VORBIS) addInclude(${libDir}/libvorbis/include)