1 #ifndef ELEMENTS_H_
2 #define ELEMENTS_H_
3 
4 #include "Config.h"
5 //#include "Simulation.h"
6 
7 #define R_TEMP 22
8 #define MAX_TEMP 9999
9 #define MIN_TEMP 0
10 #define O_MAX_TEMP 3500
11 #define O_MIN_TEMP -273
12 
13 #define TYPE_PART			0x00001  //1 Powders
14 #define TYPE_LIQUID			0x00002  //2 Liquids
15 #define TYPE_SOLID			0x00004  //4 Solids
16 #define TYPE_GAS			0x00008  //8 Gases (Includes plasma)
17 #define TYPE_ENERGY			0x00010  //16 Energy (Thunder, Light, Neutrons etc.)
18 #define STATE_FLAGS			0x0001F
19 #define PROP_CONDUCTS		0x00020  //32 Conducts electricity
20 #define PROP_BLACK			0x00040  //64 Absorbs Photons (not currently implemented or used, a photwl attribute might be better)
21 #define PROP_NEUTPENETRATE	0x00080  //128 Penetrated by neutrons
22 #define PROP_NEUTABSORB		0x00100  //256 Absorbs neutrons, reflect is default
23 #define PROP_NEUTPASS		0x00200  //512 Neutrons pass through, such as with glass
24 #define PROP_DEADLY			0x00400  //1024 Is deadly for stickman
25 #define PROP_HOT_GLOW		0x00800  //2048 Hot Metal Glow
26 #define PROP_LIFE			0x01000  //4096 Is a GoL type
27 #define PROP_RADIOACTIVE	0x02000  //8192 Radioactive
28 #define PROP_LIFE_DEC		0x04000  //2^14 Life decreases by one every frame if > zero
29 #define PROP_LIFE_KILL		0x08000  //2^15 Kill when life value is <= zero
30 #define PROP_LIFE_KILL_DEC	0x10000  //2^16 Kill when life value is decremented to <= zero
31 #define PROP_SPARKSETTLE	0x20000  //2^17 Allow Sparks/Embers to settle
32 #define PROP_NOAMBHEAT		0x40000  //2^18 Don't transfer or receive heat from ambient heat.
33 #define PROP_NOCTYPEDRAW	0x100000 // 2^20 When this element is drawn upon with, do not set ctype (like BCLN for CLNE)
34 
35 #define FLAG_STAGNANT	0x1
36 #define FLAG_SKIPMOVE  0x2 // skip movement for one frame, only implemented for PHOT
37 //#define FLAG_WATEREQUAL 0x4 //if a liquid was already checked during equalization
38 #define FLAG_MOVABLE  0x8 // compatibility with old saves (moving SPNG), only applies to SPNG
39 #define FLAG_PHOTDECO  0x8 // compatibility with old saves (decorated photons), only applies to PHOT. Having the same value as FLAG_MOVABLE is fine because they apply to different elements, and this saves space for future flags,
40 
41 
42 #define UPDATE_FUNC_ARGS Simulation* sim, int i, int x, int y, int surround_space, int nt, Particle *parts, int pmap[YRES][XRES]
43 #define UPDATE_FUNC_SUBCALL_ARGS sim, i, x, y, surround_space, nt, parts, pmap
44 
45 #define GRAPHICS_FUNC_ARGS Renderer * ren, Particle *cpart, int nx, int ny, int *pixel_mode, int* cola, int *colr, int *colg, int *colb, int *firea, int *firer, int *fireg, int *fireb
46 #define GRAPHICS_FUNC_SUBCALL_ARGS ren, cpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb
47 
48 #define ELEMENT_CREATE_FUNC_ARGS Simulation *sim, int i, int x, int y, int t, int v
49 
50 #define ELEMENT_CREATE_ALLOWED_FUNC_ARGS Simulation *sim, int i, int x, int y, int t
51 
52 #define ELEMENT_CHANGETYPE_FUNC_ARGS Simulation *sim, int i, int x, int y, int from, int to
53 
54 #define CTYPEDRAW_FUNC_ARGS Simulation *sim, int i, int t, int v
55 #define CTYPEDRAW_FUNC_SUBCALL_ARGS sim, i, t, v
56 
57 #define BOUNDS_CHECK true
58 
59 #define OLD_PT_WIND 147
60 
61 // Change this to change the amount of bits used to store type in pmap (and a few elements such as PIPE and CRAY)
62 #define PMAPBITS 9
63 #define PMAPMASK ((1<<PMAPBITS)-1)
64 #define ID(r) ((r)>>PMAPBITS)
65 #define TYP(r) ((r)&PMAPMASK)
66 #define PMAP(id, typ) ((id)<<PMAPBITS | ((typ)&PMAPMASK))
67 #define PMAPID(id) ((id)<<PMAPBITS)
68 
69 #define PT_NUM	(1<<PMAPBITS)
70 
71 struct playerst;
72 
73 
74 #endif /* ELEMENTS_H_ */
75