Lower rounding errors in BIZR code and make it change color both on vertical and horizontal movement.

This commit is contained in:
Saveliy Skresanov
2013-06-12 20:14:34 +07:00
parent 4e4bd9a11b
commit 03f2590967

View File

@@ -105,16 +105,16 @@ int Element_BIZR::graphics(GRAPHICS_FUNC_ARGS)
} }
for (x=0; x<12; x++) for (x=0; x<12; x++)
*colg += (cpart->ctype >> (x+9)) & 1; *colg += (cpart->ctype >> (x+9)) & 1;
x = 624/(*colr+*colg+*colb+1); x = *colr+*colg+*colb+1;
*colr *= x; *colr = *colr*624/x;
*colg *= x; *colg = *colg*624/x;
*colb *= x; *colb = *colb*624/x;
if(fabs(cpart->vx)+fabs(cpart->vy)>0) if(fabs(cpart->vx)+fabs(cpart->vy)>0)
{ {
*firea = 255; *firea = 255;
*fireg = *colg/5 * fabs(cpart->vx)+fabs(cpart->vy); *fireg = *colg/5 * (fabs(cpart->vx)+fabs(cpart->vy));
*fireb = *colb/5 * fabs(cpart->vx)+fabs(cpart->vy); *fireb = *colb/5 * (fabs(cpart->vx)+fabs(cpart->vy));
*firer = *colr/5 * fabs(cpart->vx)+fabs(cpart->vy); *firer = *colr/5 * (fabs(cpart->vx)+fabs(cpart->vy));
*pixel_mode |= FIRE_ADD; *pixel_mode |= FIRE_ADD;
} }
*pixel_mode |= PMODE_BLUR; *pixel_mode |= PMODE_BLUR;