mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-23 04:11:53 +00:00
Added some new file finding console commands.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@707 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
a9f3e56240
commit
bd3c4d6b1e
1 changed files with 51 additions and 2 deletions
|
@ -78,6 +78,8 @@ qboolean msg_suppress_1 = 0;
|
|||
|
||||
void COM_InitFilesystem (void);
|
||||
void COM_Path_f (void);
|
||||
void COM_Dir_f (void);
|
||||
void COM_Locate_f (void);
|
||||
|
||||
|
||||
// if a packfile directory differs from this, it is assumed to be hacked
|
||||
|
@ -912,7 +914,6 @@ static int MSG_ReadHuffBits(sizebuf_t *msg, int bits)
|
|||
|
||||
int MSG_ReadBits(int bits)
|
||||
{
|
||||
int i, val;
|
||||
int bitmask = 0;
|
||||
qboolean extend = false;
|
||||
|
||||
|
@ -2136,7 +2137,9 @@ void COM_Init (void)
|
|||
LittleFloat = FloatSwap;
|
||||
}
|
||||
|
||||
Cmd_AddCommand ("path", COM_Path_f);
|
||||
Cmd_AddCommand ("path", COM_Path_f); //prints a list of current search paths.
|
||||
Cmd_AddCommand ("dir", COM_Dir_f); //q3 like
|
||||
Cmd_AddCommand ("flocate", COM_Locate_f); //prints the pak or whatever where this file can be found.
|
||||
|
||||
COM_InitFilesystem ();
|
||||
|
||||
|
@ -2383,6 +2386,52 @@ void COM_Path_f (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
COM_Dir_f
|
||||
|
||||
============
|
||||
*/
|
||||
static int COM_Dir_List(char *name, int size, void *parm)
|
||||
{
|
||||
Con_Printf("%s (%i)\n", name, size);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void COM_Dir_f (void)
|
||||
{
|
||||
char match[MAX_QPATH];
|
||||
|
||||
Q_strncpyz(match, Cmd_Argv(1), sizeof(match));
|
||||
if (Cmd_Argc()>2)
|
||||
{
|
||||
strncat(match, "/*.", sizeof(match)-1);
|
||||
match[sizeof(match)-1] = '\0';
|
||||
strncat(match, Cmd_Argv(2), sizeof(match)-1);
|
||||
match[sizeof(match)-1] = '\0';
|
||||
}
|
||||
else
|
||||
strncat(match, "/*", sizeof(match)-1);
|
||||
|
||||
COM_EnumerateFiles(match, COM_Dir_List, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
COM_Locate_f
|
||||
|
||||
============
|
||||
*/
|
||||
void COM_Locate_f (void)
|
||||
{
|
||||
flocation_t loc;
|
||||
if (FS_FLocateFile(Cmd_Argv(1), FSLFRT_LENGTH, &loc))
|
||||
Con_Printf("Inside %s\n", loc.rawname);
|
||||
else
|
||||
Con_Printf("Not found\n");
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
COM_WriteFile
|
||||
|
|
Loading…
Reference in a new issue