X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Fshaders.c;h=3c26a1cda270a3064cd4d495b751344af8590861;hb=fcb70e8e9cf76dd4993312a762e2ee255c1402a0;hp=10b2b414fcf70181aaec69e0e10a3ead9ad1ddd8;hpb=154c708c34f241c2369b183ffe9c4296085c5a3c;p=xonotic%2Fnetradiant.git diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index 10b2b414..3c26a1cd 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -947,17 +947,17 @@ void Parse1DMatrixAppend( char *buffer, int x, vec_t *m ){ 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 ); } } @@ -1019,12 +1019,12 @@ static void ParseShaderFile( const char *filename ){ } 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 ); } } @@ -1276,8 +1276,7 @@ static void ParseShaderFile( const char *filename ){ else if ( !Q_stricmp( token, "sun" ) /* sof2 */ || !Q_stricmp( token, "q3map_sun" ) || !Q_stricmp( token, "q3map_sunExt" ) ) { float a, b; sun_t *sun; - qboolean ext; - + qboolean ext = qfalse; /* ydnar: extended sun directive? */ if ( !Q_stricmp( token, "q3map_sunext" ) ) { @@ -1285,8 +1284,7 @@ static void ParseShaderFile( const char *filename ){ } /* allocate sun */ - sun = safe_malloc( sizeof( *sun ) ); - memset( sun, 0, sizeof( *sun ) ); + sun = safe_malloc0( sizeof( *sun ) ); /* set style */ sun->style = si->lightStyle; @@ -1386,8 +1384,7 @@ static void ParseShaderFile( const char *filename ){ surfaceModel_t *model; /* allocate new model and attach it */ - model = safe_malloc( sizeof( *model ) ); - memset( model, 0, sizeof( *model ) ); + model = safe_malloc0( sizeof( *model ) ); model->next = si->surfaceModel; si->surfaceModel = model; @@ -1420,8 +1417,7 @@ static void ParseShaderFile( const char *filename ){ /* allocate new foliage struct and attach it */ - foliage = safe_malloc( sizeof( *foliage ) ); - memset( foliage, 0, sizeof( *foliage ) ); + foliage = safe_malloc0( sizeof( *foliage ) ); foliage->next = si->foliage; si->foliage = foliage; @@ -1751,8 +1747,7 @@ static void ParseShaderFile( const char *filename ){ alpha = ( !Q_stricmp( token, "q3map_alphaGen" ) || !Q_stricmp( token, "q3map_alphaMod" ) ) ? 1 : 0; /* allocate new colormod */ - cm = safe_malloc( sizeof( *cm ) ); - memset( cm, 0, sizeof( *cm ) ); + cm = safe_malloc0( sizeof( *cm ) ); /* attach to shader */ if ( si->colorMod == NULL ) {