Skip to content

Commit

Permalink
Use select_menuitem_by_touch() to support touch input in gameplay(pla…
Browse files Browse the repository at this point in the history
…yer) menu
  • Loading branch information
Bernhard Kaindl committed Aug 7, 2012
1 parent fcc15ae commit 7d953b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions project/jni/application/opentyrian/src/menus.cpp
Expand Up @@ -56,15 +56,16 @@ bool select_gameplay( void )
JE_loadPic(VGAScreen, 2, false);
JE_dString(VGAScreen, JE_fontCenter(gameplay_name[0], FONT_SHAPES), 20, gameplay_name[0], FONT_SHAPES);

int gameplay = 1,
const JE_byte menu_top = 30, menu_spacing = 24;
JE_shortint gameplay = 1,
gameplay_max = 4;

bool fade_in = true;
for (; ; )
{
for (int i = 1; i <= gameplay_max; i++)
{
JE_outTextAdjust(VGAScreen, JE_fontCenter(gameplay_name[i], SMALL_FONT_SHAPES), i * 24 + 30, gameplay_name[i], 15, - 4 + (i == gameplay ? 2 : 0) - (i == 4 ? 4 : 0), SMALL_FONT_SHAPES, true);
JE_outTextAdjust(VGAScreen, JE_fontCenter(gameplay_name[i], SMALL_FONT_SHAPES), i * menu_spacing + menu_top, gameplay_name[i], 15, - 4 + (i == gameplay ? 2 : 0) - (i == 4 ? 4 : 0), SMALL_FONT_SHAPES, true);
}
JE_showVGA();

Expand All @@ -77,6 +78,9 @@ bool select_gameplay( void )
JE_word temp = 0;
JE_textMenuWait(&temp, false);

if (select_menuitem_by_touch(menu_top, menu_spacing, gameplay_max, &gameplay))
continue;

if (newkey)
{
switch (lastkey_sym)
Expand Down

0 comments on commit 7d953b3

Please sign in to comment.