mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-10 06:31:56 +00:00
add support for gziped maps (*.bsp.gz) and pak files in general to COM_MapList_f
This commit is contained in:
parent
4c7ce6d614
commit
4d1176e8c5
1 changed files with 21 additions and 15 deletions
|
@ -199,25 +199,31 @@ void COM_Maplist_f (void)
|
||||||
struct dirent *dirent;
|
struct dirent *dirent;
|
||||||
char buf[MAX_OSPATH];
|
char buf[MAX_OSPATH];
|
||||||
|
|
||||||
for (search = com_searchpaths ; search ; search = search->next)
|
for (search = com_searchpaths ; search ; search = search->next) {
|
||||||
{
|
if (search->pack) {
|
||||||
if (!Q_strcmp (search->filename, ""))
|
int i;
|
||||||
continue;
|
pack_t *pak = search->pack;
|
||||||
|
Con_Printf ("Looking in %s...\n",search->filename);
|
||||||
|
for (i=0 ; i<pak->numfiles ; i++) {
|
||||||
|
char *name=pak->files[i].name;
|
||||||
|
if (!fnmatch ("maps/*.bsp", name, FNM_PATHNAME)
|
||||||
|
|| !fnmatch ("maps/*.bsp.gz", name, FNM_PATHNAME))
|
||||||
|
Con_Printf ("%s\n", name+5);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
snprintf (buf, sizeof(buf), "%s/maps", search->filename);
|
snprintf (buf, sizeof(buf), "%s/maps", search->filename);
|
||||||
dir_ptr = opendir(buf);
|
dir_ptr = opendir(buf);
|
||||||
Con_Printf ("Looking in %s...\n",buf);
|
Con_Printf ("Looking in %s...\n",buf);
|
||||||
if (!dir_ptr)
|
if (!dir_ptr)
|
||||||
continue;
|
continue;
|
||||||
while ((dirent = readdir (dir_ptr)))
|
while ((dirent = readdir (dir_ptr)))
|
||||||
{
|
if (!fnmatch ("*.bsp", dirent->d_name, 0)
|
||||||
if (!fnmatch ("*.bsp", dirent->d_name, 0))
|
|| !fnmatch ("*.bsp.gz", dirent->d_name, 0))
|
||||||
{
|
|
||||||
Con_Printf ("%s\n", dirent->d_name);
|
Con_Printf ("%s\n", dirent->d_name);
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir (dir_ptr);
|
closedir (dir_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
|
|
Loading…
Reference in a new issue