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) ifeq ($(WITH_OPENAL),yes)
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"' release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"'
release/quake2 : LDFLAGS += -lopenal
endif endif
ifeq ($(WITH_ZIP),yes) 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_VERSION: %s\n", qalGetString(AL_VERSION));
Com_Printf("AL_EXTENSIONS: %s\n", qalGetString(AL_EXTENSIONS)); 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"); 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"); Com_Printf("\nCurrent OpenAL device:\n");
@ -344,6 +344,7 @@ QAL_Init()
if (!handle) if (!handle)
{ {
Com_Printf("Loading %s failed! Disabling OpenAL.\n", al_driver->string);
return false; return false;
} }