Merge pull request #1632 from lakkatv/touch

(XMB) Basic touch support, no drag yet
This commit is contained in:
Twinaphex 2015-04-16 19:01:38 +02:00
commit 1dca314fdd
2 changed files with 22 additions and 5 deletions

View File

@ -1211,6 +1211,8 @@ static void xmb_render(void)
{ {
unsigned i, current, end; unsigned i, current, end;
runloop_t *runloop = rarch_main_get_ptr(); runloop_t *runloop = rarch_main_get_ptr();
settings_t *settings = config_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr(); menu_handle_t *menu = menu_driver_get_ptr();
if (!menu) if (!menu)
@ -1226,6 +1228,19 @@ static void xmb_render(void)
current = menu->navigation.selection_ptr; current = menu->navigation.selection_ptr;
end = menu_list_get_size(menu->menu_list); end = menu_list_get_size(menu->menu_list);
if (settings->menu.pointer.enable)
{
for (i = 0; i < end; i++)
{
float item_y = xmb->margins.screen.top + xmb_item_y(xmb, i, current);
if (menu->pointer.y > item_y && menu->pointer.y < item_y + xmb->icon.size)
menu->pointer.ptr = i;
}
}
if (settings->menu.mouse.enable)
{
for (i = 0; i < end; i++) for (i = 0; i < end; i++)
{ {
float item_y = xmb->margins.screen.top + xmb_item_y(xmb, i, current); float item_y = xmb->margins.screen.top + xmb_item_y(xmb, i, current);
@ -1233,6 +1248,7 @@ static void xmb_render(void)
if (menu->mouse.y > item_y && menu->mouse.y < item_y + xmb->icon.size) if (menu->mouse.y > item_y && menu->mouse.y < item_y + xmb->icon.size)
menu->mouse.ptr = i; menu->mouse.ptr = i;
} }
}
runloop->frames.video.current.menu.animation.is_active = false; runloop->frames.video.current.menu.animation.is_active = false;
runloop->frames.video.current.menu.label.is_updated = false; runloop->frames.video.current.menu.label.is_updated = false;
@ -1498,6 +1514,7 @@ static void *xmb_init(void)
xmb->margins.setting.left = 600.0 * scale_factor; xmb->margins.setting.left = 600.0 * scale_factor;
menu->categories.size = 1; menu->categories.size = 1;
menu->header_height = xmb->icon.size;
if (global->core_info) if (global->core_info)
menu->categories.size = global->core_info->count + 1; menu->categories.size = global->core_info->count + 1;

View File

@ -804,7 +804,7 @@ static int pointer_tap(menu_file_list_cbs_t *cbs, const char *path,
else if (menu->pointer.ptr == menu->navigation.selection_ptr) else if (menu->pointer.ptr == menu->navigation.selection_ptr)
return cbs->action_ok(path, label, type, menu->navigation.selection_ptr); return cbs->action_ok(path, label, type, menu->navigation.selection_ptr);
else else
menu->navigation.selection_ptr = menu->pointer.ptr; menu_navigation_set(&menu->navigation, menu->pointer.ptr, false);
return 0; return 0;
} }