diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-05 15:59:14 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-05 15:59:14 (GMT) |
| commit | 30f8049efc6efc086509d235df413e4932dab83e (patch) | |
| tree | 96642c3f8a63e15a40c448c23f5ada446eba673b /src/game/Tool.cpp | |
| parent | 9e309135d403f0f99f586015ffd194a8914ae504 (diff) | |
| download | powder-30f8049efc6efc086509d235df413e4932dab83e.zip powder-30f8049efc6efc086509d235df413e4932dab83e.tar.gz | |
Allow 24bits of var for create_part, add tool for tesc. Fixes #72
Diffstat (limited to 'src/game/Tool.cpp')
| -rw-r--r-- | src/game/Tool.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/Tool.cpp b/src/game/Tool.cpp index 3a9fc1e..10b7b0d 100644 --- a/src/game/Tool.cpp +++ b/src/game/Tool.cpp @@ -176,6 +176,27 @@ void Element_LIGH_Tool::Draw(Simulation * sim, Brush * brush, ui::Point position } } +Element_TESC_Tool::Element_TESC_Tool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int)): + ElementTool(id, name, description, r, g, b, textureGen) + { + } +void Element_TESC_Tool::Draw(Simulation * sim, Brush * brush, ui::Point position){ + int radiusInfo = brush->GetRadius().X*4+brush->GetRadius().Y*4+7; + sim->CreateParts(position.X, position.Y, toolID | (radiusInfo << 8), brush); +} +void Element_TESC_Tool::DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) { + int radiusInfo = brush->GetRadius().X*4+brush->GetRadius().Y*4+7; + sim->CreateLine(position1.X, position1.Y, position2.X, position2.Y, toolID | (radiusInfo << 8), brush); +} +void Element_TESC_Tool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { + int radiusInfo = brush->GetRadius().X*4+brush->GetRadius().Y*4+7; + sim->CreateBox(position1.X, position1.Y, position2.X, position2.Y, toolID | (radiusInfo << 8), 0); +} +void Element_TESC_Tool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) { + int radiusInfo = brush->GetRadius().X*4+brush->GetRadius().Y*4+7; + sim->FloodParts(position.X, position.Y, toolID | (radiusInfo << 8), -1, -1, 0); +} + void PlopTool::Click(Simulation * sim, Brush * brush, ui::Point position) { sim->create_part(-1, position.X, position.Y, toolID); |
