added option to draw virtual buttons outlined
[rocksndiamonds.git] / src / libgame / system.h
index 480ef0d426820e4719effd45d914d909fa171c49..3fcdf6c72177e386d8b720072824bf1d9b04ea26 100644 (file)
 
 #define TOUCH_MOVE_DISTANCE_DEFAULT    2
 #define TOUCH_DROP_DISTANCE_DEFAULT    5
+#define TOUCH_TRANSPARENCY_DEFAULT     50
 
+#define ALPHA_FROM_TRANSPARENCY(x)     ((100 - x) * SDL_ALPHA_OPAQUE / 100)
+#define ALPHA_FADING_STEPSIZE(x)       ((x) / 25)
 
 /* values for special settings for mobile devices */
 #if defined(PLATFORM_ANDROID)
 #define MIN_GRID_YSIZE                 3
 #define MAX_GRID_XSIZE                 32
 #define MAX_GRID_YSIZE                 32
-#define GRID_REAL_WIDTH                        MAX(video.screen_width, \
-                                           video.screen_height)
-#define GRID_REAL_HEIGHT               MIN(video.screen_width, \
-                                           video.screen_height)
+#define GRID_REAL_WIDTH                        MAX(1, MAX(video.screen_width,  \
+                                                  video.screen_height))
+#define GRID_REAL_HEIGHT               MAX(1, MIN(video.screen_width,  \
+                                                  video.screen_height))
 #define DEFAULT_GRID_XSIZE_0           18
 #define DEFAULT_GRID_YSIZE_0           MIN(MAX(MIN_GRID_YSIZE,         \
                                                DEFAULT_GRID_XSIZE_0 *  \
                                                GRID_REAL_HEIGHT),      \
                                            MAX_GRID_YSIZE)
 
-#define DEFAULT_GRID_XSIZE(n)          (n == 0 ? DEFAULT_GRID_XSIZE_0 : \
+#define DEFAULT_GRID_XSIZE(n)          ((n) == 0 ? DEFAULT_GRID_XSIZE_0 : \
                                         DEFAULT_GRID_XSIZE_1)
-#define DEFAULT_GRID_YSIZE(n)          (n == 0 ? DEFAULT_GRID_YSIZE_0 : \
+#define DEFAULT_GRID_YSIZE(n)          ((n) == 0 ? DEFAULT_GRID_YSIZE_0 : \
                                         DEFAULT_GRID_YSIZE_1)
 
 #define GRID_ACTIVE_NR()               (video.screen_width >   \
@@ -1017,13 +1020,11 @@ struct OverlayInfo
 
   boolean show_grid;
 
-  int grid_xsize_all[2];
-  int grid_ysize_all[2];
   int grid_xsize;
   int grid_ysize;
 
-  char grid_button_all[2][MAX_GRID_XSIZE][MAX_GRID_YSIZE];
   char grid_button[MAX_GRID_XSIZE][MAX_GRID_YSIZE];
+
   char grid_button_highlight;
 };
 
@@ -1053,6 +1054,16 @@ struct SetupTouchInfo
   char *control_type;
   int move_distance;
   int drop_distance;
+
+  int grid_xsize[2];
+  int grid_ysize[2];
+
+  char grid_button[2][MAX_GRID_XSIZE][MAX_GRID_YSIZE];
+
+  int transparency;            /* in percent (0 == opaque, 100 == invisible) */
+  boolean draw_outlined;
+
+  boolean grid_initialized;
 };
 
 struct SetupInputInfo