mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-21 19:51:33 +00:00
Look in current dir for game library
This commit is contained in:
parent
d28bd8aa9c
commit
572ae3f340
3 changed files with 27 additions and 0 deletions
|
@ -646,7 +646,10 @@ void *Sys_LoadGameDll( const char *name, GetModuleAPIProc **moduleAPI )
|
|||
char *apppath = Cvar_VariableString( "fs_apppath" );
|
||||
#endif
|
||||
|
||||
const char* current_dir = Sys_CurrentDirname();
|
||||
|
||||
const char *searchPaths[] = {
|
||||
current_dir,
|
||||
homepath,
|
||||
#ifdef MACOS_X
|
||||
apppath,
|
||||
|
|
|
@ -143,6 +143,7 @@ char *Sys_DefaultAppPath(void);
|
|||
char *Sys_DefaultHomePath(void);
|
||||
const char *Sys_Dirname( char *path );
|
||||
const char *Sys_Basename( char *path );
|
||||
const char * Sys_CurrentDirname();
|
||||
|
||||
bool Sys_PathCmp( const char *path1, const char *path2 );
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|||
#include <io.h>
|
||||
#include <shlobj.h>
|
||||
#include <windows.h>
|
||||
#include <winbase.h>
|
||||
|
||||
#define MEM_THRESHOLD (128*1024*1024)
|
||||
|
||||
|
@ -84,6 +85,28 @@ const char *Sys_Dirname( char *path )
|
|||
return dir;
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
Sys_Dirname
|
||||
==============
|
||||
*/
|
||||
const char *Sys_CurrentDirname( )
|
||||
{
|
||||
static char dir[ MAX_OSPATH ] = { 0 };
|
||||
|
||||
GetCurrentDirectory(
|
||||
MAX_OSPATH,
|
||||
dir
|
||||
);
|
||||
|
||||
while( length > 0 && dir[ length ] != '\\' )
|
||||
length--;
|
||||
|
||||
dir[ length ] = '\0';
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Sys_Milliseconds
|
||||
|
|
Loading…
Reference in a new issue