mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 19:29:52 +02:00
Lower rounding errors in BIZR code and make it change color both on vertical and horizontal movement.
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user