PhracturedBlue added antialiasing

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@285 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
gewlitys
2002-12-01 22:02:15 +00:00
parent fb3e12faf1
commit abf7a86cc2
+10 -1
View File
@@ -221,7 +221,8 @@ RenderPhongMask (POINT loc)
x=pt.x-RADIUS; x=pt.x-RADIUS;
y=pt.y-RADIUS; y=pt.y-RADIUS;
rad=x*x+y*y; rad=x*x+y*y;
if(rad<RADIUS_2) { if(rad<=RADIUS_2)
{
lrad=((x-light.x)*(x-light.x)+(y-light.y)*(y-light.y)); lrad=((x-light.x)*(x-light.x)+(y-light.y)*(y-light.y));
lrad2=pow(lrad,1); lrad2=pow(lrad,1);
if (lrad2 >= lmag2) { if (lrad2 >= lmag2) {
@@ -231,6 +232,14 @@ RenderPhongMask (POINT loc)
if(intens<AMBIENT_LIGHT) {intens=AMBIENT_LIGHT;} if(intens<AMBIENT_LIGHT) {intens=AMBIENT_LIGHT;}
} }
stepint=step- (DWORD)(intens*step+0.5); stepint=step- (DWORD)(intens*step+0.5);
if(rad >(RADIUS-1)*(RADIUS-1))
{
DWORD r;
r=rad-(RADIUS-1)*(RADIUS-1);
stepint+=(step>>7)*(r+1);
if(stepint > step)
stepint=step;
}
} else { } else {
stepint=step; stepint=step;
} }