From 1060326f027292b0760666180019359fc6e0240f Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Sun, 2 Aug 2009 15:44:52 +0000 Subject: Reversi: Implement dynamic legend/board sixing when necessary for landscape targets based on font size git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22115 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/reversi/reversi-gui.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'apps/plugins/reversi/reversi-gui.c') diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c index fa20e46bb6..c4c7506f2a 100644 --- a/apps/plugins/reversi/reversi-gui.c +++ b/apps/plugins/reversi/reversi-gui.c @@ -49,6 +49,9 @@ further options: PLUGIN_HEADER +int font_width=4; +int font_height=8; + /* Where the board begins */ #define XOFS 4 #define YOFS 4 @@ -59,7 +62,7 @@ PLUGIN_HEADER #define MARGIN_C_W 0 #define MARGIN_C_H 2 #else -#define MARGIN_W (XOFS*2 + 16) +#define MARGIN_W (XOFS*2 + font_width*2) #define MARGIN_H (YOFS*2+1) #define MARGIN_C_W 1 #define MARGIN_C_H 0 @@ -112,7 +115,7 @@ PLUGIN_HEADER #define LEGEND_Y(lr) (CELL_Y(BOARD_SIZE+lr) + YOFS + 1) #else #define LEGEND_X(lc) (CELL_X(BOARD_SIZE+lc) + XOFS + 1) -#define LEGEND_Y(lr) (CELL_Y(lr)) +#define LEGEND_Y(lr) (CELL_Y(lr) > font_height*2 ? CELL_Y(lr) : font_height*(lr) + XOFS) #endif @@ -572,6 +575,9 @@ enum plugin_status plugin_start(const void *parameter) { int w_cnt, b_cnt; char msg_buf[30]; + /* Initialize Font Width and height */ + rb->lcd_getstringsize("x", &font_width, &font_height); + #ifdef HAVE_TOUCHSCREEN rb->touchscreen_set_mode(TOUCHSCREEN_POINT); #endif -- cgit v1.2.3