-
[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_START_CONC 5000
26 #define DEFAULT_C_SLOPE 1
27
28 #define DEFAULT_STEPS 5000
29
30 /* program defines, dont touch ;) */
31
32 #define URAND_MAX 0xffffffff
33 #define URAND_2BYTE_MAX 0xffff
34
35 typedef unsigned int u32;
36 typedef long long unsigned int u64;
37
38 typedef struct __cell {
39  unsigned char status; /* amorph or cryst status */
40  double conc; /* c concentration */
41 } cell;
42
43 #ifdef DEBUG
44  #define DEBUG_IT 1
45 #else 
46  #define DEBUG_IT 0
47 #endif
48
49 #define printfd(fmt,args...) if(DEBUG_IT) printf(fmt,##args);
50
51 /* display stuff */
52 typedef struct __display {
53  u32 max_x,max_y,max_z; /* dimensions */
54  cell *cell_p; /* pointer to cell data */
55 #ifdef USE_DFB_API
56  IDirectFB *dfb; /* pointer to dfb main construct */
57  IDirectFBSurface *primary_surface; /* pointer to dfb primary surface */
58  IDirectFBFont *font; /* the font */
59  IDirectFBInputDevice *keyboard; /* for keyboard input */
60  IDirectFBEventBuffer *keyboard_buffer; /* event buffer */
61 #endif
62  int screen_height,screen_width; /* screen dimensions */
63 } display;
64
65 #define DEFAULT_DISPLAY_REF_RATE 100
66
67 #define DISPLAY_X_FREE 15
68 #define DISPLAY_Y_FREE 15
69
70 #define DISPLAY_FONT "/usr/share/DFBSee/decker.ttf"
71 #define MAX_TXT 20
72  
73 /* masks for u32 cell */
74 #define AMORPH 0x01
75 #define CRYSTAL 0x00
76 #define NAMORPH 0xfe
77 #define NCRYSTAL 0xff
78 #define C_CONC_MASK 0xffffffff
79