minor tweaks

This commit is contained in:
Garux 2020-01-24 02:47:33 +03:00
parent 854eb14a69
commit 09953b82be
4 changed files with 10 additions and 16 deletions

View File

@ -31,7 +31,7 @@
#include "ident.h" #include "ident.h"
#include "md3normals.h" #include "md3normals.h"
// the maximum size of game reletive pathnames // the maximum size of game relative pathnames
#define MAX_QPATH 64 #define MAX_QPATH 64
/* /*

View File

@ -113,7 +113,7 @@ void ExpandWildcards( int *argc, char ***argv ){
int handle; int handle;
int i; int i;
char filename[1024]; char filename[1024];
char filebase[1024]; char filepath[1024];
char *path; char *path;
ex_argc = 0; ex_argc = 0;
@ -131,11 +131,11 @@ void ExpandWildcards( int *argc, char ***argv ){
return; return;
} }
ExtractFilePath( path, filebase ); ExtractFilePath( path, filepath );
do do
{ {
sprintf( filename, "%s%s", filebase, fileinfo.name ); sprintf( filename, "%s%s", filepath, fileinfo.name );
ex_argv[ex_argc++] = copystring( filename ); ex_argv[ex_argc++] = copystring( filename );
} while ( _findnext( handle, &fileinfo ) != -1 ); } while ( _findnext( handle, &fileinfo ) != -1 );
@ -751,14 +751,11 @@ void DefaultExtension( char *path, const char *extension ){
void DefaultPath( char *path, const char *basepath ){ void DefaultPath( char *path, const char *basepath ){
char temp[128]; if( !path_is_absolute( path ) ){
char* temp = strdup( path );
if ( path[ 0 ] == '/' || path[ 0 ] == '\\' ) { sprintf( path, "%s%s", basepath, temp );
return; // absolute path location free( temp );
} }
strcpy( temp,path );
strcpy( path,basepath );
strcat( path,temp );
} }

View File

@ -69,7 +69,7 @@ packheader_t pakheader;
============== ==============
ReleaseFile ReleaseFile
Filename should be gamedir reletive. Filename should be gamedir relative.
Either copies the file to the release dir, or adds it to Either copies the file to the release dir, or adds it to
the pak file. the pak file.
============== ==============

View File

@ -1010,7 +1010,7 @@ int ConvertBSPToMap_Ext( char *bspName, qboolean brushPrimitives ){
entity_t *e; entity_t *e;
vec3_t origin; vec3_t origin;
const char *value; const char *value;
char name[ 1024 ], base[ 1024 ]; char name[ 1024 ];
/* note it */ /* note it */
@ -1022,9 +1022,6 @@ int ConvertBSPToMap_Ext( char *bspName, qboolean brushPrimitives ){
strcat( name, "_converted.map" ); strcat( name, "_converted.map" );
Sys_Printf( "writing %s\n", name ); Sys_Printf( "writing %s\n", name );
ExtractFileBase( bspName, base );
strcat( base, ".bsp" );
/* open it */ /* open it */
f = fopen( name, "wb" ); f = fopen( name, "wb" );
if ( f == NULL ) { if ( f == NULL ) {