{ "111222", " vv " },
{ "111222", " vv " }
};
- int min_xsize, min_ysize;
- int startx, starty;
- int x, y;
-
- min_xsize = MIN(6, DEFAULT_GRID_XSIZE);
- min_ysize = MIN(6, DEFAULT_GRID_YSIZE);
-
- startx = DEFAULT_GRID_XSIZE - min_xsize;
- starty = DEFAULT_GRID_YSIZE - min_ysize;
+ int nr = GRID_ACTIVE_NR();
+ int i, x, y;
overlay.enabled = FALSE;
overlay.active = FALSE;
overlay.show_grid = FALSE;
overlay.show_grid_buttons = FALSE;
- overlay.grid_xsize = DEFAULT_GRID_XSIZE;
- overlay.grid_ysize = DEFAULT_GRID_YSIZE;
+ for (i = 0; i < 2; i++)
+ {
+ int grid_xsize = DEFAULT_GRID_XSIZE(i);
+ int grid_ysize = DEFAULT_GRID_YSIZE(i);
+ int min_xsize = MIN(6, grid_xsize);
+ int min_ysize = MIN(6, grid_ysize);
+ int startx = grid_xsize - min_xsize;
+ int starty = grid_ysize - min_ysize;
+
+ overlay.grid_xsize_all[i] = grid_xsize;
+ overlay.grid_ysize_all[i] = grid_ysize;
+
+ for (x = 0; x < MAX_GRID_XSIZE; x++)
+ for (y = 0; y < MAX_GRID_YSIZE; y++)
+ overlay.grid_button_all[i][x][y] = CHAR_GRID_BUTTON_NONE;
+
+ for (x = 0; x < min_xsize; x++)
+ for (y = 0; y < min_ysize; y++)
+ overlay.grid_button_all[i][x][starty + y] =
+ default_grid_button[y][0][x];
+
+ for (x = 0; x < min_xsize; x++)
+ for (y = 0; y < min_ysize; y++)
+ overlay.grid_button_all[i][startx + x][starty + y] =
+ default_grid_button[y][1][x];
+ }
+
+ overlay.grid_xsize = overlay.grid_xsize_all[nr];
+ overlay.grid_ysize = overlay.grid_ysize_all[nr];
for (x = 0; x < MAX_GRID_XSIZE; x++)
for (y = 0; y < MAX_GRID_YSIZE; y++)
- overlay.grid_button[x][y] = CHAR_GRID_BUTTON_NONE;
-
- for (x = 0; x < min_xsize; x++)
- for (y = 0; y < min_ysize; y++)
- overlay.grid_button[x][starty + y] =
- default_grid_button[y][0][x];
-
- for (x = 0; x < min_xsize; x++)
- for (y = 0; y < min_ysize; y++)
- overlay.grid_button[startx + x][starty + y] =
- default_grid_button[y][1][x];
+ overlay.grid_button[x][y] = overlay.grid_button_all[nr][x][y];
overlay.grid_button_highlight = CHAR_GRID_BUTTON_NONE;
#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(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 ' '
boolean show_grid;
boolean show_grid_buttons;
+ 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;
};
char grid_button_old[MAX_GRID_XSIZE][MAX_GRID_YSIZE];
char grid_button_tmp[MAX_GRID_XSIZE][MAX_GRID_YSIZE];
boolean set_grid_button = FALSE;
+ int nr = GRID_ACTIVE_NR();
int x, y;
for (x = 0; x < MAX_GRID_XSIZE; x++)
BackToFront();
}
+ for (x = 0; x < MAX_GRID_XSIZE; x++)
+ for (y = 0; y < MAX_GRID_YSIZE; y++)
+ overlay.grid_button_all[nr][x][y] = overlay.grid_button[x][y];
+
overlay.grid_button_highlight = CHAR_GRID_BUTTON_NONE;
SetOverlayShowGrid(FALSE);