]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/shaders.c
Merge commit 'fe73dd74d0e40a33c090993390e4d5721a1f9e05' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / shaders.c
index 0452a1ec852ce4d35a520dc8d6e743b8a5716d07..10b2b414fcf70181aaec69e0e10a3ead9ad1ddd8 100644 (file)
@@ -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;
        }
 }
 
@@ -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 */