forked from len0rd/rockbox
reversi: Fix viewport initialization. Improve button layout for portrait. Enable for toucschreen RaaA.
Change-Id: Ief0937693dc2056ed442f68a5ab76a006eaa1209
This commit is contained in:
parent
d216cc7654
commit
8222388252
3 changed files with 23 additions and 14 deletions
|
@ -13,6 +13,8 @@ lua
|
||||||
fft
|
fft
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
reversi
|
||||||
|
|
||||||
#ifdef HAVE_TAGCACHE
|
#ifdef HAVE_TAGCACHE
|
||||||
pictureflow
|
pictureflow
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -167,14 +167,14 @@ static bool game_finished;
|
||||||
#define B_QUIT_H (LCD_HEIGHT/4)
|
#define B_QUIT_H (LCD_HEIGHT/4)
|
||||||
#else
|
#else
|
||||||
/* Define Menu button x, y, width, height */
|
/* 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_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 B_MENU_H (2*CELL_HEIGHT)
|
||||||
/* Define Quit Button x, y, width, 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_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)
|
#define B_QUIT_H (2*CELL_HEIGHT)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -317,21 +317,15 @@ static void reversi_gui_display_board(void) {
|
||||||
reversi_gui_draw_cell(x, y+(LEGEND_Y(1)-LEGEND_Y(0))/2-CELL_WIDTH/2, BLACK);
|
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->snprintf(buf, sizeof(buf), "%01d", c);
|
||||||
|
|
||||||
|
rb->viewport_set_defaults(&tempvp, SCREEN_MAIN);
|
||||||
|
|
||||||
tempvp.x=x+CELL_WIDTH+2;
|
tempvp.x=x+CELL_WIDTH+2;
|
||||||
tempvp.y=y;
|
tempvp.y=y;
|
||||||
tempvp.width=LCD_WIDTH-tempvp.x;
|
tempvp.width=LCD_WIDTH-tempvp.x;
|
||||||
tempvp.height=LEGEND_Y(1);
|
tempvp.height=LEGEND_Y(1);
|
||||||
|
|
||||||
tempvp.font=FONT_UI;
|
|
||||||
tempvp.drawmode=STYLE_DEFAULT;
|
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
tempvp.fg_pattern=0;
|
tempvp.fg_pattern = LCD_BLACK;
|
||||||
tempvp.bg_pattern=0xFFFF;
|
tempvp.bg_pattern = LCD_WHITE;
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
tempvp.lss_pattern=0;
|
|
||||||
tempvp.lse_pattern=0;
|
|
||||||
tempvp.lst_pattern=0;
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rb->screens[SCREEN_MAIN]->set_viewport(&tempvp);
|
rb->screens[SCREEN_MAIN]->set_viewport(&tempvp);
|
||||||
|
|
|
@ -208,6 +208,19 @@
|
||||||
#elif CONFIG_KEYPAD == ONDAVX777_PAD
|
#elif CONFIG_KEYPAD == ONDAVX777_PAD
|
||||||
#define REVERSI_BUTTON_QUIT BUTTON_POWER
|
#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
|
#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
|
||||||
#define REVERSI_BUTTON_QUIT BUTTON_REC
|
#define REVERSI_BUTTON_QUIT BUTTON_REC
|
||||||
#define REVERSI_BUTTON_UP BUTTON_UP
|
#define REVERSI_BUTTON_UP BUTTON_UP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue