mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 00:21:35 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
15177c34f9
4 changed files with 24 additions and 19 deletions
|
@ -217,20 +217,10 @@ endif()
|
||||||
if( NOT NO_OPENAL )
|
if( NOT NO_OPENAL )
|
||||||
find_package( OpenAL )
|
find_package( OpenAL )
|
||||||
mark_as_advanced(CLEAR OPENAL_INCLUDE_DIR)
|
mark_as_advanced(CLEAR OPENAL_INCLUDE_DIR)
|
||||||
if( NOT WIN32 )
|
if( OPENAL_INCLUDE_DIR )
|
||||||
mark_as_advanced(CLEAR OPENAL_LIBRARY)
|
|
||||||
endif()
|
|
||||||
if( OPENAL_FOUND )
|
|
||||||
include_directories( ${OPENAL_INCLUDE_DIR} )
|
include_directories( ${OPENAL_INCLUDE_DIR} )
|
||||||
if( NOT WIN32 )
|
|
||||||
set( ZDOOM_LIBS ${OPENAL_LIBRARY} ${ZDOOM_LIBS} )
|
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
if ( NOT WIN32 )
|
set( NO_OPENAL ON )
|
||||||
set( NO_OPENAL ON )
|
|
||||||
else()
|
|
||||||
include_directories( ${OPENAL_INCLUDE_DIR} )
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -662,7 +662,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Seek
|
{ // Seek
|
||||||
self->angle = self->AngleTo(target);
|
angle = self->AngleTo(target);
|
||||||
newAngle = true;
|
newAngle = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
#ifndef OALDEF_H
|
#ifndef OALDEF_H
|
||||||
#define OALDEF_H
|
#define OALDEF_H
|
||||||
|
|
||||||
#if defined _WIN32 && !defined NO_OPENAL
|
#ifndef NO_OPENAL
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
typedef void* FARPROC;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEFINE_ENTRY(type, name) static type p_##name;
|
#define DEFINE_ENTRY(type, name) static type p_##name;
|
||||||
#include "oaldef.h"
|
#include "oaldef.h"
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define USE_WINDOWS_DWORD
|
#define USE_WINDOWS_DWORD
|
||||||
|
#else
|
||||||
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "except.h"
|
#include "except.h"
|
||||||
|
@ -61,14 +63,23 @@ CVAR (Bool, snd_efx, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static HMODULE hmodOpenAL;
|
static HMODULE hmodOpenAL;
|
||||||
|
#define OPENALLIB "openal32.dll"
|
||||||
|
#else
|
||||||
|
static void* hmodOpenAL;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#define OPENALLIB "OpenAL.framework/OpenAL"
|
||||||
|
#else
|
||||||
|
#define OPENALLIB "libopenal.so"
|
||||||
|
#endif
|
||||||
|
#define LoadLibrary(x) dlopen((x), RTLD_LAZY)
|
||||||
|
#define GetProcAddress(a,b) dlsym((a),(b))
|
||||||
|
#define FreeLibrary(x) dlclose((x))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsOpenALPresent()
|
bool IsOpenALPresent()
|
||||||
{
|
{
|
||||||
#ifdef NO_OPENAL
|
#ifdef NO_OPENAL
|
||||||
return false;
|
return false;
|
||||||
#elif !defined _WIN32
|
|
||||||
return true;
|
|
||||||
#else
|
#else
|
||||||
static bool cached_result = false;
|
static bool cached_result = false;
|
||||||
static bool done = false;
|
static bool done = false;
|
||||||
|
@ -78,10 +89,10 @@ bool IsOpenALPresent()
|
||||||
done = true;
|
done = true;
|
||||||
if (hmodOpenAL == NULL)
|
if (hmodOpenAL == NULL)
|
||||||
{
|
{
|
||||||
hmodOpenAL = LoadLibrary(NicePath("$PROGDIR/openal32.dll"));
|
hmodOpenAL = LoadLibrary(NicePath("$PROGDIR/" OPENALLIB));
|
||||||
if (hmodOpenAL == NULL)
|
if (hmodOpenAL == NULL)
|
||||||
{
|
{
|
||||||
hmodOpenAL = LoadLibrary("openal32.dll");
|
hmodOpenAL = LoadLibrary(OPENALLIB);
|
||||||
if (hmodOpenAL == NULL)
|
if (hmodOpenAL == NULL)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -90,7 +101,7 @@ bool IsOpenALPresent()
|
||||||
for(int i = 0; oalfuncs[i].name != NULL; i++)
|
for(int i = 0; oalfuncs[i].name != NULL; i++)
|
||||||
{
|
{
|
||||||
*oalfuncs[i].funcaddr = GetProcAddress(hmodOpenAL, oalfuncs[i].name);
|
*oalfuncs[i].funcaddr = GetProcAddress(hmodOpenAL, oalfuncs[i].name);
|
||||||
if (oalfuncs[i].funcaddr == NULL)
|
if (*oalfuncs[i].funcaddr == NULL)
|
||||||
{
|
{
|
||||||
FreeLibrary(hmodOpenAL);
|
FreeLibrary(hmodOpenAL);
|
||||||
hmodOpenAL = NULL;
|
hmodOpenAL = NULL;
|
||||||
|
|
Loading…
Reference in a new issue