diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index e6e644584..d27230bcc 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -952,5 +952,8 @@ void GameView::OnDraw() else sampleInfo << "Empty"; - g->drawtext(XRES+BARSIZE-(10+Graphics::textwidth((char*)sampleInfo.str().c_str())), 5, (const char*)sampleInfo.str().c_str(), 255, 255, 255, 255); + if(sample.ctype && sample.ctype>0 && sample.ctypeElementResolve(sample.ctype); + + g->drawtext(XRES+BARSIZE-(10+Graphics::textwidth((char*)sampleInfo.str().c_str())), 10, (const char*)sampleInfo.str().c_str(), 255, 255, 255, 255); } diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index b52907bbc..764d29dfc 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 8dd21e00b..da0cad647 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 c093d5c62..3e35af694 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);