diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2012-01-30 00:17:47 +0100 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2012-01-30 00:17:47 +0100 |
| commit | 82223882526cb40b1e368f0fae60b5777577f48b (patch) | |
| tree | 8deb14e7a461ec138c133721488ff50b39cb9555 | |
| parent | d216cc7654163938c0a43d4f2e4a67b0117bb2c8 (diff) | |
| download | rockbox-82223882526cb40b1e368f0fae60b5777577f48b.zip rockbox-82223882526cb40b1e368f0fae60b5777577f48b.tar.gz rockbox-82223882526cb40b1e368f0fae60b5777577f48b.tar.bz2 rockbox-82223882526cb40b1e368f0fae60b5777577f48b.tar.xz | |
reversi: Fix viewport initialization. Improve button layout for portrait. Enable for toucschreen RaaA.
Change-Id: Ief0937693dc2056ed442f68a5ab76a006eaa1209
| -rw-r--r-- | apps/plugins/SUBDIRS.app_build | 2 | ||||
| -rw-r--r-- | apps/plugins/reversi/reversi-gui.c | 22 | ||||
| -rw-r--r-- | apps/plugins/reversi/reversi-gui.h | 13 |
3 files changed, 23 insertions, 14 deletions
diff --git a/apps/plugins/SUBDIRS.app_build b/apps/plugins/SUBDIRS.app_build index e9f9253..934474a 100644 --- a/apps/plugins/SUBDIRS.app_build +++ b/apps/plugins/SUBDIRS.app_build @@ -13,6 +13,8 @@ lua fft #endif +reversi + #ifdef HAVE_TAGCACHE pictureflow #endif diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c index e6613d6..e59a91e 100644 --- a/apps/plugins/reversi/reversi-gui.c +++ b/apps/plugins/reversi/reversi-gui.c @@ -167,14 +167,14 @@ static bool game_finished; #define B_QUIT_H (LCD_HEIGHT/4) #else /* Define Menu button x, y, width, height */ -#define B_MENU_X (LCD_WIDTH/2) +#define B_MENU_X (LCD_WIDTH/2 - XOFS) #define B_MENU_Y (CELL_HEIGHT*BOARD_SIZE+YOFS*2) -#define B_MENU_W (LCD_WIDTH/4) +#define B_MENU_W (LCD_WIDTH/4 - XOFS) #define B_MENU_H (2*CELL_HEIGHT) /* Define Quit Button x, y, width, height */ -#define B_QUIT_X (LCD_WIDTH-LCD_WIDTH/4) +#define B_QUIT_X (B_MENU_X + B_MENU_W + 1) #define B_QUIT_Y (CELL_HEIGHT*BOARD_SIZE+YOFS*2) -#define B_QUIT_W (LCD_WIDTH/4) +#define B_QUIT_W (LCD_WIDTH/4 - XOFS) #define B_QUIT_H (2*CELL_HEIGHT) #endif @@ -316,22 +316,16 @@ static void reversi_gui_display_board(void) { y = LEGEND_Y(0); reversi_gui_draw_cell(x, y+(LEGEND_Y(1)-LEGEND_Y(0))/2-CELL_WIDTH/2, BLACK); rb->snprintf(buf, sizeof(buf), "%01d", c); + + rb->viewport_set_defaults(&tempvp, SCREEN_MAIN); tempvp.x=x+CELL_WIDTH+2; tempvp.y=y; tempvp.width=LCD_WIDTH-tempvp.x; tempvp.height=LEGEND_Y(1); - - tempvp.font=FONT_UI; - tempvp.drawmode=STYLE_DEFAULT; #if LCD_DEPTH > 1 - tempvp.fg_pattern=0; - tempvp.bg_pattern=0xFFFF; -#ifdef HAVE_LCD_COLOR - tempvp.lss_pattern=0; - tempvp.lse_pattern=0; - tempvp.lst_pattern=0; -#endif + tempvp.fg_pattern = LCD_BLACK; + tempvp.bg_pattern = LCD_WHITE; #endif rb->screens[SCREEN_MAIN]->set_viewport(&tempvp); diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h index c0d6183..60b35d9 100644 --- a/apps/plugins/reversi/reversi-gui.h +++ b/apps/plugins/reversi/reversi-gui.h @@ -208,6 +208,19 @@ #elif CONFIG_KEYPAD == ONDAVX777_PAD #define REVERSI_BUTTON_QUIT BUTTON_POWER +#elif CONFIG_KEYPAD == ANDROID_PAD +#define REVERSI_BUTTON_QUIT BUTTON_BACK +#define REVERSI_BUTTON_MENU BUTTON_MENU + +#elif CONFIG_KEYPAD == SDL_PAD +#define REVERSI_BUTTON_QUIT BUTTON_BACK +#define REVERSI_BUTTON_UP BUTTON_UP +#define REVERSI_BUTTON_DOWN BUTTON_DOWN +#define REVERSI_BUTTON_LEFT BUTTON_LEFT +#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT +#define REVERSI_BUTTON_MAKE_MOVE BUTTON_SELECT +#define REVERSI_BUTTON_MENU BUTTON_MENU + #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD #define REVERSI_BUTTON_QUIT BUTTON_REC #define REVERSI_BUTTON_UP BUTTON_UP |