summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-04 14:26:55 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-04 14:26:55 (GMT)
commit055832270979cdb027c0c30a74cf82c23df13689 (patch)
treeb2ee525f713764c020b8668fe5776f4aa3d60643 /src/game
parentf32cd872ca2214b670b1ed4efa0b5b12a9c1ed30 (diff)
downloadpowder-055832270979cdb027c0c30a74cf82c23df13689.zip
powder-055832270979cdb027c0c30a74cf82c23df13689.tar.gz
Add icons for erase, improve icons for certain walls, fix issue #45
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameModel.cpp6
-rw-r--r--src/game/SignTool.cpp4
-rw-r--r--src/game/Tool.cpp4
-rw-r--r--src/game/Tool.h1
4 files changed, 10 insertions, 5 deletions
diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp
index 7566044..85f54d3 100644
--- a/src/game/GameModel.cpp
+++ b/src/game/GameModel.cpp
@@ -167,15 +167,15 @@ void GameModel::BuildMenus()
Tool * tempTool;
if(i == PT_LIGH)
{
- tempTool = new Element_LIGH_Tool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour));
+ tempTool = new Element_LIGH_Tool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour), sim->elements[i].IconGenerator);
}
else if(i == PT_STKM || i == PT_FIGH || i == PT_STKM2)
{
- tempTool = new PlopTool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour));
+ tempTool = new PlopTool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour), sim->elements[i].IconGenerator);
}
else
{
- tempTool = new ElementTool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour));
+ tempTool = new ElementTool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour), sim->elements[i].IconGenerator);
}
menuList[sim->elements[i].MenuSection]->AddTool(tempTool);
}
diff --git a/src/game/SignTool.cpp b/src/game/SignTool.cpp
index 0ad755e..cea6978 100644
--- a/src/game/SignTool.cpp
+++ b/src/game/SignTool.cpp
@@ -138,8 +138,8 @@ VideoBuffer * SignTool::GetIcon(int toolID, int width, int height)
newTexture->SetPixel(x, y, PIXR(pc), PIXG(pc), PIXB(pc), 255);
}
}
- newTexture->SetCharacter((width/2)-5, (height/2)-4, 0xA1, 32, 64, 128, 255);
- newTexture->SetCharacter((width/2)-5, (height/2)-4, 0xA0, 255, 255, 255, 255);
+ newTexture->SetCharacter((width/2)-5, (height/2)-5, 0xA1, 32, 64, 128, 255);
+ newTexture->SetCharacter((width/2)-5, (height/2)-5, 0xA0, 255, 255, 255, 255);
return newTexture;
}
diff --git a/src/game/Tool.cpp b/src/game/Tool.cpp
index 43c2800..e3f1ded 100644
--- a/src/game/Tool.cpp
+++ b/src/game/Tool.cpp
@@ -30,6 +30,10 @@ VideoBuffer * Tool::GetTexture(int width, int height)
}
return NULL;
}
+void Tool::SetTextureGen(VideoBuffer * (*textureGen)(int, int, int))
+{
+ this->textureGen = textureGen;
+}
string Tool::GetName() { return toolName; }
string Tool::GetDescription() { return toolDescription; }
Tool::~Tool() {}
diff --git a/src/game/Tool.h b/src/game/Tool.h
index 1b70768..aa021fc 100644
--- a/src/game/Tool.h
+++ b/src/game/Tool.h
@@ -30,6 +30,7 @@ public:
string GetName();
string GetDescription();
VideoBuffer * GetTexture(int width, int height);
+ void SetTextureGen(VideoBuffer * (*textureGen)(int, int, int));
virtual ~Tool();
virtual void Click(Simulation * sim, Brush * brush, ui::Point position);
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);