summaryrefslogtreecommitdiff
path: root/src/simulation/tools/AirTool.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-06-07 03:23:48 (GMT)
committer jacob1 <jfu614@gmail.com>2013-06-07 03:28:07 (GMT)
commite146ae50abc021cbff765aa73327408c7d4661ea (patch)
tree8f1686a726d6e64d3dce313e3b1f2708aa4b7661 /src/simulation/tools/AirTool.cpp
parent76b92952b12f0eeaedbf3f2e4231dbd72b6d902a (diff)
downloadpowder-e146ae50abc021cbff765aa73327408c7d4661ea.zip
powder-e146ae50abc021cbff765aa73327408c7d4661ea.tar.gz
some minor changes to tools
Diffstat (limited to 'src/simulation/tools/AirTool.cpp')
-rw-r--r--src/simulation/tools/AirTool.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/simulation/tools/AirTool.cpp b/src/simulation/tools/AirTool.cpp
index 5d7f405..506252e 100644
--- a/src/simulation/tools/AirTool.cpp
+++ b/src/simulation/tools/AirTool.cpp
@@ -1,20 +1,21 @@
#include "ToolClasses.h"
#include "simulation/Air.h"
-//#TPT-Directive ToolClass Tool_Air TOOL_AIR 3
+//#TPT-Directive ToolClass Tool_Air TOOL_AIR 2
Tool_Air::Tool_Air()
{
Identifier = "DEFAULT_TOOL_AIR";
Name = "AIR";
Colour = PIXPACK(0xFFFFFF);
- Description = "Creates air pressure";
+ Description = "Air, creates airflow and pressure.";
}
int Tool_Air::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
{
sim->air->pv[y/CELL][x/CELL] += strength*0.05f;
- if(sim->air->pv[y/CELL][x/CELL] > 256.0f)
+
+ if (sim->air->pv[y/CELL][x/CELL] > 256.0f)
sim->air->pv[y/CELL][x/CELL] = 256.0f;
- if(sim->air->pv[y/CELL][x/CELL] < -256.0f)
+ else if (sim->air->pv[y/CELL][x/CELL] < -256.0f)
sim->air->pv[y/CELL][x/CELL] = -256.0f;
return 1;
}