mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-13 07:21:31 +00:00
quakedef.h (quakeparms_t): removed the cachedir member which doesn't serve
any purpose for quite some time. added userdir as a new member, user's directory on UNIX platforms. if user directories are enabled, basedir and userdir will point to different memory locations, otherwise to the same. this member will be enabled/used later. common.c: removed all references to cachedir and com_cachedir which don't serve any purpose for quite some time. main (main): removed assingment to cachedir member. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@96 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
3724ddbb02
commit
14a1493f73
3 changed files with 5 additions and 39 deletions
|
@ -1352,7 +1352,6 @@ typedef struct
|
||||||
|
|
||||||
#define MAX_FILES_IN_PACK 2048
|
#define MAX_FILES_IN_PACK 2048
|
||||||
|
|
||||||
char com_cachedir[MAX_OSPATH];
|
|
||||||
char com_gamedir[MAX_OSPATH];
|
char com_gamedir[MAX_OSPATH];
|
||||||
char com_basedir[MAX_OSPATH];
|
char com_basedir[MAX_OSPATH];
|
||||||
|
|
||||||
|
@ -1479,10 +1478,9 @@ int COM_FindFile (char *filename, int *handle, FILE **file)
|
||||||
{
|
{
|
||||||
searchpath_t *search;
|
searchpath_t *search;
|
||||||
char netpath[MAX_OSPATH];
|
char netpath[MAX_OSPATH];
|
||||||
char cachepath[MAX_OSPATH];
|
|
||||||
pack_t *pak;
|
pack_t *pak;
|
||||||
int i;
|
int i;
|
||||||
int findtime, cachetime;
|
int findtime;
|
||||||
|
|
||||||
if (file && handle)
|
if (file && handle)
|
||||||
Sys_Error ("COM_FindFile: both handle and file set");
|
Sys_Error ("COM_FindFile: both handle and file set");
|
||||||
|
@ -1540,27 +1538,6 @@ int COM_FindFile (char *filename, int *handle, FILE **file)
|
||||||
if (findtime == -1)
|
if (findtime == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// see if the file needs to be updated in the cache
|
|
||||||
if (!com_cachedir[0])
|
|
||||||
strcpy (cachepath, netpath);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#if defined(_WIN32)
|
|
||||||
if ((strlen(netpath) < 2) || (netpath[1] != ':'))
|
|
||||||
sprintf (cachepath,"%s%s", com_cachedir, netpath);
|
|
||||||
else
|
|
||||||
sprintf (cachepath,"%s%s", com_cachedir, netpath+2);
|
|
||||||
#else
|
|
||||||
sprintf (cachepath,"%s%s", com_cachedir, netpath);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cachetime = Sys_FileTime (cachepath);
|
|
||||||
|
|
||||||
if (cachetime < findtime)
|
|
||||||
COM_CopyFile (netpath, cachepath);
|
|
||||||
strcpy (netpath, cachepath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sys_Printf ("FindFile: %s\n",netpath);
|
// Sys_Printf ("FindFile: %s\n",netpath);
|
||||||
com_filesize = Sys_FileOpenRead (netpath, &i);
|
com_filesize = Sys_FileOpenRead (netpath, &i);
|
||||||
if (handle)
|
if (handle)
|
||||||
|
@ -1874,19 +1851,6 @@ void COM_InitFilesystem (void) //johnfitz -- modified based on topaz's tutorial
|
||||||
com_basedir[j-1] = 0;
|
com_basedir[j-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = COM_CheckParm ("-cachedir");
|
|
||||||
if (i && i < com_argc-1)
|
|
||||||
{
|
|
||||||
if (com_argv[i+1][0] == '-')
|
|
||||||
com_cachedir[0] = 0;
|
|
||||||
else
|
|
||||||
strcpy (com_cachedir, com_argv[i+1]);
|
|
||||||
}
|
|
||||||
else if (host_parms.cachedir)
|
|
||||||
strcpy (com_cachedir, host_parms.cachedir);
|
|
||||||
else
|
|
||||||
com_cachedir[0] = 0;
|
|
||||||
|
|
||||||
// start up with GAMENAME by default (id1)
|
// start up with GAMENAME by default (id1)
|
||||||
COM_AddGameDirectory (va("%s/"GAMENAME, com_basedir));
|
COM_AddGameDirectory (va("%s/"GAMENAME, com_basedir));
|
||||||
strcpy (com_gamedir, va("%s/"GAMENAME, com_basedir));
|
strcpy (com_gamedir, va("%s/"GAMENAME, com_basedir));
|
||||||
|
|
|
@ -33,7 +33,6 @@ int main(int argc, char *argv[])
|
||||||
double time, oldtime, newtime;
|
double time, oldtime, newtime;
|
||||||
|
|
||||||
parms.basedir = ".";
|
parms.basedir = ".";
|
||||||
parms.cachedir = NULL;
|
|
||||||
|
|
||||||
parms.argc = argc;
|
parms.argc = argc;
|
||||||
parms.argv = argv;
|
parms.argv = argv;
|
||||||
|
|
|
@ -272,7 +272,10 @@ typedef struct
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *basedir;
|
char *basedir;
|
||||||
char *cachedir; // for development over ISDN lines
|
char *userdir; // user's directory on UNIX platforms.
|
||||||
|
// if user directories are enabled, basedir
|
||||||
|
// and userdir will point to different
|
||||||
|
// memory locations, otherwise to the same.
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
void *membase;
|
void *membase;
|
||||||
|
|
Loading…
Reference in a new issue