1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
#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()
{
Identifier = "DEFAULT_PT_LIFE";
Name = "LIFE";
Colour = PIXPACK(0x0CAC00);
MenuVisible = 0;
MenuSection = SC_LIFE;
Enabled = 1;
Advection = 0.0f;
AirDrag = 0.00f * CFDS;
AirLoss = 0.90f;
Loss = 0.00f;
Collision = 0.0f;
Gravity = 0.0f;
Diffusion = 0.00f;
HotAir = 0.000f * CFDS;
Falldown = 0;
Flammable = 0;
Explosive = 0;
Meltable = 0;
Hardness = 0;
Weight = 100;
Temperature = 9000.0f;
HeatConduct = 40;
Description = "Game Of Life! B3/S23";
State = ST_NONE;
Properties = TYPE_SOLID|PROP_LIFE;
LowPressure = IPL;
LowPressureTransition = NT;
HighPressure = IPH;
HighPressureTransition = NT;
LowTemperature = ITL;
LowTemperatureTransition = NT;
HighTemperature = ITH;
HighTemperatureTransition = NT;
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)
{
pixel pc;
if (cpart->ctype==NGT_LOTE)//colors for life states
{
if (cpart->tmp==2)
pc = PIXRGB(255, 128, 0);
else if (cpart->tmp==1)
pc = PIXRGB(255, 255, 0);
else
pc = PIXRGB(255, 0, 0);
}
else if (cpart->ctype==NGT_FRG2)//colors for life states
{
if (cpart->tmp==2)
pc = PIXRGB(0, 100, 50);
else
pc = PIXRGB(0, 255, 90);
}
else if (cpart->ctype==NGT_STAR)//colors for life states
{
if (cpart->tmp==4)
pc = PIXRGB(0, 0, 128);
else if (cpart->tmp==3)
pc = PIXRGB(0, 0, 150);
else if (cpart->tmp==2)
pc = PIXRGB(0, 0, 190);
else if (cpart->tmp==1)
pc = PIXRGB(0, 0, 230);
else
pc = PIXRGB(0, 0, 70);
}
else if (cpart->ctype==NGT_FROG)//colors for life states
{
if (cpart->tmp==2)
pc = PIXRGB(0, 100, 0);
else
pc = PIXRGB(0, 255, 0);
}
else if (cpart->ctype==NGT_BRAN)//colors for life states
{
if (cpart->tmp==1)
pc = PIXRGB(150, 150, 0);
else
pc = PIXRGB(255, 255, 0);
} else {
pc = Element_GOL_colour[cpart->ctype];
}
*colr = PIXR(pc);
*colg = PIXG(pc);
*colb = PIXB(pc);
return 0;
}
Element_LIFE::~Element_LIFE() {}
|