added tile selection cursor for playing MM levels with keyboard or joystick
[rocksndiamonds.git] / src / libgame / system.h
index 2fd5e97b7fde94f66eaaf79d4da28450a4c0aeb0..a2226a78d8228e9b5229a43618122060eb734a7b 100644 (file)
 #endif
 
 /* values for touch control */
+#define TOUCH_CONTROL_OFF              "off"
 #define TOUCH_CONTROL_VIRTUAL_BUTTONS  "virtual_buttons"
 #define TOUCH_CONTROL_WIPE_GESTURES    "wipe_gestures"
 #define TOUCH_CONTROL_FOLLOW_FINGER    "follow_finger"
 
+#if defined(PLATFORM_ANDROID)
 #define TOUCH_CONTROL_DEFAULT          TOUCH_CONTROL_VIRTUAL_BUTTONS
+#else
+#define TOUCH_CONTROL_DEFAULT          TOUCH_CONTROL_OFF
+#endif
 
 #define TOUCH_MOVE_DISTANCE_DEFAULT    2
 #define TOUCH_DROP_DISTANCE_DEFAULT    5
 #define STYLE_NONE             0
 #define STYLE_ACCURATE_BORDERS (1 << 0)
 #define STYLE_INNER_CORNERS    (1 << 1)
+#define STYLE_REVERSE          (1 << 2)
 
 #define STYLE_DEFAULT          STYLE_NONE
 
@@ -870,8 +876,11 @@ struct FontBitmapInfo
 {
   Bitmap *bitmap;
 
-  int src_x, src_y;            /* start position of animation frames */
-  int width, height;           /* width/height of each animation frame */
+  int src_x, src_y;            /* start position of font characters */
+  int width, height;           /* width / height of font characters */
+
+  int offset_x;                        /* offset to next font character */
+  int offset_y;                        /* offset to next font character */
 
   int draw_xoffset;            /* offset for drawing font characters */
   int draw_yoffset;            /* offset for drawing font characters */
@@ -940,10 +949,21 @@ struct GfxInfo
   void (*draw_busy_anim_function)(void);
   void (*draw_global_anim_function)(int, int);
   void (*draw_global_border_function)(int);
+  void (*draw_tile_cursor_function)(int);
 
   int cursor_mode;
 };
 
+struct TileCursorInfo
+{
+  boolean enabled;             /* tile cursor generally enabled or disabled */
+  boolean active;              /* tile cursor activated (depending on game) */
+
+  int xpos, ypos;              /* tile cursor level playfield position */
+  int x, y;                    /* tile cursor current screen position */
+  int target_x, target_y;      /* tile cursor target screen position */
+};
+
 struct OverlayInfo
 {
   boolean enabled;             /* overlay generally enabled or disabled */
@@ -1196,6 +1216,11 @@ struct TreeInfo
   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 *program_title;    /* optional alternative text for program title */
+  char *program_copyright; /* optional alternative text for program copyright */
+  char *program_company;   /* optional alternative text for program company */
+
   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 */
@@ -1415,6 +1440,16 @@ struct TextPosInfo
   boolean draw_player;         /* special case for network player buttons */
   int sort_priority;           /* also used for suffix ".draw_order" */
   int id;
+
+  int direction;               /* needed for panel time/health graphics */
+  int class;                   /* needed for panel time/health graphics */
+  int style;                   /* needed for panel time/health graphics */
+};
+
+struct MouseActionInfo
+{
+  int lx, ly;
+  int button;
 };
 
 struct LevelStats
@@ -1433,6 +1468,7 @@ extern struct OptionInfo  options;
 extern struct VideoSystemInfo  video;
 extern struct AudioSystemInfo  audio;
 extern struct GfxInfo          gfx;
+extern struct TileCursorInfo   tile_cursor;
 extern struct OverlayInfo      overlay;
 extern struct AnimInfo         anim;
 extern struct ArtworkInfo      artwork;
@@ -1487,9 +1523,15 @@ void InitGfxClipRegion(boolean, int, int, int, int);
 void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void));
 void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int, int));
 void InitGfxDrawGlobalBorderFunction(void (*draw_global_border_function)(int));
+void InitGfxDrawTileCursorFunction(void (*draw_tile_cursor_function)(int));
 void InitGfxCustomArtworkInfo();
 void InitGfxOtherSettings();
+void InitTileCursorInfo();
 void InitOverlayInfo();
+void SetTileCursorEnabled(boolean);
+void SetTileCursorActive(boolean);
+void SetTileCursorTargetXY(int, int);
+void SetTileCursorXY(int, int);
 void SetOverlayEnabled(boolean);
 void SetOverlayActive(boolean);
 boolean GetOverlayActive();
@@ -1503,6 +1545,7 @@ void SetRedrawMaskFromArea(int, int, int, int);
 
 void LimitScreenUpdates(boolean);
 
+void InitVideoDefaults(void);
 void InitVideoDisplay(void);
 void CloseVideoDisplay(void);
 void InitVideoBuffer(int, int, int, boolean);