summaryrefslogtreecommitdiffstats
path: root/apps/plugins/reversi/reversi-gui.c
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-08-02 15:44:52 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-08-02 15:44:52 +0000
commit1060326f027292b0760666180019359fc6e0240f (patch)
tree36c8526d082342e26ddd7aae71ab66b086a37349 /apps/plugins/reversi/reversi-gui.c
parent0a51d3915cba09a95ee13185a1a2c9e15fd63545 (diff)
downloadrockbox-1060326f027292b0760666180019359fc6e0240f.tar.gz
rockbox-1060326f027292b0760666180019359fc6e0240f.zip
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
Diffstat (limited to 'apps/plugins/reversi/reversi-gui.c')
-rw-r--r--apps/plugins/reversi/reversi-gui.c10
1 files changed, 8 insertions, 2 deletions
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