[SCM] Packaging for the OpenArena engine branch, master, updated. debian/0.8.1-7-17-g7521e4f
Simon McVittie
smcv at debian.org
Wed Jul 21 22:46:43 UTC 2010
The following commit has been merged in the master branch:
commit 32fa8bd2d1c8e87cefa204a809b1653e22ad883f
Author: Simon McVittie <smcv at debian.org>
Date: Wed Jul 21 23:41:58 2010 +0100
Search for native code all along the search path
To be able to load the UI when trying to join a server for a mod we don't
have, we need to be able to load ui$ARCH.so from baseoa.
Similarly, we need to be able to load a native module from baseoa if a
mod doesn't have the corresponding QVM file.
diff --git a/debian/patches/0010-FS_FindDll-new-function-to-go-through-the-search-pat.patch b/debian/patches/0010-FS_FindDll-new-function-to-go-through-the-search-pat.patch
new file mode 100644
index 0000000..179d306
--- /dev/null
+++ b/debian/patches/0010-FS_FindDll-new-function-to-go-through-the-search-pat.patch
@@ -0,0 +1,60 @@
+From: Simon McVittie <smcv at debian.org>
+Date: Wed, 21 Jul 2010 23:01:46 +0100
+Subject: [PATCH] FS_FindDll: new function to go through the search path looking for a DLL
+
+---
+ code/qcommon/files.c | 26 ++++++++++++++++++++++++++
+ code/qcommon/qcommon.h | 2 ++
+ 2 files changed, 28 insertions(+), 0 deletions(-)
+
+diff --git a/code/qcommon/files.c b/code/qcommon/files.c
+index b7e4993..70b4816 100644
+--- a/code/qcommon/files.c
++++ b/code/qcommon/files.c
+@@ -1204,6 +1204,32 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF
+ }
+
+
++char *FS_FindDll( const char *filename ) {
++ searchpath_t *search;
++ directory_t *dir;
++
++ if ( !fs_searchpaths ) {
++ Com_Error( ERR_FATAL, "Filesystem call made without initialization\n" );
++ }
++
++ for ( search = fs_searchpaths ; search ; search = search->next ) {
++ if ( search->dir ) {
++ FILE *f;
++ char *netpath;
++
++ dir = search->dir;
++ netpath = FS_BuildOSPath( dir->path, dir->gamedir, filename );
++ f = fopen( netpath, "rb" );
++ if (f) {
++ fclose( f );
++ return netpath;
++ }
++ }
++ }
++
++ return NULL;
++}
++
+ /*
+ =================
+ FS_Read
+diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h
+index 974a547..4c6b75b 100644
+--- a/code/qcommon/qcommon.h
++++ b/code/qcommon/qcommon.h
+@@ -590,6 +590,8 @@ void FS_FreeFileList( char **list );
+
+ qboolean FS_FileExists( const char *file );
+
++char *FS_FindDll( const char *filename );
++
+ char *FS_BuildOSPath( const char *base, const char *game, const char *qpath );
+
+ int FS_LoadStack( void );
+--
diff --git a/debian/patches/0011-Sys_LoadDll-use-FS_FindDll.patch b/debian/patches/0011-Sys_LoadDll-use-FS_FindDll.patch
new file mode 100644
index 0000000..01dbfaf
--- /dev/null
+++ b/debian/patches/0011-Sys_LoadDll-use-FS_FindDll.patch
@@ -0,0 +1,89 @@
+From: Simon McVittie <smcv at debian.org>
+Date: Wed, 21 Jul 2010 19:46:38 +0100
+Subject: [PATCH] Sys_LoadDll: use FS_FindDll
+
+---
+ code/sys/sys_main.c | 53 ++++++++------------------------------------------
+ 1 files changed, 9 insertions(+), 44 deletions(-)
+
+diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c
+index be9e2f0..c43859d 100644
+--- a/code/sys/sys_main.c
++++ b/code/sys/sys_main.c
+@@ -350,34 +350,6 @@ void Sys_UnloadDll( void *dllHandle )
+
+ /*
+ =================
+-Sys_TryLibraryLoad
+-=================
+-*/
+-static void* Sys_TryLibraryLoad(const char* base, const char* gamedir, const char* fname, char* fqpath )
+-{
+- void* libHandle;
+- char* fn;
+-
+- *fqpath = 0;
+-
+- fn = FS_BuildOSPath( base, gamedir, fname );
+- Com_Printf( "Sys_LoadDll(%s)... \n", fn );
+-
+- libHandle = Sys_LoadLibrary(fn);
+-
+- if(!libHandle) {
+- Com_Printf( "Sys_LoadDll(%s) failed:\n\"%s\"\n", fn, Sys_LibraryError() );
+- return NULL;
+- }
+-
+- Com_Printf ( "Sys_LoadDll(%s): succeeded ...\n", fn );
+- Q_strncpyz ( fqpath , fn , MAX_QPATH ) ;
+-
+- return libHandle;
+-}
+-
+-/*
+-=================
+ Sys_LoadDll
+
+ Used to load a development dll instead of a virtual machine
+@@ -393,31 +365,24 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
+ void *libHandle;
+ void (*dllEntry)( intptr_t (*syscallptr)(intptr_t, ...) );
+ char fname[MAX_OSPATH];
+- char *basepath;
+- char *homepath;
+- char *pwdpath;
+- char *gamedir;
++ char *netpath;
+
+ assert( name );
+
+ Q_snprintf (fname, sizeof(fname), "%s" ARCH_STRING DLL_EXT, name);
+
+- // TODO: use fs_searchpaths from files.c
+- pwdpath = Sys_Cwd();
+- basepath = Cvar_VariableString( "fs_basepath" );
+- homepath = Cvar_VariableString( "fs_homepath" );
+- gamedir = Cvar_VariableString( "fs_game" );
+-
+- libHandle = Sys_TryLibraryLoad(pwdpath, gamedir, fname, fqpath);
++ netpath = FS_FindDll(fname);
+
+- if(!libHandle && homepath)
+- libHandle = Sys_TryLibraryLoad(homepath, gamedir, fname, fqpath);
++ if(!netpath) {
++ Com_Printf( "Sys_LoadDll(%s) could not find %s\n", fname );
++ return NULL;
++ }
+
+- if(!libHandle && basepath)
+- libHandle = Sys_TryLibraryLoad(basepath, gamedir, fname, fqpath);
++ Com_Printf( "Loading DLL file: %s\n", netpath);
++ libHandle = Sys_LoadLibrary(netpath);
+
+ if(!libHandle) {
+- Com_Printf ( "Sys_LoadDll(%s) failed to load library\n", name );
++ Com_Printf( "Sys_LoadDll(%s) failed:\n\"%s\"\n", netpath, Sys_LibraryError() );
+ return NULL;
+ }
+
+--
diff --git a/debian/patches/series b/debian/patches/series
index ab921e3..86b1724 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,5 @@
0007-Use-memmove-instead-of-strcpy-for-overlapping-memory.patch
0008-Fix-spelling-error.patch
0009-Add-a-special-vmMagic-that-causes-equivalent-native-.patch
+0010-FS_FindDll-new-function-to-go-through-the-search-pat.patch
+0011-Sys_LoadDll-use-FS_FindDll.patch
--
Packaging for the OpenArena engine
More information about the Pkg-games-commits
mailing list