From fcc15ae092ea9292925f055e3d5b162ba3c08241 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Tue, 7 Aug 2012 10:28:41 +0200 Subject: [PATCH] JE_titleScreen(): Use select_menuitem_by_touch() to support touch input in the title screen: - modified: project/jni/application/opentyrian/src/tyrian2.cpp --- project/jni/application/opentyrian/src/tyrian2.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/project/jni/application/opentyrian/src/tyrian2.cpp b/project/jni/application/opentyrian/src/tyrian2.cpp index 72990cb7b..bb274131c 100644 --- a/project/jni/application/opentyrian/src/tyrian2.cpp +++ b/project/jni/application/opentyrian/src/tyrian2.cpp @@ -3353,12 +3353,13 @@ bool JE_titleScreen( JE_boolean animate ) { bool quit = false; - const int menunum = 7; + const JE_shortint menunum = 7; + const JE_byte menu_top = 102, menu_spacing = 14; unsigned int arcade_code_i[SA_ENGAGE] = { 0 }; JE_word waitForDemo; - JE_byte menu = 0; + JE_shortint menu = 0; JE_boolean redraw = true, fadeIn = false; @@ -3507,7 +3508,7 @@ bool JE_titleScreen( JE_boolean animate ) /* Draw Menu Text on Screen */ for (int i = 0; i < menunum; ++i) { - int x = VGAScreen->w / 2, y = 104 + i * 13; + int x = VGAScreen->w / 2, y = menu_top + i * menu_spacing; draw_font_hv(VGAScreen, x - 1, y - 1, menuText[i], normal_font, centered, 15, -10); draw_font_hv(VGAScreen, x + 1, y + 1, menuText[i], normal_font, centered, 15, -10); @@ -3527,7 +3528,7 @@ bool JE_titleScreen( JE_boolean animate ) memcpy(VGAScreen->pixels, VGAScreen2->pixels, VGAScreen->pitch * VGAScreen->h); // highlight selected menu item - draw_font_hv(VGAScreen, VGAScreen->w / 2, 104 + menu * 13, menuText[menu], normal_font, centered, 15, -1); + draw_font_hv(VGAScreen, VGAScreen->w / 2, menu_top + menu * menu_spacing, menuText[menu], normal_font, centered, 15, -1); JE_showVGA(); @@ -3543,6 +3544,8 @@ bool JE_titleScreen( JE_boolean animate ) if (waitForDemo == 1) play_demo = true; + if (select_menuitem_by_touch(menu_top, menu_spacing, menunum, &menu)) + continue; if (newkey) { switch (lastkey_sym)