summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-19 16:05:01 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-19 16:05:01 (GMT)
commitc2873180e224b93632daf01e40c6e6d0636bf86d (patch)
tree6308b7405461ddd3647c3aa5ed30f106ccd13dd6 /src
parent2b4ec998948e022be89330a4f04880ab11fbcb94 (diff)
downloadpowder-c2873180e224b93632daf01e40c6e6d0636bf86d.zip
powder-c2873180e224b93632daf01e40c6e6d0636bf86d.tar.gz
GOL loads gol colours for use
Diffstat (limited to 'src')
-rw-r--r--src/game/GameView.cpp2
-rw-r--r--src/simulation/elements/LIFE.cpp21
2 files changed, 21 insertions, 2 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index 08fcfe6..4f9c41a 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -365,7 +365,7 @@ void GameView::NotifyMenuListChanged(GameModel * sender)
std::string tempString = "";
Menu * item = *iter;
tempString += item->GetIcon();
- ui::Button * tempButton = new ui::Button(ui::Point(XRES+BARSIZE-16, currentY), ui::Point(15, 15), tempString);
+ ui::Button * tempButton = new ui::Button(ui::Point(XRES+BARSIZE-16, currentY), ui::Point(15, 15), tempString, item->GetDescription());
tempButton->Appearance.Margin = ui::Border(0, 2, 3, 2);
tempButton->SetTogglable(true);
tempButton->SetActionCallback(new MenuAction(this, item));
diff --git a/src/simulation/elements/LIFE.cpp b/src/simulation/elements/LIFE.cpp
index 84cec67..4207931 100644
--- a/src/simulation/elements/LIFE.cpp
+++ b/src/simulation/elements/LIFE.cpp
@@ -1,4 +1,8 @@
#include "simulation/Elements.h"
+
+bool Element_GOL_colourInit = false;
+pixel Element_GOL_colour[NGOL];
+
//#TPT-Directive ElementClass Element_LIFE PT_LIFE 78
Element_LIFE::Element_LIFE()
{
@@ -44,8 +48,23 @@ Element_LIFE::Element_LIFE()
Update = NULL;
Graphics = &Element_LIFE::graphics;
+
+ if(!Element_GOL_colourInit)
+ {
+ Element_GOL_colourInit = true;
+
+
+ int golMenuCount;
+ gol_menu * golMenuT = LoadGOLMenu(golMenuCount);
+ for(int i = 0; i < golMenuCount && i < NGOL; i++)
+ {
+ Element_GOL_colour[i] = golMenuT[i].colour;
+ }
+ free(golMenuT);
+ }
}
+
//#TPT-Directive ElementHeader Element_LIFE static int graphics(GRAPHICS_FUNC_ARGS)
int Element_LIFE::graphics(GRAPHICS_FUNC_ARGS)
@@ -94,7 +113,7 @@ int Element_LIFE::graphics(GRAPHICS_FUNC_ARGS)
else
pc = PIXRGB(255, 255, 0);
} else {
- pc = PIXRGB(255, 255, 0);//sim->gmenu[cpart->ctype].colour;
+ pc = Element_GOL_colour[cpart->ctype];
}
*colr = PIXR(pc);
*colg = PIXG(pc);