X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=480ef0d426820e4719effd45d914d909fa171c49;hb=164e6c72eba4eac8002bd6b334579e78e5010d0f;hp=6bf12a6670d2a58f781810a7a1099e7ecac7713d;hpb=38568f7dfac13f7a53f1d8751db2a63b64c935e8;p=rocksndiamonds.git diff --git a/src/libgame/system.h b/src/libgame/system.h index 6bf12a66..480ef0d4 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -106,7 +106,6 @@ #define SCREEN_KEYBOARD_POS(h) ((h) / 2) #endif - /* default input keys */ #define DEFAULT_KEY_LEFT KSYM_Left #define DEFAULT_KEY_RIGHT KSYM_Right @@ -452,6 +451,45 @@ #define MAX_GLOBAL_ANIMS 32 #define MAX_GLOBAL_ANIM_PARTS 32 +/* minimum/maximum/default x/y grid size for virtual buttons */ +#define MIN_GRID_XSIZE 3 +#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 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 ' ' +#define CHAR_GRID_BUTTON_LEFT '<' +#define CHAR_GRID_BUTTON_RIGHT '>' +#define CHAR_GRID_BUTTON_UP '^' +#define CHAR_GRID_BUTTON_DOWN 'v' +#define CHAR_GRID_BUTTON_SNAP '1' +#define CHAR_GRID_BUTTON_DROP '2' + /* default name for empty highscore entry */ #define EMPTY_PLAYER_NAME "no name" @@ -978,6 +1016,15 @@ struct OverlayInfo boolean active; /* overlay activated (depending on game mode) */ 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; }; struct JoystickInfo