Remove need to link against libopenal

libopenal is loaded with dlopen() and for all used alBla and alcBla functions
there are function pointers (just like thee qgl stuff for OpenGL).
Thus there's no need to link against libopenal on compile-time.

There were a few occurences of "normal" openal functions (al* instead of qal*)
- they are fixed now.

This allows to use a yquake2 version compield with WITH_OPENAL=yes to be used
on systems that have no libopenal installed (the standard SDL sound backend
will be used then).
This commit is contained in:
Daniel Gibson 2012-04-29 15:24:14 +02:00
parent 4520d53b26
commit ebccfc63df
2 changed files with 12 additions and 12 deletions

View file

@ -188,7 +188,6 @@ endif
ifeq ($(WITH_OPENAL),yes)
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"'
release/quake2 : LDFLAGS += -lopenal
endif
ifeq ($(WITH_ZIP),yes)

View file

@ -159,9 +159,9 @@ void QAL_SoundInfo()
Com_Printf("AL_VERSION: %s\n", qalGetString(AL_VERSION));
Com_Printf("AL_EXTENSIONS: %s\n", qalGetString(AL_EXTENSIONS));
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
if (qalcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
{
const char *devs = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
const char *devs = qalcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
Com_Printf("\nAvailable OpenAL devices:\n");
@ -181,9 +181,9 @@ void QAL_SoundInfo()
}
}
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
if (qalcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
{
const char *devs = alcGetString(device, ALC_DEVICE_SPECIFIER);
const char *devs = qalcGetString(device, ALC_DEVICE_SPECIFIER);
Com_Printf("\nCurrent OpenAL device:\n");
@ -334,18 +334,19 @@ qboolean
QAL_Init()
{
/* DEFAULT_OPENAL_DRIVER is defined at compile time via the compiler */
al_driver = Cvar_Get( "al_driver", DEFAULT_OPENAL_DRIVER, CVAR_ARCHIVE );
al_device = Cvar_Get( "al_device", "", CVAR_ARCHIVE );
al_driver = Cvar_Get( "al_driver", DEFAULT_OPENAL_DRIVER, CVAR_ARCHIVE );
al_device = Cvar_Get( "al_device", "", CVAR_ARCHIVE );
Com_Printf("LoadLibrary(%s)\n", al_driver->string);
/* Load the library */
handle = dlopen( al_driver->string, RTLD_LAZY );
handle = dlopen( al_driver->string, RTLD_LAZY );
if (!handle)
{
return false;
}
if (!handle)
{
Com_Printf("Loading %s failed! Disabling OpenAL.\n", al_driver->string);
return false;
}
/* Connect function pointers to management functions */
qalcCreateContext = dlsym(handle, "alcCreateContext");