X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Fshaders.c;h=3c26a1cda270a3064cd4d495b751344af8590861;hb=fcb70e8e9cf76dd4993312a762e2ee255c1402a0;hp=8ac0463a6418ea8ba0d0ada41348560ddaf5ec2c;hpb=d64cc8de4c4a9c8318c93758e39940b87dbe0e91;p=xonotic%2Fnetradiant.git diff --git a/tools/quake3/q3map2/shaders.c b/tools/quake3/q3map2/shaders.c index 8ac0463a..3c26a1cd 100644 --- a/tools/quake3/q3map2/shaders.c +++ b/tools/quake3/q3map2/shaders.c @@ -70,7 +70,7 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts ){ VectorSet( mult, 1.0f, 1.0f, 1.0f ); mult[ 3 ] = 1.0f; VectorSet( add, 0.0f, 0.0f, 0.0f ); - mult[ 3 ] = 0.0f; + add[ 3 ] = 0.0f; /* switch on type */ switch ( cm2->type ) @@ -811,10 +811,12 @@ static void LoadShaderImages( shaderInfo_t *si ){ if ( VectorLength( si->color ) <= 0.0f ) { ColorNormalize( color, si->color ); VectorScale( color, ( 1.0f / count ), si->averageColor ); + si->averageColor[ 3 ] = color[ 3 ] / count; } else { VectorCopy( si->color, si->averageColor ); + si->averageColor[ 3 ] = 1.0f; } } @@ -945,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 ); } } @@ -1017,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 ); } } @@ -1060,7 +1062,6 @@ static void ParseShaderFile( const char *filename ){ !Q_stricmp( token, "clampMap" ) || !Q_stricmp( token, "animMap" ) || !Q_stricmp( token, "clampAnimMap" ) || - !Q_stricmp( token, "clampMap" ) || !Q_stricmp( token, "mapComp" ) || !Q_stricmp( token, "mapNoComp" ) ) { /* skip one token for animated stages */