mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-28 10:20:04 +02:00
Slow LIGH creation speed, fixes #86
This commit is contained in:
@@ -166,6 +166,8 @@ void WindTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {}
|
|||||||
|
|
||||||
void Element_LIGH_Tool::Draw(Simulation * sim, Brush * brush, ui::Point position)
|
void Element_LIGH_Tool::Draw(Simulation * sim, Brush * brush, ui::Point position)
|
||||||
{
|
{
|
||||||
|
if(sim->currentTick >= nextUse)
|
||||||
|
{
|
||||||
int p = sim->create_part(-2, position.X, position.Y, toolID);
|
int p = sim->create_part(-2, position.X, position.Y, toolID);
|
||||||
if (p != -1)
|
if (p != -1)
|
||||||
{
|
{
|
||||||
@@ -173,6 +175,8 @@ void Element_LIGH_Tool::Draw(Simulation * sim, Brush * brush, ui::Point position
|
|||||||
if (sim->parts[p].life > 55)
|
if (sim->parts[p].life > 55)
|
||||||
sim->parts[p].life = 55;
|
sim->parts[p].life = 55;
|
||||||
sim->parts[p].temp = sim->parts[p].life*150; // temperature of the lighting shows the power of the lighting
|
sim->parts[p].temp = sim->parts[p].life*150; // temperature of the lighting shows the power of the lighting
|
||||||
|
nextUse = sim->currentTick+sim->parts[p].life/4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -73,9 +73,11 @@ public:
|
|||||||
|
|
||||||
class Element_LIGH_Tool: public Tool
|
class Element_LIGH_Tool: public Tool
|
||||||
{
|
{
|
||||||
|
int nextUse;
|
||||||
public:
|
public:
|
||||||
Element_LIGH_Tool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL):
|
Element_LIGH_Tool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL):
|
||||||
Tool(id, name, description, r, g, b)
|
Tool(id, name, description, r, g, b),
|
||||||
|
nextUse(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual ~Element_LIGH_Tool() {}
|
virtual ~Element_LIGH_Tool() {}
|
||||||
|
@@ -3093,7 +3093,6 @@ void Simulation::update_particles_i(int start, int inc)
|
|||||||
int excessive_stacking_found = 0;
|
int excessive_stacking_found = 0;
|
||||||
|
|
||||||
currentTick++;
|
currentTick++;
|
||||||
currentTick %= 3600;
|
|
||||||
|
|
||||||
if (lighting_recreate>0)
|
if (lighting_recreate>0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user