diff options
| author | Simon 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) |
| commit | 810ea42f99cf9f56c1ac998ce8a203bea01e97b2 (patch) | |
| tree | b3c2bc39bfed051003a6eeab6e990e73ddad5dec /src/simulation | |
| parent | fd40ed234ab157c4e315cb748163969c8ff83b0f (diff) | |
| download | powder-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')
| -rw-r--r-- | src/simulation/Simulation.cpp | 18 | ||||
| -rw-r--r-- | src/simulation/Simulation.h | 8 |
2 files changed, 13 insertions, 13 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) diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h index 9b10df2..387d3b3 100644 --- a/src/simulation/Simulation.h +++ b/src/simulation/Simulation.h @@ -159,10 +159,10 @@ public: void SetEdgeMode(int newEdgeMode); - int Tool(int x, int y, int tool, float strength); - int ToolBrush(int x, int y, int tool, Brush * cBrush); - void ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBrush); - void ToolBox(int x1, int y1, int x2, int y2, int tool, Brush * cBrush); + int Tool(int x, int y, int tool, float strength = 1.0f); + int ToolBrush(int x, int y, int tool, Brush * cBrush, float strength = 1.0f); + void ToolLine(int x1, int y1, int x2, int y2, int tool, Brush * cBrush, float strength = 1.0f); + void ToolBox(int x1, int y1, int x2, int y2, int tool, Brush * cBrush, float strength = 1.0f); void CreateBox(int x1, int y1, int x2, int y2, int c, int flags); int FloodINST(int x, int y, int fullc, int cm); |
