rnd-20070310-1-src
[rocksndiamonds.git] / src / libgame / system.h
index cc2493115f5e984e5ad7a3137a01b107f4d83599..55caac9ae1a5b5ba86886986c874ca9e3230dac1 100644 (file)
 /* values for special (non game element) animation modes */
 #define ANIM_HORIZONTAL                (1 << 10)
 #define ANIM_VERTICAL          (1 << 11)
-#define ANIM_STATIC_PANEL      (1 << 12)
+#define ANIM_CENTERED          (1 << 12)
+#define ANIM_STATIC_PANEL      (1 << 13)
+#define ANIM_FADE              (1 << 14)
+#define ANIM_CROSSFADE         (1 << 15)
 
 #define ANIM_DEFAULT           ANIM_LOOP
 
+/* values for text alignment */
+#define ALIGN_LEFT             (1 << 0)
+#define ALIGN_RIGHT            (1 << 1)
+#define ALIGN_CENTER           (1 << 2)
+
+#define ALIGN_DEFAULT          ALIGN_LEFT
+
+#define ALIGNED_XPOS(x,w,a)    ((a) == ALIGN_CENTER ? (x) - (w) / 2 :  \
+                                (a) == ALIGN_RIGHT  ? (x) - (w) : (x))
+#define ALIGNED_MENU_XPOS(p)   ALIGNED_XPOS((p)->x, (p)->width, (p)->align)
+#define ALIGNED_MENU_YPOS(p)   ((p)->y)
+
 /* values for redraw_mask */
 #define REDRAW_NONE            (0)
 #define REDRAW_ALL             (1 << 0)
 
 /* values for mouse cursor */
 #define CURSOR_DEFAULT         0
-#define CURSOR_PLAYFIELD       1
+#define CURSOR_NONE            1
+#define CURSOR_PLAYFIELD       2
 
 /* fundamental game speed values */
 #define ONE_SECOND_DELAY       1000    /* delay value for one second */
 #define TAPES_DIRECTORY                "tapes"
 #define SCORES_DIRECTORY       "scores"
 #define DOCS_DIRECTORY         "docs"
+#define CACHE_DIRECTORY                "cache"
 
 #if !defined(PLATFORM_MSDOS)
 #define GFX_CLASSIC_SUBDIR     "gfx_classic"
 #define GRAPHICSINFO_FILENAME  "graphicsinfo.conf"
 #define SOUNDSINFO_FILENAME    "soundsinfo.conf"
 #define MUSICINFO_FILENAME     "musicinfo.conf"
+#define ARTWORKINFO_CACHE_FILE "artworkinfo.cache"
 #define LEVELFILE_EXTENSION    "level"
 #define TAPEFILE_EXTENSION     "tape"
 #define SCOREFILE_EXTENSION    "score"
 #define GRAPHICSINFO_FILENAME  "gfxinfo.cnf"
 #define SOUNDSINFO_FILENAME    "sndinfo.cnf"
 #define MUSICINFO_FILENAME     "musinfo.cnf"
+#define ARTWORKINFO_CACHE_FILE "artinfo.cac"
 #define LEVELFILE_EXTENSION    "lvl"
 #define TAPEFILE_EXTENSION     "tap"
 #define SCOREFILE_EXTENSION    "sco"
@@ -710,6 +729,7 @@ struct SetupEditorInfo
   boolean el_diamond_caves;
   boolean el_dx_boulderdash;
   boolean el_chars;
+  boolean el_steel_chars;
   boolean el_custom;
   boolean el_user_defined;
   boolean el_dynamic;
@@ -733,6 +753,7 @@ struct SetupEditorCascadeInfo
   boolean el_dc;
   boolean el_dx;
   boolean el_chars;
+  boolean el_steel_chars;
   boolean el_ce;
   boolean el_ge;
   boolean el_ref;
@@ -752,6 +773,7 @@ struct SetupShortcutInfo
 
 struct SetupSystemInfo
 {
+  char *sdl_videodriver;
   char *sdl_audiodriver;
   int audio_fragment_size;
 };
@@ -769,7 +791,7 @@ struct SetupInfo
   boolean direct_draw;         /* !double_buffering (redundant!) */
   boolean scroll_delay;
   boolean soft_scrolling;
-  boolean fading;
+  boolean fade_screens;
   boolean autorecord;
   boolean show_titlescreen;
   boolean quick_doors;
@@ -784,6 +806,7 @@ struct SetupInfo
   boolean quick_switch;
   boolean input_on_focus;
   boolean prefer_aga_graphics;
+  int game_frame_delay;
 
   char *graphics_set;
   char *sounds_set;
@@ -821,8 +844,10 @@ struct TreeInfo
   char *name;          /* tree info name, as displayed in selection menues */
   char *name_sorting;  /* optional sorting name for correct name sorting */
   char *author;                /* level or artwork author name */
+  char *year;          /* optional year of creation for levels or artwork */
   char *imported_from; /* optional comment for imported levels or artwork */
   char *imported_by;   /* optional comment for imported levels or artwork */
+  char *tested_by;     /* optional comment to name people who tested a set */
 
   char *graphics_set_ecs; /* special EMC custom graphics set (ECS graphics) */
   char *graphics_set_aga; /* special EMC custom graphics set (AGA graphics) */
@@ -984,6 +1009,27 @@ struct XY
   int x, y;
 };
 
+struct Rect
+{
+  int x, y;
+  int width, height;
+};
+
+struct MenuPosInfo
+{
+  int x, y;
+  int width, height;
+  int align;
+};
+
+struct TextPosInfo
+{
+  int x, y;
+  int width, height;
+  int align;
+  int chars;
+};
+
 
 /* ========================================================================= */
 /* exported variables                                                        */
@@ -1037,17 +1083,19 @@ void InitGfxDoor2Info(int, int, int, int);
 void InitGfxScrollbufferInfo(int, int);
 void SetDrawDeactivationMask(int);
 void SetDrawBackgroundMask(int);
+void SetWindowBackgroundBitmap(Bitmap *);
 void SetMainBackgroundBitmap(Bitmap *);
 void SetDoorBackgroundBitmap(Bitmap *);
 
 void InitVideoDisplay(void);
 void CloseVideoDisplay(void);
-void InitVideoBuffer(DrawBuffer **,DrawWindow **, int,int,int, boolean);
+void InitVideoBuffer(int, int, int, boolean);
 Bitmap *CreateBitmapStruct(void);
 Bitmap *CreateBitmap(int, int, int);
 void FreeBitmap(Bitmap *);
 void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int);
-void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int);
+void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int,
+                  void (*draw_border_function)(void));
 void FillRectangle(Bitmap *, int, int, int, int, Pixel);
 void ClearRectangle(Bitmap *, int, int, int, int);
 void ClearRectangleOnBackground(Bitmap *, int, int, int, int);