qboolean EndOfScript( qboolean crossline ){
if ( !crossline ) {
- Error( "Line %i is incomplete\n",scriptline );
+ Error( "Line %i is incomplete\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
if ( !strcmp( script->filename, "memory buffer" ) ) {
}
if ( *script->script_p++ == '\n' ) {
if ( !crossline ) {
- Error( "Line %i is incomplete\n",scriptline );
+ Error( "Line %i is incomplete\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
script->line++;
scriptline = script->line;
if ( *script->script_p == ';' || *script->script_p == '#'
|| ( script->script_p[0] == '/' && script->script_p[1] == '/' ) ) {
if ( !crossline ) {
- Error( "Line %i is incomplete\n",scriptline );
+ Error( "Line %i is incomplete\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
while ( *script->script_p++ != '\n' )
if ( script->script_p >= script->end_p ) {
// /* */ comments
if ( script->script_p[0] == '/' && script->script_p[1] == '*' ) {
if ( !crossline ) {
- Error( "Line %i is incomplete\n",scriptline );
+ Error( "Line %i is incomplete\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
script->script_p += 2;
while ( script->script_p[0] != '*' && script->script_p[1] != '/' )
break;
}
if ( token_p == &token[MAXTOKEN] ) {
- Error( "Token too large on line %i\n",scriptline );
+ Error( "Token too large on line %i\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
}
script->script_p++;
break;
}
if ( token_p == &token[MAXTOKEN] ) {
- Error( "Token too large on line %i\n",scriptline );
+ Error( "Token too large on line %i\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
}
}
typedef struct
{
+ char* unzFilePath;
char* name;
unz_s zipinfo;
unzFile zipfile;
char g_strForbiddenDirs[VFS_MAXDIRS][PATH_MAX + 1];
int g_numForbiddenDirs = 0;
static gboolean g_bUsePak = TRUE;
+char g_strLoadedFileLocation[1024];
// =============================================================================
// Static functions
}
unzGoToFirstFile( uf );
+ char* unzFilePath = strdup( filename );
+
for ( i = 0; i < gi.number_entry; i++ )
{
char filename_inzip[NAME_MAX];
file->name = strdup( filename_inzip );
file->size = file_info.uncompressed_size;
file->zipfile = uf;
+ file->unzFilePath = unzFilePath;
memcpy( &file->zipinfo, uf, sizeof( unz_s ) );
if ( ( i + 1 ) < gi.number_entry ) {
while ( g_pakFiles )
{
VFS_PAKFILE* file = (VFS_PAKFILE*)g_pakFiles->data;
+ free( file->unzFilePath );
free( file->name );
free( file );
g_pakFiles = g_slist_remove( g_pakFiles, file );
// filename is a full path
if ( index == -1 ) {
+ strcpy( g_strLoadedFileLocation, filename );
long len;
FILE *f;
strcat( tmp, filename );
if ( access( tmp, R_OK ) == 0 ) {
if ( count == index ) {
+ strcpy( g_strLoadedFileLocation, tmp );
+
long len;
FILE *f;
}
if ( count == index ) {
+ strcpy( g_strLoadedFileLocation, file->unzFilePath );
+ strcat( g_strLoadedFileLocation, " :: " );
+ strcat( g_strLoadedFileLocation, filename );
+
memcpy( file->zipfile, &file->zipinfo, sizeof( unz_s ) );
if ( unzOpenCurrentFile( file->zipfile ) != UNZ_OK ) {
extern char g_strForbiddenDirs[VFS_MAXDIRS][PATH_MAX + 1];
extern int g_numForbiddenDirs;
+extern char g_strLoadedFileLocation[1024];
#endif // _VFS_H_
PartialLoadIBSPFile( filename );
/* PartialSwapBSPFile() */
- int i, j;
- shaderInfo_t *si;
+ int i;
/* shaders (don't swap the name) */
for ( i = 0; i < numBSPShaders ; i++ )
break;
}
if ( strcmp( token, "{" ) ) {
- Error( "ParseShaderFile: %s, line %d: { not found!\nFound instead: %s",
- temp, scriptline, token );
+ Error( "ParseShaderFile: %s, line %d: { not found!\nFound instead: %s\nFile location be: %s",
+ temp, scriptline, token, g_strLoadedFileLocation );
}
while ( 1 )
break;
}
if ( strcmp( token, "{" ) ) {
- Error( "ParseShaderFile: %s, line %d: { not found!\nFound instead: %s",
- temp, scriptline, token );
+ Error( "ParseShaderFile: %s, line %d: { not found!\nFound instead: %s\nFile location be: %s",
+ temp, scriptline, token, g_strLoadedFileLocation );
}
qboolean hasmap = qfalse;
break;
}
if ( strcmp( token, "{" ) ) {
- Error( "ParseShaderFile: %s, line %d: { not found!\nFound instead: %s",
- temp, scriptline, token );
+ Error( "ParseShaderFile: %s, line %d: { not found!\nFound instead: %s\nFile location be: %s",
+ temp, scriptline, token, g_strLoadedFileLocation );
}
strcat( shaderText, "\n{" );
qboolean hasmap = qfalse;
if ( !GetTokenAppend( buffer, qtrue ) || strcmp( token, "(" ) ) {
- Error( "Parse1DMatrixAppend(): line %d: ( not found!", scriptline );
+ Error( "Parse1DMatrixAppend(): line %d: ( not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
for ( i = 0; i < x; i++ )
{
if ( !GetTokenAppend( buffer, qfalse ) ) {
- Error( "Parse1DMatrixAppend(): line %d: Number not found!", scriptline );
+ Error( "Parse1DMatrixAppend(): line %d: Number not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
m[ i ] = atof( token );
}
if ( !GetTokenAppend( buffer, qtrue ) || strcmp( token, ")" ) ) {
- Error( "Parse1DMatrixAppend(): line %d: ) not found!", scriptline );
+ Error( "Parse1DMatrixAppend(): line %d: ) not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
}
}
if ( strcmp( token, "{" ) ) {
if ( si != NULL ) {
- Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nLast known shader: %s",
- filename, scriptline, token, si->shader );
+ Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nLast known shader: %s\nFile location be: %s\n",
+ filename, scriptline, token, si->shader, g_strLoadedFileLocation );
}
else{
- Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s",
- filename, scriptline, token );
+ Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nFile location be: %s\n",
+ filename, scriptline, token, g_strLoadedFileLocation );
}
}