summaryrefslogtreecommitdiff
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
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
-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:
49 49
50PLUGIN_HEADER 50PLUGIN_HEADER
51 51
52int font_width=4;
53int font_height=8;
54
52/* Where the board begins */ 55/* Where the board begins */
53#define XOFS 4 56#define XOFS 4
54#define YOFS 4 57#define YOFS 4
@@ -59,7 +62,7 @@ PLUGIN_HEADER
59#define MARGIN_C_W 0 62#define MARGIN_C_W 0
60#define MARGIN_C_H 2 63#define MARGIN_C_H 2
61#else 64#else
62#define MARGIN_W (XOFS*2 + 16) 65#define MARGIN_W (XOFS*2 + font_width*2)
63#define MARGIN_H (YOFS*2+1) 66#define MARGIN_H (YOFS*2+1)
64#define MARGIN_C_W 1 67#define MARGIN_C_W 1
65#define MARGIN_C_H 0 68#define MARGIN_C_H 0
@@ -112,7 +115,7 @@ PLUGIN_HEADER
112#define LEGEND_Y(lr) (CELL_Y(BOARD_SIZE+lr) + YOFS + 1) 115#define LEGEND_Y(lr) (CELL_Y(BOARD_SIZE+lr) + YOFS + 1)
113#else 116#else
114#define LEGEND_X(lc) (CELL_X(BOARD_SIZE+lc) + XOFS + 1) 117#define LEGEND_X(lc) (CELL_X(BOARD_SIZE+lc) + XOFS + 1)
115#define LEGEND_Y(lr) (CELL_Y(lr)) 118#define LEGEND_Y(lr) (CELL_Y(lr) > font_height*2 ? CELL_Y(lr) : font_height*(lr) + XOFS)
116#endif 119#endif
117 120
118 121
@@ -572,6 +575,9 @@ enum plugin_status plugin_start(const void *parameter) {
572 int w_cnt, b_cnt; 575 int w_cnt, b_cnt;
573 char msg_buf[30]; 576 char msg_buf[30];
574 577
578 /* Initialize Font Width and height */
579 rb->lcd_getstringsize("x", &font_width, &font_height);
580
575#ifdef HAVE_TOUCHSCREEN 581#ifdef HAVE_TOUCHSCREEN
576 rb->touchscreen_set_mode(TOUCHSCREEN_POINT); 582 rb->touchscreen_set_mode(TOUCHSCREEN_POINT);
577#endif 583#endif