added save/load feature
[physik/morpheus.git] / defines.h
1 /*
2  * morpheus - defines.h
3  *
4  * default parameters and program defines
5  *
6  */
7
8 #ifdef USE_DFB_API
9 #include <directfb.h>
10 #endif
11
12 #define NOT_SPECIFIED 0
13
14 #define DEFAULT_X_SEG 50
15 #define DEFAULT_Y_SEG 50
16 #define DEFAULT_Z_SEG 100
17
18 #define DEFAULT_SLOPE_NEL 1
19 #define DEFAULT_START_NEL 0
20
21 #define DEFAULT_A_P_RANGE 3
22 #define DEFAULT_A_P_FAKTOR 0.2
23 #define DEFAULT_A_P_P0 0.2
24
25 #define DEFAULT_C_DIST_START_CONC 0
26 #define DEFAULT_C_DIST_SLOPE 1
27 #define DEFAULT_C_C0 500000
28
29 #define DEFAULT_STEPS 5000
30
31 #define RAND_BUF_SIZE 64*1048576 /* 64 MB */
32
33 /* program defines, dont touch ;) */
34
35 #define URAND_MAX 0xffffffff
36 #define URAND_2BYTE_MAX 0xffff
37
38 #define MAX_CHARS_RANDOM_FILE 64
39 #define MAX_CHARS_SAVE_FILE 64
40 #define MAX_CHARS_LOAD_FILE 64
41
42 typedef unsigned int u32;
43 typedef long long unsigned int u64;
44
45 typedef struct __cell {
46  unsigned char status; /* amorph or cryst status */
47  u32 conc; /* c concentration */
48 } cell;
49
50 #ifdef DEBUG
51  #define DEBUG_IT 1
52 #else 
53  #define DEBUG_IT 0
54 #endif
55
56 #define printfd(fmt,args...) if(DEBUG_IT) printf(fmt,##args);
57
58 /* display stuff */
59 typedef struct __display {
60  int step; /* display step */
61  u32 max_x,max_y,max_z; /* dimensions */
62  cell *cell_p; /* pointer to cell data */
63 #ifdef USE_DFB_API
64  IDirectFB *dfb; /* pointer to dfb main construct */
65  IDirectFBSurface *primary_surface; /* pointer to dfb primary surface */
66  IDirectFBFont *font; /* the font */
67  IDirectFBInputDevice *keyboard; /* for keyboard input */
68  IDirectFBEventBuffer *keyboard_buffer; /* event buffer */
69 #endif
70  int screen_height,screen_width; /* screen dimensions */
71 } display;
72
73 #define DEFAULT_DISPLAY_REF_RATE 100
74
75 #define DISPLAY_X_FREE 15
76 #define DISPLAY_Y_FREE 15
77
78 // defined by Makefile now
79 // #define DISPLAY_FONT "./decker.ttf"
80
81 #define MAX_TXT 20
82  
83 /* masks for u32 cell */
84 #define AMORPH 0x01
85 #define CRYSTAL 0x00
86 #define NAMORPH 0xfe
87 #define NCRYSTAL 0xff
88 #define C_CONC_MASK 0xffffffff
89