summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-10 13:03:23 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-10 13:03:23 (GMT)
commit810ea42f99cf9f56c1ac998ce8a203bea01e97b2 (patch)
treeb3c2bc39bfed051003a6eeab6e990e73ddad5dec /src/simulation/Simulation.cpp
parentfd40ed234ab157c4e315cb748163969c8ff83b0f (diff)
downloadpowder-810ea42f99cf9f56c1ac998ce8a203bea01e97b2.zip
powder-810ea42f99cf9f56c1ac998ce8a203bea01e97b2.tar.gz
Only render gravity lensing if it's enabled, Ctrl and Shift to alter tool strength (Shift = x10, Ctrl = x0.1)
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 717eb80..841984e 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -1018,7 +1018,7 @@ int Simulation::Tool(int x, int y, int tool, float strength)
return 0;
}
-int Simulation::ToolBrush(int x, int y, int tool, Brush * cBrush)
+int Simulation::ToolBrush(int x, int y, int tool, Brush * cBrush, float strength)
{
int rx, ry, j, i;
if(!cBrush)
@@ -1032,11 +1032,11 @@ int Simulation::ToolBrush(int x, int y, int tool, Brush * cBrush)
{
if ( x+i<0 || y+j<0 || x+i>=XRES || y+j>=YRES)
continue;
- Tool(x+i, y+j, tool, 1.0f);
+ Tool(x+i, y+j, tool, strength);
}
}
-void Simulation::ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBrush)
+void Simulation::ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBrush, float strength)
{
int cp=abs(y2-y1)>abs(x2-x1), x, y, dx, dy, sy, rx, ry;
float e, de;
@@ -1072,9 +1072,9 @@ void Simulation::ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBru
for (x=x1; x<=x2; x++)
{
if (cp)
- ToolBrush(y, x, tool, cBrush);
+ ToolBrush(y, x, tool, cBrush, strength);
else
- ToolBrush(x, y, tool, cBrush);
+ ToolBrush(x, y, tool, cBrush, strength);
e += de;
if (e >= 0.5f)
{
@@ -1082,15 +1082,15 @@ void Simulation::ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBru
if ((!(rx+ry)) && ((y1<y2) ? (y<=y2) : (y>=y2)))
{
if (cp)
- ToolBrush(y, x, tool, cBrush);
+ ToolBrush(y, x, tool, cBrush, strength);
else
- ToolBrush(x, y, tool, cBrush);
+ ToolBrush(x, y, tool, cBrush, strength);
}
e -= 1.0f;
}
}
}
-void Simulation::ToolBox(int x1, int y1, int x2, int y2, int tool, Brush * cBrush)
+void Simulation::ToolBox(int x1, int y1, int x2, int y2, int tool, Brush * cBrush, float strength)
{
int i, j;
if (x1>x2)
@@ -1107,7 +1107,7 @@ void Simulation::ToolBox(int x1, int y1, int x2, int y2, int tool, Brush * cBrus
}
for (j=y1; j<=y2; j++)
for (i=x1; i<=x2; i++)
- ToolBrush(i, j, tool, cBrush);
+ ToolBrush(i, j, tool, cBrush, strength);
}
int Simulation::CreateParts(int positionX, int positionY, int c, Brush * cBrush)