1
0
Fork 0
forked from fte/fteqw

use q2 style lightmap clamping

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3778 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2011-04-21 12:11:15 +00:00
parent 546c49870d
commit 0ffb6c11e2

View file

@ -563,9 +563,9 @@ static void Surf_AddDynamicLightsColours (msurface_t *surf)
dist = td + (sd>>1);
if (dist < minlight)
{
bl[0] += (rad - dist)*r;
bl[1] += (rad - dist)*g;
bl[2] += (rad - dist)*b;
bl[0] += (rad - dist)*r;
bl[1] += (rad - dist)*g;
bl[2] += (rad - dist)*b;
}
bl += 3;
}
@ -733,7 +733,6 @@ static void Surf_StoreLightmap(qbyte *dest, int smax, int tmax, unsigned int shi
b = (127+b*(*stainsrc++)) >> 8;
}
/*
// quake 2 method, scale highest down to
// maintain hue
m = max(max(r, g), b);
@ -743,11 +742,10 @@ static void Surf_StoreLightmap(qbyte *dest, int smax, int tmax, unsigned int shi
g *= 255.0/m;
b *= 255.0/m;
}
*/
dest[0] = min(b, 255);
dest[1] = min(g, 255);
dest[2] = min(r, 255);
dest[0] = b;
dest[1] = g;
dest[2] = r;
dest[3] = 255;
dest += 4;
@ -825,7 +823,6 @@ static void Surf_StoreLightmap(qbyte *dest, int smax, int tmax, unsigned int shi
b = (127+b*(*stainsrc++)) >> 8;
}
/*
// quake 2 method, scale highest down to
// maintain hue
m = max(max(r, g), b);
@ -835,11 +832,10 @@ static void Surf_StoreLightmap(qbyte *dest, int smax, int tmax, unsigned int shi
g *= 255.0/m;
b *= 255.0/m;
}
*/
dest[0] = min(r, 255);
dest[1] = min(g, 255);
dest[2] = min(b, 255);
dest[0] = r;
dest[1] = g;
dest[2] = b;
dest += 3;
}
if (stainsrc)