Patch by Simon McVittie to improve dynamic library loading (#4700)

This commit is contained in:
Thilo Schulz 2011-02-04 17:47:57 +00:00
parent d2f8b9f4bb
commit 7bb5906599
3 changed files with 38 additions and 39 deletions

View file

@ -1220,6 +1220,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