mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 06:51:47 +00:00
search for .gz first
This commit is contained in:
parent
942b3c2744
commit
93febb90c9
1 changed files with 24 additions and 13 deletions
|
@ -428,12 +428,15 @@ _COM_FOpenFile (const char *filename, VFile **gzfile, char *foundname, int zip)
|
||||||
if (search->pack) {
|
if (search->pack) {
|
||||||
packfile_t *packfile;
|
packfile_t *packfile;
|
||||||
|
|
||||||
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
|
||||||
filename);
|
|
||||||
#ifdef HAVE_ZLIB
|
#ifdef HAVE_ZLIB
|
||||||
if (!packfile)
|
|
||||||
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
||||||
gzfilename);
|
gzfilename);
|
||||||
|
if (!packfile)
|
||||||
|
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
||||||
|
filename);
|
||||||
|
#else
|
||||||
|
packfile = (packfile_t *) Hash_Find (search->pack->file_hash,
|
||||||
|
filename);
|
||||||
#endif
|
#endif
|
||||||
if (packfile) {
|
if (packfile) {
|
||||||
Sys_DPrintf ("PackFile: %s : %s\n", search->pack->filename,
|
Sys_DPrintf ("PackFile: %s : %s\n", search->pack->filename,
|
||||||
|
@ -448,22 +451,30 @@ _COM_FOpenFile (const char *filename, VFile **gzfile, char *foundname, int zip)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// check a file in the directory tree
|
// check a file in the directory tree
|
||||||
|
#ifdef HAVE_ZLIB
|
||||||
|
snprintf (netpath, sizeof (netpath), "%s%s%s", search->filename,
|
||||||
|
search->filename[0] ? "/" : "", gzfilename);
|
||||||
|
|
||||||
|
strncpy (foundname, gzfilename, MAX_OSPATH);
|
||||||
|
findtime = Sys_FileTime (netpath);
|
||||||
|
if (findtime == -1) {
|
||||||
|
strncpy (foundname, filename, MAX_OSPATH);
|
||||||
|
snprintf (netpath, sizeof (netpath), "%s%s%s",
|
||||||
|
search->filename,
|
||||||
|
search->filename[0] ? "/" : "", filename);
|
||||||
|
findtime = Sys_FileTime (netpath);
|
||||||
|
if (findtime == -1)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#else
|
||||||
snprintf (netpath, sizeof (netpath), "%s%s%s", search->filename,
|
snprintf (netpath, sizeof (netpath), "%s%s%s", search->filename,
|
||||||
search->filename[0] ? "/" : "", filename);
|
search->filename[0] ? "/" : "", filename);
|
||||||
|
|
||||||
strncpy (foundname, filename, MAX_OSPATH);
|
strncpy (foundname, filename, MAX_OSPATH);
|
||||||
findtime = Sys_FileTime (netpath);
|
findtime = Sys_FileTime (netpath);
|
||||||
if (findtime == -1) {
|
|
||||||
#ifdef HAVE_ZLIB
|
|
||||||
strncpy (foundname, gzfilename, MAX_OSPATH);
|
|
||||||
snprintf (netpath, sizeof (netpath), "%s%s%s",
|
|
||||||
search->filename,
|
|
||||||
search->filename[0] ? "/" : "", gzfilename);
|
|
||||||
findtime = Sys_FileTime (netpath);
|
|
||||||
if (findtime == -1)
|
if (findtime == -1)
|
||||||
#endif
|
|
||||||
continue;
|
continue;
|
||||||
}
|
#endif
|
||||||
|
|
||||||
Sys_DPrintf ("FindFile: %s\n", netpath);
|
Sys_DPrintf ("FindFile: %s\n", netpath);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue