Add touch input support in opentyrian menu, initial commit:

Note: This breaks menu rendering a but, fixed in subsequent commits
Use select_menuitem_by_touch() to support touch input in opentyrian menu
This commit is contained in:
Bernhard Kaindl
2012-08-07 10:55:44 +02:00
parent 178a208b0d
commit 2cc6076e70

View File

@@ -28,6 +28,7 @@
#include "jukebox.h"
#include "keyboard.h"
#include "loudness.h"
#include "menus.h"
#include "mainint.h"
#include "mtrand.h"
#include "musmast.h"
@@ -79,7 +80,8 @@ char *strnztcpy( char *to, const char *from, size_t count )
void opentyrian_menu( void )
{
int sel = 0;
const JE_byte menu_top = 36, menu_spacing = 20;
JE_shortint sel = 0;
const int maxSel = COUNTOF(opentyrian_menu_items) - 1;
bool quit = false, fade_in = true;
@@ -111,7 +113,7 @@ void opentyrian_menu( void )
text = buffer;
}
draw_font_hv_shadow(VGAScreen, VGAScreen->w / 2, (i != maxSel) ? i * 16 + 32 : 118, text, normal_font, centered, 15, (i != sel) ? -4 : -2, false, 2);
draw_font_hv_shadow(VGAScreen, VGAScreen->w / 2, (i != maxSel) ? i * menu_spacing + menu_top : 118, text, normal_font, centered, 15, (i != sel) ? -4 : -2, false, 2);
}
JE_showVGA();
@@ -126,6 +128,9 @@ void opentyrian_menu( void )
tempW = 0;
JE_textMenuWait(&tempW, false);
if (select_menuitem_by_touch(menu_top, menu_spacing, maxSel, &sel))
continue;
if (newkey)
{
switch (lastkey_sym)