From fad34584b3019a9c46b4b2255e6428ffc3aa04b3 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Wed, 15 Jun 2011 22:09:26 +0000 Subject: - Small change to search path order - local files not in .pk3s take precedence over files in pk3s. Should make life easier for modders/mappers wanting to override textures that are already contained in some older pk3 - Make VM loading more robust, change loading order: when vm_* == 0 first try loading DLL, then QVM in *each* search directory/path - Fix FS_FileForHandle that would return a FILE pointer to invalid file handle 0 --- src/sys/sys_main.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'src/sys') diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c index 07e8e395..5036009e 100644 --- a/src/sys/sys_main.c +++ b/src/sys/sys_main.c @@ -413,35 +413,23 @@ void Sys_UnloadDll( void *dllHandle ) Sys_LoadDll Used to load a development dll instead of a virtual machine -#1 look in fs_homepath -#2 look in fs_basepath ================= */ -void * QDECL Sys_LoadDll( const char *name, +void *Sys_LoadDll(const char *name, intptr_t (QDECL **entryPoint)(int, ...), - intptr_t (*systemcalls)(intptr_t, ...) ) + intptr_t (*systemcalls)(intptr_t, ...)) { - void *libHandle; - void (*dllEntry)( intptr_t (*syscallptr)(intptr_t, ...) ); - char fname[MAX_OSPATH]; - char *netpath; + void *libHandle; + void (*dllEntry)(intptr_t (*syscallptr)(intptr_t, ...)); - assert( name ); + assert(name); - Com_sprintf(fname, sizeof(fname), "%s" ARCH_STRING DLL_EXT, name); + Com_Printf( "Loading DLL file: %s\n", name); + libHandle = Sys_LoadLibrary(name); - netpath = FS_FindDll(fname); - - if(!netpath) { - Com_Printf( "Sys_LoadDll(%s) could not find it\n", fname ); - return NULL; - } - - Com_Printf( "Loading DLL file: %s\n", netpath); - libHandle = Sys_LoadLibrary(netpath); - - if(!libHandle) { - Com_Printf( "Sys_LoadDll(%s) failed:\n\"%s\"\n", netpath, Sys_LibraryError() ); + if(!libHandle) + { + Com_Printf("Sys_LoadDll(%s) failed:\n\"%s\"\n", name, Sys_LibraryError()); return NULL; } -- cgit