Simplify adding deco color to fire effect

This commit is contained in:
catsoften 2023-02-01 17:17:01 -05:00
parent f8761c3927
commit 3f4c00cb0d
No known key found for this signature in database
GPG Key ID: E4F118C248F12055
2 changed files with 5 additions and 14 deletions

View File

@ -282,7 +282,7 @@ void Renderer::render_parts()
{
if (!elements[t].Graphics || (*(elements[t].Graphics))(this, &(sim->parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb)) //That's a lot of args, a struct might be better
{
graphicscache[t].isready = t == PT_LIGH ? 0 : 1; // Glow effect depends on deco
graphicscache[t].isready = 1;
graphicscache[t].pixel_mode = pixel_mode;
graphicscache[t].cola = cola;
graphicscache[t].colr = colr;

View File

@ -295,19 +295,10 @@ static void create_line_par(Simulation * sim, int x1, int y1, int x2, int y2, in
static int graphics(GRAPHICS_FUNC_ARGS)
{
*firea = 120;
if (cpart->dcolour)
{
*firer = *colr = PIXR(cpart->dcolour);
*fireg = *colg = PIXG(cpart->dcolour);
*fireb = *colb = PIXB(cpart->dcolour);
}
else
{
*firer = *colr = 235;
*fireg = *colg = 245;
*fireb = *colb = 255;
}
*pixel_mode |= PMODE_GLOW | FIRE_ADD;
*firer = *colr = 235;
*fireg = *colg = 245;
*fireb = *colb = 255;
*pixel_mode |= PMODE_GLOW | FIRE_ADD | DECO_FIRE;
return 1;
}