mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-07-31 21:50:18 +02:00
Make TESC create LIGH with same deco color (#901)
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#include "simulation/ElementCommon.h"
|
#include "simulation/ElementCommon.h"
|
||||||
|
|
||||||
|
#include "graphics/Pixel.h"
|
||||||
|
|
||||||
static int update(UPDATE_FUNC_ARGS);
|
static int update(UPDATE_FUNC_ARGS);
|
||||||
static int graphics(GRAPHICS_FUNC_ARGS);
|
static int graphics(GRAPHICS_FUNC_ARGS);
|
||||||
static void create(ELEMENT_CREATE_FUNC_ARGS);
|
static void create(ELEMENT_CREATE_FUNC_ARGS);
|
||||||
@@ -195,6 +197,7 @@ static bool create_LIGH(Simulation * sim, int x, int y, int c, float temp, int l
|
|||||||
{
|
{
|
||||||
sim->parts[p].temp = float(temp);
|
sim->parts[p].temp = float(temp);
|
||||||
sim->parts[p].tmp = tmp;
|
sim->parts[p].tmp = tmp;
|
||||||
|
sim->parts[p].dcolour = sim->parts[i].dcolour;
|
||||||
if (last)
|
if (last)
|
||||||
{
|
{
|
||||||
int nextSegmentLife = (int)(life/1.5 - sim->rng.between(0, 1));
|
int nextSegmentLife = (int)(life/1.5 - sim->rng.between(0, 1));
|
||||||
@@ -299,7 +302,7 @@ static int graphics(GRAPHICS_FUNC_ARGS)
|
|||||||
*firer = *colr = 235;
|
*firer = *colr = 235;
|
||||||
*fireg = *colg = 245;
|
*fireg = *colg = 245;
|
||||||
*fireb = *colb = 255;
|
*fireb = *colb = 255;
|
||||||
*pixel_mode |= PMODE_GLOW | FIRE_ADD;
|
*pixel_mode |= PMODE_GLOW | FIRE_ADD | DECO_FIRE;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -146,6 +146,7 @@ static int update(UPDATE_FUNC_ARGS)
|
|||||||
parts[p].temp=parts[p].life*parts[i].tmp/2.5;
|
parts[p].temp=parts[p].life*parts[i].tmp/2.5;
|
||||||
parts[p].tmp2=1;
|
parts[p].tmp2=1;
|
||||||
parts[p].tmp=int(atan2(-ry, (float)rx)/TPT_PI_FLT*360);
|
parts[p].tmp=int(atan2(-ry, (float)rx)/TPT_PI_FLT*360);
|
||||||
|
parts[p].dcolour = parts[i].dcolour;
|
||||||
parts[i].temp-=parts[i].tmp*2+parts[i].temp/5; // slight self-cooling
|
parts[i].temp-=parts[i].tmp*2+parts[i].temp/5; // slight self-cooling
|
||||||
if (fabs(sim->pv[y/CELL][x/CELL])!=0.0f)
|
if (fabs(sim->pv[y/CELL][x/CELL])!=0.0f)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user