From 3f4c00cb0d0f5dab50962d4897986f4852937928 Mon Sep 17 00:00:00 2001 From: catsoften Date: Wed, 1 Feb 2023 17:17:01 -0500 Subject: [PATCH] Simplify adding deco color to fire effect --- src/graphics/Renderer.cpp | 2 +- src/simulation/elements/LIGH.cpp | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp index 8a606ca38..04414528e 100644 --- a/src/graphics/Renderer.cpp +++ b/src/graphics/Renderer.cpp @@ -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; diff --git a/src/simulation/elements/LIGH.cpp b/src/simulation/elements/LIGH.cpp index 222f154eb..d13d3a80d 100644 --- a/src/simulation/elements/LIGH.cpp +++ b/src/simulation/elements/LIGH.cpp @@ -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; }