--- quake2/qcommon/files.c 2018/04/24 17:58:32 1.1 +++ quake2/qcommon/files.c 2018/04/24 18:00:12 1.1.1.3 @@ -21,8 +21,6 @@ QUAKE FILESYSTEM */ -#define BASEDIRNAME "baseq2" - // // in memory // @@ -134,6 +132,46 @@ void FS_FCloseFile (FILE *f) fclose (f); } + +// RAFAEL +/* + Developer_searchpath +*/ +int Developer_searchpath (int who) +{ + + int ch; + // PMM - warning removal +// char *start; + searchpath_t *search; + + if (who == 1) // xatrix + ch = 'x'; + else if (who == 2) + ch = 'r'; + + for (search = fs_searchpaths ; search ; search = search->next) + { + if (strstr (search->filename, "xatrix")) + return 1; + + if (strstr (search->filename, "rogue")) + return 2; +/* + start = strchr (search->filename, ch); + + if (start == NULL) + continue; + + if (strcmp (start ,"xatrix") == 0) + return (1); +*/ + } + return (0); + +} + + /* =========== FS_FOpenFile @@ -144,6 +182,7 @@ Used for streaming data out of either a a seperate file. =========== */ +int file_from_pak = 0; #ifndef NO_ADDONS int FS_FOpenFile (char *filename, FILE **file) { @@ -153,6 +192,8 @@ int FS_FOpenFile (char *filename, FILE * int i; filelink_t *link; + file_from_pak = 0; + // check for links first for (link = fs_links ; link ; link=link->next) { @@ -182,6 +223,7 @@ int FS_FOpenFile (char *filename, FILE * for (i=0 ; inumfiles ; i++) if (!Q_strcasecmp (pak->files[i].name, filename)) { // found it! + file_from_pak = 1; Com_DPrintf ("PackFile: %s : %s\n",pak->filename, filename); // open a new file on the pakfile *file = fopen (pak->filename, "rb"); @@ -225,6 +267,8 @@ int FS_FOpenFile (char *filename, FILE * pack_t *pak; int i; + file_from_pak = 0; + // get config from directory, everything else from pak if (!strcmp(filename, "config.cfg") || !strncmp(filename, "players/", 8)) { @@ -252,6 +296,7 @@ int FS_FOpenFile (char *filename, FILE * for (i=0 ; inumfiles ; i++) if (!Q_strcasecmp (pak->files[i].name, filename)) { // found it! + file_from_pak = 1; Com_DPrintf ("PackFile: %s : %s\n",pak->filename, filename); // open a new file on the pakfile *file = fopen (pak->filename, "rb");