diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-02 12:09:11 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-02-02 12:09:11 (GMT) |
| commit | 8024caec55ff1b93eefe50663d4ddf63934f8d63 (patch) | |
| tree | bd9b2ade18eea618f2955d15e2e37bd4c77c09aa /src/game/Tool.h | |
| parent | 6641f1d54196a2193b258d3e76e2cca6ad3258b1 (diff) | |
| download | powder-8024caec55ff1b93eefe50663d4ddf63934f8d63.zip powder-8024caec55ff1b93eefe50663d4ddf63934f8d63.tar.gz | |
Flood fill
Diffstat (limited to 'src/game/Tool.h')
| -rw-r--r-- | src/game/Tool.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game/Tool.h b/src/game/Tool.h index bffa967..00b1184 100644 --- a/src/game/Tool.h +++ b/src/game/Tool.h @@ -31,6 +31,7 @@ public: virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) {} virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {} virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {} + virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) {}; int colRed, colBlue, colGreen; }; @@ -51,6 +52,9 @@ public: virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { sim->create_box(position1.X, position1.Y, position2.X, position2.Y, toolID, 0); } + virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { + sim->flood_parts(position.X, position.Y, toolID, -1, -1, 0); + } }; class GolTool: public Tool @@ -70,6 +74,9 @@ public: virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { sim->create_box(position1.X, position1.Y, position2.X, position2.Y, PT_LIFE|(toolID<<8), 0); } + virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { + sim->flood_parts(position.X, position.Y, PT_LIFE|(toolID<<8), -1, -1, 0); + } }; #endif /* TOOL_H_ */ |
