summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-06-15 22:09:26 +0000
committerTim Angus <tim@ngus.net>2013-01-10 21:28:20 +0000
commitfad34584b3019a9c46b4b2255e6428ffc3aa04b3 (patch)
tree6b68be8be7b66c6671cbba3928145794b420c7e8 /src/sys
parent7de3b3918c13d34da9a8a468ee7bbe4c70504e87 (diff)
- 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
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/sys_main.c32
1 files changed, 10 insertions, 22 deletions
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;
}