Remove pastel glow on "inactive" GLOW, fix FIRE_ADD variables.

FIRE_ADD, firea/r/g/b variables adjusted to work similar to v51.1.
Use RNG to assist with smooth(er) transition from PMODE_FLAT to PMODE_ADD
This commit is contained in:
Simon Robertshaw 2021-05-22 21:48:06 +01:00
parent 2c207a934e
commit 10a6bb7120

View File

@ -75,17 +75,25 @@ static int update(UPDATE_FUNC_ARGS)
static int graphics(GRAPHICS_FUNC_ARGS)
{
*firea = int(restrict_flt(64.0f+cpart->ctype, 0, 255));
*firer = int(restrict_flt(cpart->temp-(275.13f+32.0f), 0, 128)/50.0f);
*fireg = int(restrict_flt(float(cpart->ctype), 0, 128)/50.0f);
*fireb = int(restrict_flt(float(cpart->tmp), 0, 128)/50.0f);
*firer = 16+int(restrict_flt(cpart->temp-(275.13f+32.0f), 0, 128)/2.0f);
*fireg = 16+int(restrict_flt(float(cpart->ctype), 0, 128)/2.0f);
*fireb = 16+int(restrict_flt(float(cpart->tmp), 0, 128)/2.0f);
*firea = 64;
*colr = int(restrict_flt(64.0f+cpart->temp-(275.13f+32.0f), 0, 255));
*colg = int(restrict_flt(64.0f+cpart->ctype, 0, 255));
*colb = int(restrict_flt(64.0f+cpart->tmp, 0, 255));
*pixel_mode |= FIRE_ADD;
*pixel_mode |= PMODE_GLOW | PMODE_ADD;
*pixel_mode &= ~PMODE_FLAT;
int rng = RNG::Ref().between(1, 32); //
if(((*colr) + (*colg) + (*colb)) > (256 + rng)) {
*colr -= 54;
*colg -= 54;
*colb -= 54;
*pixel_mode |= FIRE_ADD;
*pixel_mode |= PMODE_GLOW | PMODE_ADD;
*pixel_mode &= ~PMODE_FLAT;
} else {
*pixel_mode |= PMODE_BLUR;
}
return 0;
}