summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-09 10:46:42 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-09 10:46:42 (GMT)
commit798c78b04eda4bf8bf9b9dc4997692e0010eb93c (patch)
treeed3ce2fa2a3a29e09b0fe8d6dae955c5e9a66dad /src/simulation
parentc88079d084f2f3b7ec891da22f8c497cd2652853 (diff)
downloadpowder-798c78b04eda4bf8bf9b9dc4997692e0010eb93c.zip
powder-798c78b04eda4bf8bf9b9dc4997692e0010eb93c.tar.gz
Add missing GOL data
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/Simulation.cpp5
-rw-r--r--src/simulation/SimulationData.cpp35
-rw-r--r--src/simulation/SimulationData.h54
3 files changed, 94 insertions, 0 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index b52907b..764d29d 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -3412,6 +3412,11 @@ Simulation::Simulation():
memcpy(grule, golRulesT, sizeof(int) * (golRulesCount*10));
free(golRulesT);
+ int golTypesCount;
+ int * golTypesT = LoadGOLTypes(golTypesCount);
+ memcpy(goltype, golTypesT, sizeof(int) * (golTypesCount));
+ free(golTypesT);
+
int golMenuCount;
gol_menu * golMenuT = LoadGOLMenu(golMenuCount);
memcpy(gmenu, golMenuT, sizeof(gol_menu) * golMenuCount);
diff --git a/src/simulation/SimulationData.cpp b/src/simulation/SimulationData.cpp
index 8dd21e0..da0cad6 100644
--- a/src/simulation/SimulationData.cpp
+++ b/src/simulation/SimulationData.cpp
@@ -80,6 +80,41 @@ int * LoadGOLRules(int & golRuleCount)
return golRulesT;
}
+int * LoadGOLTypes(int & golTypeCount)
+{
+ int golTypes[NGOL] =
+ {
+ GT_GOL,
+ GT_HLIF,
+ GT_ASIM,
+ GT_2x2,
+ GT_DANI,
+ GT_AMOE,
+ GT_MOVE,
+ GT_PGOL,
+ GT_DMOE,
+ GT_34,
+ GT_LLIF,
+ GT_STAN,
+ GT_SEED,
+ GT_MAZE,
+ GT_COAG,
+ GT_WALL,
+ GT_GNAR,
+ GT_REPL,
+ GT_MYST,
+ GT_LOTE,
+ GT_FRG2,
+ GT_STAR,
+ GT_FROG,
+ GT_BRAN,
+ };
+ golTypeCount = NGOL;
+ int * golTypesT = (int*)malloc((golTypeCount)*sizeof(int));
+ memcpy(golTypesT, golTypes, (golTypeCount)*sizeof(int));
+ return golTypesT;
+}
+
wall_type * LoadWalls(int & wallCount)
{
wall_type wtypes[] =
diff --git a/src/simulation/SimulationData.h b/src/simulation/SimulationData.h
index c093d5c..3e35af6 100644
--- a/src/simulation/SimulationData.h
+++ b/src/simulation/SimulationData.h
@@ -61,6 +61,58 @@
#define DECO_MULTIPLY 3
#define DECO_DIVIDE 4
+//Old IDs for GOL types
+#define GT_GOL 78
+#define GT_HLIF 79
+#define GT_ASIM 80
+#define GT_2x2 81
+#define GT_DANI 82
+#define GT_AMOE 83
+#define GT_MOVE 84
+#define GT_PGOL 85
+#define GT_DMOE 86
+#define GT_34 87
+#define GT_LLIF 88
+#define GT_STAN 89
+#define GT_SEED 134
+#define GT_MAZE 135
+#define GT_COAG 136
+#define GT_WALL 137
+#define GT_GNAR 138
+#define GT_REPL 139
+#define GT_MYST 140
+#define GT_LOTE 142
+#define GT_FRG2 143
+#define GT_STAR 144
+#define GT_FROG 145
+#define GT_BRAN 146
+
+//New IDs for GOL types
+#define NGT_GOL 0
+#define NGT_HLIF 1
+#define NGT_ASIM 2
+#define NGT_2x2 3
+#define NGT_DANI 4
+#define NGT_AMOE 5
+#define NGT_MOVE 6
+#define NGT_PGOL 7
+#define NGT_DMOE 8
+#define NGT_34 9
+#define NGT_LLIF 10
+#define NGT_STAN 11
+#define NGT_SEED 12
+#define NGT_MAZE 13
+#define NGT_COAG 14
+#define NGT_WALL 15
+#define NGT_GNAR 16
+#define NGT_REPL 17
+#define NGT_MYST 18
+#define NGT_LOTE 19
+#define NGT_FRG2 20
+#define NGT_STAR 21
+#define NGT_FROG 22
+#define NGT_BRAN 23
+
#ifndef SIMULATIONDATA_H_
#define SIMULATIONDATA_H_
@@ -84,6 +136,8 @@ struct wall_type;
gol_menu * LoadGOLMenu(int & golMenuCount);
+int * LoadGOLTypes(int & golTypeCount);
+
int * LoadGOLRules(int & golRuleCount);
wall_type * LoadWalls(int & wallCount);