summaryrefslogtreecommitdiff
path: root/src/simulation/tools
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-05-17 16:44:25 (GMT)
committer jacob1 <jfu614@gmail.com>2013-05-17 16:44:25 (GMT)
commit981f6984c2c0f87d54a9c90f4518c69c9ef02ae0 (patch)
tree757bd699a23c1fad61e60700265a25feb1a3042c /src/simulation/tools
parentcbd402d8cb6aa699ffde83a1b5b3c2f4fc51baaf (diff)
parent77bf649fb4482c86ac1fd9b3233f062b53226007 (diff)
downloadpowder-981f6984c2c0f87d54a9c90f4518c69c9ef02ae0.zip
powder-981f6984c2c0f87d54a9c90f4518c69c9ef02ae0.tar.gz
Merge branch 'HEAD' of git@github.com:FacialTurd/The-Powder-Toy.git
Diffstat (limited to 'src/simulation/tools')
-rw-r--r--src/simulation/tools/AirTool.cpp4
-rw-r--r--src/simulation/tools/Cool.cpp9
-rw-r--r--src/simulation/tools/GravTool.cpp18
-rw-r--r--src/simulation/tools/Heat.cpp9
-rw-r--r--src/simulation/tools/NGrv.cpp4
-rw-r--r--src/simulation/tools/PGrv.cpp18
-rw-r--r--src/simulation/tools/SimTool.cpp4
-rw-r--r--src/simulation/tools/SimTool.h2
-rw-r--r--src/simulation/tools/Vac.cpp4
9 files changed, 39 insertions, 33 deletions
diff --git a/src/simulation/tools/AirTool.cpp b/src/simulation/tools/AirTool.cpp
index 9fd7f79..4e7ebde 100644
--- a/src/simulation/tools/AirTool.cpp
+++ b/src/simulation/tools/AirTool.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
#include "simulation/Air.h"
//#TPT-Directive ToolClass Tool_Air TOOL_AIR 3
Tool_Air::Tool_Air()
@@ -19,4 +19,4 @@ int Tool_Air::Perform(Simulation * sim, Particle * cpart, int x, int y, float st
return 1;
}
-Tool_Air::~Tool_Air() {} \ No newline at end of file
+Tool_Air::~Tool_Air() {}
diff --git a/src/simulation/tools/Cool.cpp b/src/simulation/tools/Cool.cpp
index b1b57b1..bc49634 100644
--- a/src/simulation/tools/Cool.cpp
+++ b/src/simulation/tools/Cool.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
//#TPT-Directive ToolClass Tool_Cool TOOL_COOL 1
Tool_Cool::Tool_Cool()
{
@@ -12,7 +12,10 @@ int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
{
if(!cpart)
return 0;
- cpart->temp -= strength;
+ if (cpart->type == PT_PUMP || cpart->type == PT_GPMP)
+ cpart->temp -= .1f*strength;
+ else
+ cpart->temp -= strength;
if(cpart->temp > MAX_TEMP)
cpart->temp = MAX_TEMP;
if(cpart->temp < 0)
@@ -20,4 +23,4 @@ int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
return 1;
}
-Tool_Cool::~Tool_Cool() {} \ No newline at end of file
+Tool_Cool::~Tool_Cool() {}
diff --git a/src/simulation/tools/GravTool.cpp b/src/simulation/tools/GravTool.cpp
deleted file mode 100644
index 630ba12..0000000
--- a/src/simulation/tools/GravTool.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "simulation/Tools.h"
-#include "simulation/Simulation.h"
-//#TPT-Directive ToolClass Tool_Grav TOOL_GRAV 4
-Tool_Grav::Tool_Grav()
-{
- Identifier = "DEFAULT_TOOL_GRAV";
- Name = "GRAV";
- Colour = PIXPACK(0xCCCCFF);
- Description = "Creates a short-lasting gravity well";
-}
-
-int Tool_Grav::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
-{
- sim->gravmap[((y/CELL)*(XRES/CELL))+(x/CELL)] += 0.03f*strength;
- return 1;
-}
-
-Tool_Grav::~Tool_Grav() {} \ No newline at end of file
diff --git a/src/simulation/tools/Heat.cpp b/src/simulation/tools/Heat.cpp
index f28274c..903efe3 100644
--- a/src/simulation/tools/Heat.cpp
+++ b/src/simulation/tools/Heat.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
//#TPT-Directive ToolClass Tool_Heat TOOL_HEAT 0
Tool_Heat::Tool_Heat()
{
@@ -12,7 +12,10 @@ int Tool_Heat::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
{
if(!cpart)
return 0;
- cpart->temp += strength;
+ if (cpart->type == PT_PUMP || cpart->type == PT_GPMP)
+ cpart->temp += .1f*strength;
+ else
+ cpart->temp += strength;
if(cpart->temp > MAX_TEMP)
cpart->temp = MAX_TEMP;
if(cpart->temp < 0)
@@ -20,4 +23,4 @@ int Tool_Heat::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
return 1;
}
-Tool_Heat::~Tool_Heat() {} \ No newline at end of file
+Tool_Heat::~Tool_Heat() {}
diff --git a/src/simulation/tools/NGrv.cpp b/src/simulation/tools/NGrv.cpp
index 525d697..65530c5 100644
--- a/src/simulation/tools/NGrv.cpp
+++ b/src/simulation/tools/NGrv.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
#include "simulation/Simulation.h"
//#TPT-Directive ToolClass Tool_NGrv TOOL_NGRV 5
Tool_NGrv::Tool_NGrv()
@@ -15,4 +15,4 @@ int Tool_NGrv::Perform(Simulation * sim, Particle * cpart, int x, int y, float s
return 1;
}
-Tool_NGrv::~Tool_NGrv() {} \ No newline at end of file
+Tool_NGrv::~Tool_NGrv() {}
diff --git a/src/simulation/tools/PGrv.cpp b/src/simulation/tools/PGrv.cpp
new file mode 100644
index 0000000..cfa381c
--- /dev/null
+++ b/src/simulation/tools/PGrv.cpp
@@ -0,0 +1,18 @@
+#include "ToolClasses.h"
+#include "simulation/Simulation.h"
+//#TPT-Directive ToolClass Tool_PGrv TOOL_PGRV 4
+Tool_PGrv::Tool_PGrv()
+{
+ Identifier = "DEFAULT_TOOL_PGRV";
+ Name = "PGRV";
+ Colour = PIXPACK(0xCCCCFF);
+ Description = "Creates a short-lasting gravity well";
+}
+
+int Tool_PGrv::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
+{
+ sim->gravmap[((y/CELL)*(XRES/CELL))+(x/CELL)] += 0.03f*strength;
+ return 1;
+}
+
+Tool_PGrv::~Tool_PGrv() {}
diff --git a/src/simulation/tools/SimTool.cpp b/src/simulation/tools/SimTool.cpp
index d7015fa..0fdec2b 100644
--- a/src/simulation/tools/SimTool.cpp
+++ b/src/simulation/tools/SimTool.cpp
@@ -1,5 +1,5 @@
#include "simulation/Element.h"
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
SimTool::SimTool():
Identifier("DEFAULT_TOOL_INVALID"),
@@ -7,4 +7,4 @@ Name(""),
Colour(PIXPACK(0xFFFFFF)),
Description("NULL Tool, does NOTHING")
{
-} \ No newline at end of file
+}
diff --git a/src/simulation/tools/SimTool.h b/src/simulation/tools/SimTool.h
index c32ba5b..c5a5cb1 100644
--- a/src/simulation/tools/SimTool.h
+++ b/src/simulation/tools/SimTool.h
@@ -20,4 +20,4 @@ public:
virtual int Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) { return 0; }
};
-#endif \ No newline at end of file
+#endif
diff --git a/src/simulation/tools/Vac.cpp b/src/simulation/tools/Vac.cpp
index aa319e2..fbf7e85 100644
--- a/src/simulation/tools/Vac.cpp
+++ b/src/simulation/tools/Vac.cpp
@@ -1,4 +1,4 @@
-#include "simulation/Tools.h"
+#include "ToolClasses.h"
#include "simulation/Air.h"
//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 2
Tool_Vac::Tool_Vac()
@@ -6,7 +6,7 @@ Tool_Vac::Tool_Vac()
Identifier = "DEFAULT_TOOL_VAC";
Name = "VAC";
Colour = PIXPACK(0x303030);
- Description = "Removes air pressure";
+ Description = "Reduces air pressure";
}
int Tool_Vac::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)