summaryrefslogtreecommitdiff
path: root/src/simulation/elements/LIFE.cpp
diff options
context:
space:
mode:
authorbuild.powdertoy.co.uk <admin@powdertoy.co.uk>2012-07-19 17:08:34 (GMT)
committer build.powdertoy.co.uk <admin@powdertoy.co.uk>2012-07-19 17:08:34 (GMT)
commitd328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01 (patch)
treedb311c7849270ddd2510cbd65a192b059f8a3c77 /src/simulation/elements/LIFE.cpp
parentd71af3706a7a14e8ae65523e1a062417818b8fe2 (diff)
parent4d961117bde4398ae4d72f2db96eef381371e2df (diff)
downloadpowder-d328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01.zip
powder-d328b84b1330b0e8f3a7f87ce48b9b20ea4b6d01.tar.gz
Merge branch 'master' of github.com:FacialTurd/PowderToypp
Diffstat (limited to 'src/simulation/elements/LIFE.cpp')
-rw-r--r--src/simulation/elements/LIFE.cpp21
1 files changed, 20 insertions, 1 deletions
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);