diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/brickmania.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 059d3c3336..3a754b3e9e 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c | |||
@@ -1055,6 +1055,11 @@ static int brickmania_menu(void) | |||
1055 | { "Normal", -1 }, | 1055 | { "Normal", -1 }, |
1056 | }; | 1056 | }; |
1057 | 1057 | ||
1058 | #ifdef HAVE_TOUCHSCREEN | ||
1059 | /* Entering Menu, set the touchscreen to the global setting */ | ||
1060 | rb->touchscreen_set_mode(rb->global_settings->touch_mode); | ||
1061 | #endif | ||
1062 | |||
1058 | MENUITEM_STRINGLIST(main_menu, "Brickmania Menu", brickmania_menu_cb, | 1063 | MENUITEM_STRINGLIST(main_menu, "Brickmania Menu", brickmania_menu_cb, |
1059 | "Resume Game", "Start New Game", | 1064 | "Resume Game", "Start New Game", |
1060 | "Difficulty", "Help", "High Scores", | 1065 | "Difficulty", "Help", "High Scores", |
@@ -1106,6 +1111,9 @@ static int brickmania_menu(void) | |||
1106 | break; | 1111 | break; |
1107 | } | 1112 | } |
1108 | } | 1113 | } |
1114 | #ifdef HAVE_TOUCHSCREEN | ||
1115 | rb->touchscreen_set_mode(TOUCHSCREEN_POINT); | ||
1116 | #endif | ||
1109 | } | 1117 | } |
1110 | 1118 | ||
1111 | /* Find an unused fire position */ | 1119 | /* Find an unused fire position */ |
@@ -1795,12 +1803,12 @@ static int brickmania_game_loop(void) | |||
1795 | if(button & BUTTON_TOUCHSCREEN) | 1803 | if(button & BUTTON_TOUCHSCREEN) |
1796 | { | 1804 | { |
1797 | short touch_x, touch_y; | 1805 | short touch_x, touch_y; |
1798 | touch_x = rb->button_get_data() >> 16; | 1806 | touch_x = FIXED3(rb->button_get_data() >> 16); |
1799 | touch_y = rb->button_get_data() & 0xffff; | 1807 | touch_y = FIXED3(rb->button_get_data() & 0xffff); |
1800 | if(touch_y >= PAD_POS_Y && touch_y <= PAD_POS_Y+PAD_HEIGHT) | 1808 | if(touch_y >= (GAMESCREEN_HEIGHT-GAMESCREEN_HEIGHT/4) && touch_y <= GAMESCREEN_HEIGHT) |
1801 | { | 1809 | { |
1802 | pad_pos_x += (flip_sides ? -1 : 1) * | 1810 | pad_pos_x = (flip_sides ? -1 : 1) * |
1803 | ( (touch_x-pad_pos_x-pad_width/2) / 4 ); | 1811 | (touch_x - pad_width/2); |
1804 | 1812 | ||
1805 | if(pad_pos_x < 0) | 1813 | if(pad_pos_x < 0) |
1806 | pad_pos_x = 0; | 1814 | pad_pos_x = 0; |
@@ -1962,6 +1970,10 @@ enum plugin_status plugin_start(const void* parameter) | |||
1962 | highscore_load(HIGH_SCORE,highest,NUM_SCORES); | 1970 | highscore_load(HIGH_SCORE,highest,NUM_SCORES); |
1963 | configfile_load(CONFIG_FILE_NAME,config,1,0); | 1971 | configfile_load(CONFIG_FILE_NAME,config,1,0); |
1964 | last_difficulty = difficulty; | 1972 | last_difficulty = difficulty; |
1973 | |||
1974 | #ifdef HAVE_TOUCHSCREEN | ||
1975 | rb->touchscreen_set_mode(TOUCHSCREEN_POINT); | ||
1976 | #endif | ||
1965 | 1977 | ||
1966 | rb->lcd_setfont(FONT_SYSFIXED); | 1978 | rb->lcd_setfont(FONT_SYSFIXED); |
1967 | #if LCD_DEPTH > 1 | 1979 | #if LCD_DEPTH > 1 |