--
[physik/morpheus.git] / defines.h
index 2e399a4..3473e30 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -5,20 +5,85 @@
  *
  */
 
+#ifdef USE_DFB_API
+#include <directfb.h>
+#endif
+
+#define NOT_SPECIFIED 0
+
 #define DEFAULT_X_SEG 50
 #define DEFAULT_Y_SEG 50
 #define DEFAULT_Z_SEG 100
 
-#define DEFAULT_SLOPE_CC 1
-#define DEFAULT_START_CC 0
+#define DEFAULT_SLOPE_NEL 1
+#define DEFAULT_START_NEL 0
+
+#define DEFAULT_A_P_RANGE 3
+#define DEFAULT_A_P_FAKTOR 0.2
+#define DEFAULT_A_P_P0 0.2
+
+#define DEFAULT_C_DIST_START_CONC 0
+#define DEFAULT_C_DIST_SLOPE 1
+#define DEFAULT_C_C0 500000
+
+#define DEFAULT_STEPS 5000
+
+#define RAND_BUF_SIZE 64*1048576 /* 64 MB */
 
 /* program defines, dont touch ;) */
 
+#define URAND_MAX 0xffffffff
+#define URAND_2BYTE_MAX 0xffff
+
+#define MAX_CHARS_RANDOM_FILE 64
+#define MAX_CHARS_SAVE_FILE 64
+#define MAX_CHARS_LOAD_FILE 64
+
+typedef unsigned int u32;
+typedef long long unsigned int u64;
+
+typedef struct __cell {
+ unsigned char status; /* amorph or cryst status */
+ u32 conc; /* c concentration */
+} cell;
+
 #ifdef DEBUG
- #define DEBUG 1
-#else
- #define DEBUG 0
+ #define DEBUG_IT 1
+#else 
+ #define DEBUG_IT 0
+#endif
+
+#define printfd(fmt,args...) if(DEBUG_IT) printf(fmt,##args);
+
+/* display stuff */
+typedef struct __display {
+ int step; /* display step */
+ u32 max_x,max_y,max_z; /* dimensions */
+ cell *cell_p; /* pointer to cell data */
+#ifdef USE_DFB_API
+ IDirectFB *dfb; /* pointer to dfb main construct */
+ IDirectFBSurface *primary_surface; /* pointer to dfb primary surface */
+ IDirectFBFont *font; /* the font */
+ IDirectFBInputDevice *keyboard; /* for keyboard input */
+ IDirectFBEventBuffer *keyboard_buffer; /* event buffer */
 #endif
+ int screen_height,screen_width; /* screen dimensions */
+} display;
+
+#define DEFAULT_DISPLAY_REF_RATE 100
+
+#define DISPLAY_X_FREE 15
+#define DISPLAY_Y_FREE 15
+
+// defined by Makefile now
+// #define DISPLAY_FONT "./decker.ttf"
 
-#define printfd(fmt,args...) if(DEBUG) printf(fmt,##args);
+#define MAX_TXT 20
+/* masks for u32 cell */
+#define AMORPH 0x01
+#define CRYSTAL 0x00
+#define NAMORPH 0xfe
+#define NCRYSTAL 0xff
+#define C_CONC_MASK 0xffffffff