summaryrefslogtreecommitdiff
path: root/src/game/Tool.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-17 12:40:10 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-17 12:40:10 (GMT)
commit6500923aa574bad86339f231382a7fcc11e64f96 (patch)
treeea48ca236dc8fe543a4b6044dea9ce2e800b1de8 /src/game/Tool.h
parentbe42cec4984d4af0dc35ff101d7323d1746cd5d5 (diff)
downloadpowder-6500923aa574bad86339f231382a7fcc11e64f96.zip
powder-6500923aa574bad86339f231382a7fcc11e64f96.tar.gz
Sample tool, fixes #122
Diffstat (limited to 'src/game/Tool.h')
-rw-r--r--src/game/Tool.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/game/Tool.h b/src/game/Tool.h
index d4181a7..2540a22 100644
--- a/src/game/Tool.h
+++ b/src/game/Tool.h
@@ -29,6 +29,7 @@ protected:
int resolution;
public:
Tool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL);
+ int GetToolID() { return toolID; }
string GetName();
string GetDescription();
int GetResolution() { return resolution; }
@@ -61,6 +62,26 @@ public:
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
};
+class GameModel;
+
+class SampleTool: public Tool
+{
+ GameModel * gameModel;
+public:
+ SampleTool(GameModel * model):
+ Tool(0, "SMPL", "Sample an element on the screen", 0, 0, 0, SampleTool::GetIcon),
+ gameModel(model)
+ {
+ }
+ static VideoBuffer * GetIcon(int toolID, int width, int height);
+ virtual ~SampleTool() {}
+ virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { }
+ virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
+ virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { }
+ virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { }
+ virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
+};
+
class PropertyTool: public Tool
{
public: