delete some unused q3 cmdlib stuff

fix q3data -writedir
This commit is contained in:
Garux 2020-01-24 02:47:33 +03:00
parent 0290bd76fe
commit 416b1f7d54
3 changed files with 3 additions and 136 deletions

View File

@ -80,16 +80,6 @@ void *safe_calloc_info( size_t size, const char* info ){
}
#endif
// set these before calling CheckParm
int myargc;
char **myargv;
char com_token[1024];
bool com_eof;
bool archive;
char archivedir[1024];
/*
===================
@ -335,84 +325,6 @@ int FileTime( const char *path ){
/*
==============
COM_Parse
Parse a token out of a string
==============
*/
char *COM_Parse( char *data ){
int c;
int len;
len = 0;
com_token[0] = 0;
if ( !data ) {
return NULL;
}
// skip whitespace
skipwhite:
while ( ( c = *data ) <= ' ' )
{
if ( c == 0 ) {
com_eof = true;
return NULL; // end of file;
}
data++;
}
// skip // comments
if ( c == '/' && data[1] == '/' ) {
while ( *data && *data != '\n' )
data++;
goto skipwhite;
}
// handle quoted strings specially
if ( c == '\"' ) {
data++;
do
{
c = *data++;
if ( c == '\"' ) {
com_token[len] = 0;
return data;
}
com_token[len] = c;
len++;
} while ( 1 );
}
// parse single characters
if ( c == '{' || c == '}' || c == ')' || c == '(' || c == '\'' || c == ':' ) {
com_token[len] = c;
len++;
com_token[len] = 0;
return data + 1;
}
// parse a regular word
do
{
com_token[len] = c;
data++;
len++;
c = *data;
if ( c == '{' || c == '}' || c == ')' || c == '(' || c == '\'' || c == ':' ) {
break;
}
} while ( c > 32 );
com_token[len] = 0;
return data;
}
//http://stackoverflow.com/questions/27303062/strstr-function-like-that-ignores-upper-or-lower-case
//chux: Somewhat tricky to match the corner cases of strstr() with inputs like "x","", "","x", "",""
char *strIstr( const char* haystack, const char* needle ) {
@ -475,29 +387,6 @@ size_t strncatQ( char* dest, const char* src, const size_t dest_size, const size
*/
/*
=================
CheckParm
Checks for the given parameter in the program's command line arguments
Returns the argument number (1 to argc-1) or 0 if not present
=================
*/
int CheckParm( const char *check ){
int i;
for ( i = 1; i < myargc; i++ )
{
if ( !Q_stricmp( check, myargv[i] ) ) {
return i;
}
}
return 0;
}
/*
================
Q_filelength

View File

@ -73,9 +73,6 @@ void *safe_calloc_info( size_t size, const char* info );
#define safe_calloc_info( size, info ) calloc( 1, size )
#endif /* SAFE_MALLOC */
// set these before calling CheckParm
extern int myargc;
extern char **myargv;
static inline bool strEmpty( const char* string ){
return *string == '\0';
@ -115,7 +112,6 @@ void Q_mkdir( const char *path );
extern char qdir[1024];
extern char gamedir[1024];
extern char writedir[1024];
extern char *moddirparam;
void SetQdirFromPath( const char *path );
char *ExpandArg( const char *path ); // from cmd line
char *ExpandPath( const char *path ); // from scripts
@ -129,7 +125,6 @@ void Error( const char *error, ... )
__attribute__( ( noreturn ) )
#endif
;
int CheckParm( const char *check );
FILE *SafeOpenWrite( const char *filename );
FILE *SafeOpenRead( const char *filename );
@ -178,12 +173,6 @@ float BigFloat( float l );
float LittleFloat( float l );
char *COM_Parse( char *data );
extern char com_token[1024];
extern bool com_eof;
void CRC_Init( unsigned short *crcvalue );
void CRC_ProcessByte( unsigned short *crcvalue, byte data );
unsigned short CRC_Value( unsigned short crcvalue );
@ -191,9 +180,6 @@ unsigned short CRC_Value( unsigned short crcvalue );
void CreatePath( const char *path );
void QCopyFile( const char *from, const char *to );
extern bool archive;
extern char archivedir[1024];
// sleep for the given amount of milliseconds
void Sys_Sleep( int n );

View File

@ -34,8 +34,6 @@ bool g_skipmodel; // set true when a cd is not g_only
// bogus externs for some TA hacks (common/ using them against q3map)
char *moddir = NULL;
// some old defined that was in cmdlib lost during merge
char writedir[1024];
/*
=======================================================
@ -548,7 +546,7 @@ void ParseScript( void ){
==============
*/
int main( int argc, char **argv ){
static int i; // VC4.2 compiler bug if auto...
int i; // VC4.2 compiler bug if auto...
char path[1024];
// using GtkRadiant's versioning next to Id's versioning
@ -559,13 +557,7 @@ int main( int argc, char **argv ){
for ( i = 1 ; i < argc ; i++ )
{
if ( !strcmp( argv[i], "-archive" ) ) {
archive = true;
strcpy( archivedir, argv[i + 1] );
printf( "Archiving source to: %s\n", archivedir );
i++;
}
else if ( !strcmp( argv[i], "-release" ) ) {
if ( !strcmp( argv[i], "-release" ) ) {
g_release = true;
strcpy( g_releasedir, argv[i + 1] );
printf( "Copy output to: %s\n", g_releasedir );
@ -622,7 +614,7 @@ int main( int argc, char **argv ){
}
if ( i == argc ) {
Error( "usage: q3data [-archive <directory>] [-dump <file.md3>] [-release <directory>] [-only <model>] [-3dsconvert <file.3ds>] [-verbose] [file.qdt]" );
Error( "usage: q3data [-dump <file.md3>] [-release <directory>] [-only <model>] [-3dsconvert <file.3ds>] [-verbose] [file.qdt]" );
}
for ( ; i < argc ; i++ )