X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=88df586da83d553995800bd2767552197b33418e;hb=22c1545e660b56b81728829aec43de128934ae04;hp=06a47c3c685fe17fc7eda1692843d7d8c51fa080;hpb=969000b44b047ef2d77619bd3882a3f09eb1787d;p=rocksndiamonds.git diff --git a/src/libgame/system.h b/src/libgame/system.h index 06a47c3c..88df586d 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -96,7 +96,10 @@ #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) @@ -456,12 +459,30 @@ #define MIN_GRID_YSIZE 3 #define MAX_GRID_XSIZE 32 #define MAX_GRID_YSIZE 32 -#define DEFAULT_GRID_XSIZE 18 -#define DEFAULT_GRID_YSIZE MIN(MAX(MIN_GRID_YSIZE, \ - DEFAULT_GRID_XSIZE * \ - video.screen_height / \ - video.screen_width), \ +#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 / \ + GRID_REAL_WIDTH), \ MAX_GRID_YSIZE) +#define DEFAULT_GRID_XSIZE_1 13 +#define DEFAULT_GRID_YSIZE_1 MIN(MAX(MIN_GRID_YSIZE, \ + DEFAULT_GRID_XSIZE_1 * \ + GRID_REAL_WIDTH / \ + GRID_REAL_HEIGHT), \ + MAX_GRID_YSIZE) + +#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 : \ + DEFAULT_GRID_YSIZE_1) + +#define GRID_ACTIVE_NR() (video.screen_width > \ + video.screen_height ? 0 : 1) /* values for grid button characters for virtual buttons */ #define CHAR_GRID_BUTTON_NONE ' ' @@ -998,7 +1019,6 @@ struct OverlayInfo boolean active; /* overlay activated (depending on game mode) */ boolean show_grid; - boolean show_grid_buttons; int grid_xsize; int grid_ysize; @@ -1033,6 +1053,15 @@ 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 grid_initialized; }; struct SetupInputInfo