* Merge unified-sdl to trunk

* Bump Q3_VERSION to 1.35
This commit is contained in:
Tim Angus 2007-09-05 18:17:46 +00:00
parent 39abffeb3b
commit 672cfbf16f
188 changed files with 5071 additions and 41739 deletions

View file

@ -29,36 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#if USE_OPENAL_DLOPEN
#if USE_SDL_VIDEO
#include "SDL.h"
#include "SDL_loadso.h"
#define OBJTYPE void *
#define OBJLOAD(x) SDL_LoadObject(x)
#define SYMLOAD(x,y) SDL_LoadFunction(x,y)
#define OBJFREE(x) SDL_UnloadObject(x)
#elif defined _WIN32
#include <windows.h>
#define OBJTYPE HMODULE
#define OBJLOAD(x) LoadLibrary(x)
#define SYMLOAD(x,y) GetProcAddress(x,y)
#define OBJFREE(x) FreeLibrary(x)
#elif defined __linux__ || defined __FreeBSD__ || defined MACOS_X || defined __sun
#include <dlfcn.h>
#define OBJTYPE void *
#define OBJLOAD(x) dlopen(x, RTLD_LAZY | RTLD_GLOBAL)
#define SYMLOAD(x,y) dlsym(x,y)
#define OBJFREE(x) dlclose(x)
#else
#error "Your platform has no lib loading code or it is disabled"
#endif
#if defined __linux__ || defined __FreeBSD__ || defined MACOS_X
#include <unistd.h>
#include <sys/types.h>
#endif
#include "../sys/sys_loadlib.h"
LPALENABLE qalEnable;
LPALDISABLE qalDisable;
@ -131,7 +102,7 @@ LPALCGETENUMVALUE qalcGetEnumValue;
LPALCGETSTRING qalcGetString;
LPALCGETINTEGERV qalcGetIntegerv;
static OBJTYPE OpenALLib = NULL;
static void *OpenALLib = NULL;
static qboolean alinit_fail = qfalse;
@ -144,7 +115,7 @@ static void *GPA(char *str)
{
void *rv;
rv = SYMLOAD(OpenALLib, str);
rv = Sys_LoadFunction(OpenALLib, str);
if(!rv)
{
Com_Printf( " Can't load symbol %s\n", str);
@ -169,17 +140,17 @@ qboolean QAL_Init(const char *libname)
return qtrue;
Com_Printf( "Loading \"%s\"...\n", libname);
if( (OpenALLib = OBJLOAD(libname)) == 0 )
if( (OpenALLib = Sys_LoadLibrary(libname)) == 0 )
{
#ifdef _WIN32
return qfalse;
#else
char fn[1024];
getcwd(fn, sizeof(fn));
Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
strncat(fn, "/", sizeof(fn) - strlen(fn) - 1);
strncat(fn, libname, sizeof(fn) - strlen(fn) - 1);
if( (OpenALLib = OBJLOAD(fn)) == 0 )
if( (OpenALLib = Sys_LoadLibrary(fn)) == 0 )
{
return qfalse;
}
@ -278,7 +249,7 @@ void QAL_Shutdown( void )
{
if(OpenALLib)
{
OBJFREE(OpenALLib);
Sys_UnloadLibrary(OpenALLib);
OpenALLib = NULL;
}