summaryrefslogtreecommitdiff
path: root/src/game/Tool.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-21 17:43:46 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-21 17:43:46 (GMT)
commitf7d8556965832821036c210ffc1f9e73f3ff70cc (patch)
tree58e985bdc6e99a2ad8e7382ebaf33553ae93d836 /src/game/Tool.h
parent5bf0a084ace0e6b673efa4552b40de8b36e0668e (diff)
downloadpowder-f7d8556965832821036c210ffc1f9e73f3ff70cc.zip
powder-f7d8556965832821036c210ffc1f9e73f3ff70cc.tar.gz
Icons for menu items
Diffstat (limited to 'src/game/Tool.h')
-rw-r--r--src/game/Tool.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/game/Tool.h b/src/game/Tool.h
index 2cc33be..c7b7f58 100644
--- a/src/game/Tool.h
+++ b/src/game/Tool.h
@@ -16,17 +16,20 @@ using namespace std;
class Simulation;
class Brush;
+class VideoBuffer;
class Tool
{
protected:
+ VideoBuffer * (*textureGen)(int, int, int);
int toolID;
string toolName;
string toolDescription;
public:
- Tool(int id, string name, string description, int r, int g, int b);
+ Tool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL);
string GetName();
string GetDescription();
+ VideoBuffer * GetTexture(int width, int height);
virtual ~Tool();
virtual void Click(Simulation * sim, Brush * brush, ui::Point position);
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
@@ -40,9 +43,10 @@ class SignTool: public Tool
{
public:
SignTool():
- Tool(0, "SIGN", "Sign. Click a sign to edit or anywhere else to create a new one", 0, 0, 0)
+ Tool(0, "SIGN", "Sign. Click a sign to edit or anywhere else to create a new one", 0, 0, 0, SignTool::GetIcon)
{
}
+ static VideoBuffer * GetIcon(int toolID, int width, int height);
virtual ~SignTool() {}
virtual void Click(Simulation * sim, Brush * brush, ui::Point position);
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { }
@@ -55,7 +59,7 @@ class PropertyTool: public Tool
{
public:
PropertyTool():
- Tool(0, "PROP", "Property Edit. Click to alter the properties of elements in the field", 0, 0, 0)
+ Tool(0, "PROP", "Property Edit. Click to alter the properties of elements in the field", 0, 0, 0, NULL)
{
}
virtual ~PropertyTool() {}
@@ -69,7 +73,7 @@ public:
class Element_LIGH_Tool: public Tool
{
public:
- Element_LIGH_Tool(int id, string name, string description, int r, int g, int b):
+ Element_LIGH_Tool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL):
Tool(id, name, description, r, g, b)
{
}
@@ -84,7 +88,7 @@ public:
class ElementTool: public Tool
{
public:
- ElementTool(int id, string name, string description, int r, int g, int b);
+ ElementTool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL);
virtual ~ElementTool();
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);
@@ -95,7 +99,7 @@ public:
class WallTool: public Tool
{
public:
- WallTool(int id, string name, string description, int r, int g, int b);
+ WallTool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL);
virtual ~WallTool();
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);
@@ -106,7 +110,7 @@ public:
class GolTool: public Tool
{
public:
- GolTool(int id, string name, string description, int r, int g, int b);
+ GolTool(int id, string name, string description, int r, int g, int b, VideoBuffer * (*textureGen)(int, int, int) = NULL);
virtual ~GolTool();
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);