JE_titleScreen(): Use select_menuitem_by_touch() to support touch input
in the title screen: - modified: project/jni/application/opentyrian/src/tyrian2.cpp
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user