Simplify adding deco color to fire effect
This commit is contained in:
parent
f8761c3927
commit
3f4c00cb0d
@ -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
|
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].pixel_mode = pixel_mode;
|
||||||
graphicscache[t].cola = cola;
|
graphicscache[t].cola = cola;
|
||||||
graphicscache[t].colr = colr;
|
graphicscache[t].colr = colr;
|
||||||
|
@ -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)
|
static int graphics(GRAPHICS_FUNC_ARGS)
|
||||||
{
|
{
|
||||||
*firea = 120;
|
*firea = 120;
|
||||||
if (cpart->dcolour)
|
*firer = *colr = 235;
|
||||||
{
|
*fireg = *colg = 245;
|
||||||
*firer = *colr = PIXR(cpart->dcolour);
|
*fireb = *colb = 255;
|
||||||
*fireg = *colg = PIXG(cpart->dcolour);
|
*pixel_mode |= PMODE_GLOW | FIRE_ADD | DECO_FIRE;
|
||||||
*fireb = *colb = PIXB(cpart->dcolour);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*firer = *colr = 235;
|
|
||||||
*fireg = *colg = 245;
|
|
||||||
*fireb = *colb = 255;
|
|
||||||
}
|
|
||||||
*pixel_mode |= PMODE_GLOW | FIRE_ADD;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user