From bda100914d3873094bdf281fac067218ac351d63 Mon Sep 17 00:00:00 2001 From: Brian Roberts Date: Tue, 21 May 2019 21:31:30 -0500 Subject: [PATCH] (partial) mac compilation correction - 1) correct cmake to look to the included openal-soft, not the system framework. 2) (incorrect) stubb-ins for library to function table binds --- Engine/source/sfx/openal/LoadOAL.h | 7 +- Engine/source/sfx/openal/mac/LoadOAL.mac.cpp | 141 ++++++++++++++++++- Tools/CMake/torque3d.cmake | 16 +-- 3 files changed, 153 insertions(+), 11 deletions(-) diff --git a/Engine/source/sfx/openal/LoadOAL.h b/Engine/source/sfx/openal/LoadOAL.h index 4b779865b..de9f781bd 100644 --- a/Engine/source/sfx/openal/LoadOAL.h +++ b/Engine/source/sfx/openal/LoadOAL.h @@ -28,8 +28,11 @@ #endif #if defined(TORQUE_OS_MAC) -# include -# include +# include +# include +# include +# include +# include #elif defined(TORQUE_OS_LINUX) # include # include diff --git a/Engine/source/sfx/openal/mac/LoadOAL.mac.cpp b/Engine/source/sfx/openal/mac/LoadOAL.mac.cpp index 65852d2ed..64800e400 100644 --- a/Engine/source/sfx/openal/mac/LoadOAL.mac.cpp +++ b/Engine/source/sfx/openal/mac/LoadOAL.mac.cpp @@ -435,6 +435,145 @@ ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable return AL_FALSE; } + //efx + lpOALFnTable->alGenEffects = (LPALGENEFFECTS)dlsym(openal_library, "alGenEffects"); + if (lpOALFnTable->alGenEffects == NULL) + { + warn("Failed to retrieve 'alGenEffects' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alEffecti = (LPALEFFECTI)dlsym(openal_library, "alEffecti"); + if (lpOALFnTable->alEffecti == NULL) + { + warn("Failed to retrieve 'alEffecti' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alEffectiv = (LPALEFFECTIV)dlsym(openal_library, "alEffectiv"); + if (lpOALFnTable->alEffectiv == NULL) + { + warn("Failed to retrieve 'alEffectiv' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alEffectf = (LPALEFFECTF)dlsym(openal_library, "alEffectf"); + if (lpOALFnTable->alEffectf == NULL) + { + warn("Failed to retrieve 'alEffectf' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alEffectfv = (LPALEFFECTFV)dlsym(openal_library, "alEffectfv"); + if (lpOALFnTable->alEffectfv == NULL) + { + warn("Failed to retrieve 'alEffectfv' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGetEffecti = (LPALGETEFFECTI)dlsym(openal_library, "alGetEffecti"); + if (lpOALFnTable->alGetEffecti == NULL) + { + warn("Failed to retrieve 'alGetEffecti' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGetEffectiv = (LPALGETEFFECTIV)dlsym(openal_library, "alGetEffectiv"); + if (lpOALFnTable->alGetEffectiv == NULL) + { + warn("Failed to retrieve 'alGetEffectiv' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGetEffectf = (LPALGETEFFECTF)dlsym(openal_library, "alGetEffectf"); + if (lpOALFnTable->alGetEffectf == NULL) + { + warn("Failed to retrieve 'alGetEffectf' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGetEffectfv = (LPALGETEFFECTFV)dlsym(openal_library, "alGetEffectfv"); + if (lpOALFnTable->alGetEffectfv == NULL) + { + warn("Failed to retrieve 'alGetEffectfv' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alDeleteEffects = (LPALDELETEEFFECTS)dlsym(openal_library, "alDeleteEffects"); + if (lpOALFnTable->alDeleteEffects == NULL) + { + warn("Failed to retrieve 'alDeleteEffects' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alIsEffect = (LPALISEFFECT)dlsym(openal_library, "alIsEffect"); + if (lpOALFnTable->alIsEffect == NULL) + { + warn("Failed to retrieve 'alIsEffect' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alAuxiliaryEffectSlotf = (LPALAUXILIARYEFFECTSLOTF)dlsym(openal_library, "alAuxiliaryEffectSlotf"); + if (lpOALFnTable->alAuxiliaryEffectSlotf == NULL) + { + warn("Failed to retrieve 'alAuxiliaryEffectSlotf' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alAuxiliaryEffectSlotfv = (LPALAUXILIARYEFFECTSLOTFV)dlsym(openal_library, "alAuxiliaryEffectSlotfv"); + if (lpOALFnTable->alAuxiliaryEffectSlotfv == NULL) + { + warn("Failed to retrieve 'alAuxiliaryEffectSlotfv' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alAuxiliaryEffectSloti = (LPALAUXILIARYEFFECTSLOTI)dlsym(openal_library, "alAuxiliaryEffectSloti"); + if (lpOALFnTable->alAuxiliaryEffectSloti == NULL) + { + warn("Failed to retrieve 'alAuxiliaryEffectSloti' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alAuxiliaryEffectSlotiv = (LPALAUXILIARYEFFECTSLOTIV)dlsym(openal_library, "alAuxiliaryEffectSlotiv"); + if (lpOALFnTable->alAuxiliaryEffectSlotiv == NULL) + { + warn("Failed to retrieve 'alAuxiliaryEffectSlotiv' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alIsAuxiliaryEffectSlot = (LPALISAUXILIARYEFFECTSLOT)dlsym(openal_library, "alIsAuxiliaryEffectSlot"); + if (lpOALFnTable->alIsAuxiliaryEffectSlot == NULL) + { + warn("Failed to retrieve 'alIsAuxiliaryEffectSlot' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGenAuxiliaryEffectSlots = (LPALGENAUXILIARYEFFECTSLOTS)dlsym(openal_library, "alGenAuxiliaryEffectSlots"); + if (lpOALFnTable->alGenAuxiliaryEffectSlots == NULL) + { + warn("Failed to retrieve 'alGenAuxiliaryEffectSlots' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alDeleteAuxiliaryEffectSlots = (LPALDELETEAUXILIARYEFFECTSLOTS)dlsym(openal_library, "alDeleteAuxiliaryEffectSlots"); + if (lpOALFnTable->alDeleteAuxiliaryEffectSlots == NULL) + { + warn("Failed to retrieve 'alDeleteAuxiliaryEffectSlots' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGetAuxiliaryEffectSlotf = (LPALGETAUXILIARYEFFECTSLOTF)dlsym(openal_library, "alGetAuxiliaryEffectSlotf"); + if (lpOALFnTable->alGetAuxiliaryEffectSlotf == NULL) + { + warn("Failed to retrieve 'alGetAuxiliaryEffectSlotf' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGetAuxiliaryEffectSlotfv = (LPALGETAUXILIARYEFFECTSLOTFV)dlsym(openal_library, "alGetAuxiliaryEffectSlotfv"); + if (lpOALFnTable->alGetAuxiliaryEffectSlotfv == NULL) + { + warn("Failed to retrieve 'alGetAuxiliaryEffectSlotfv' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGetAuxiliaryEffectSloti = (LPALGETAUXILIARYEFFECTSLOTI)dlsym(openal_library, "alGetAuxiliaryEffectSloti"); + if (lpOALFnTable->alGetAuxiliaryEffectSloti == NULL) + { + warn("Failed to retrieve 'alGetAuxiliaryEffectSloti' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alGetAuxiliaryEffectSlotiv = (LPALGETAUXILIARYEFFECTSLOTIV)dlsym(openal_library, "alGetAuxiliaryEffectSlotiv"); + if (lpOALFnTable->alGetAuxiliaryEffectSlotiv == NULL) + { + warn("Failed to retrieve 'alGetAuxiliaryEffectSlotiv' function address\n"); + return AL_FALSE; + } + lpOALFnTable->alSource3i = (LPALSOURCE3I)dlsym(openal_library, "alSource3i"); + if (lpOALFnTable->alSource3i == NULL) + { + warn("Failed to retrieve 'alSource3i' function address\n"); + return AL_FALSE; + } return AL_TRUE; } @@ -442,4 +581,4 @@ ALboolean LoadOAL10Library(char *szOALFullPathName, LPOPENALFNTABLE lpOALFnTable ALvoid UnloadOAL10Library() { // TODO: Implement this. -} \ No newline at end of file +} diff --git a/Tools/CMake/torque3d.cmake b/Tools/CMake/torque3d.cmake index 0af729549..0f20c9a08 100644 --- a/Tools/CMake/torque3d.cmake +++ b/Tools/CMake/torque3d.cmake @@ -392,15 +392,15 @@ endif() if(TORQUE_SFX_OPENAL AND NOT TORQUE_DEDICATED) addPath("${srcDir}/sfx/openal") if(WIN32) - addPath("${srcDir}/sfx/openal/win32") - addInclude("${libDir}/openal-soft/include") + addPath("${srcDir}/sfx/openal/win32") + addInclude("${libDir}/openal-soft/include") endif() - if(UNIX AND NOT APPLE) - addPath("${srcDir}/sfx/openal/linux") - endif() - if(APPLE) - addPath("${srcDir}/sfx/openal/mac") - addFramework("OpenAL") + if(UNIX AND NOT APPLE) + addPath("${srcDir}/sfx/openal/linux") + endif() + if(APPLE) + addPath("${srcDir}/sfx/openal/mac") + addInclude("${libDir}/openal-soft/include") endif() endif()