Skip to content

Commit

Permalink
fix crash when using LIGH (base class should be ElementTool, not Tool)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Aug 28, 2015
1 parent 2be317e commit 052681e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/gui/game/Tool.h
Expand Up @@ -102,19 +102,6 @@ class PropertyTool: public Tool
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
};

class Element_LIGH_Tool: public Tool
{
public:
Element_LIGH_Tool(int id, string name, string description, int r, int g, int b, std::string identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL):
Tool(id, name, description, r, g, b, identifier, textureGen)
{ }
virtual ~Element_LIGH_Tool() { }
virtual void Click(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 ElementTool: public Tool
{
Expand All @@ -127,6 +114,19 @@ class ElementTool: public Tool
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
};

class Element_LIGH_Tool: public ElementTool
{
public:
Element_LIGH_Tool(int id, string name, string description, int r, int g, int b, std::string identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL):
ElementTool(id, name, description, r, g, b, identifier, textureGen)
{ }
virtual ~Element_LIGH_Tool() { }
virtual void Click(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 Element_TESC_Tool: public ElementTool
{
public:
Expand Down

0 comments on commit 052681e

Please sign in to comment.