From 6afddd8261eb4d95b3dbb0bed824e81a893ae047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Sat, 18 Oct 2014 16:49:51 +0200 Subject: [PATCH] (XMB) Fix depth animation --- frontend/menu/disp/xmb.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/frontend/menu/disp/xmb.c b/frontend/menu/disp/xmb.c index 793882e7b1..24f2055213 100644 --- a/frontend/menu/disp/xmb.c +++ b/frontend/menu/disp/xmb.c @@ -396,17 +396,16 @@ static void xmb_populate_entries(void *data, const char *path, if (!xmb) return; - xmb->depth = menu_list_get_stack_size(driver.menu->menu_list); - - if (xmb->depth > xmb->old_depth) + size_t depth = menu_list_get_stack_size(driver.menu->menu_list); + if (xmb->depth != depth) { - add_tween(XMB_DELAY, xmb->x-20, &xmb->x, &inOutQuad, NULL); - } - else if (xmb->depth < xmb->old_depth) - { - add_tween(XMB_DELAY, xmb->x+20, &xmb->x, &inOutQuad, NULL); + xmb->old_depth = xmb->depth; + xmb->depth = depth; } + if (xmb->depth != xmb->old_depth) + add_tween(XMB_DELAY, xmb->x + (xmb->depth-xmb->old_depth)*-20, + &xmb->x, &inOutQuad, NULL); current = driver.menu->selection_ptr; end = menu_list_get_size(driver.menu->menu_list); @@ -432,8 +431,6 @@ static void xmb_populate_entries(void *data, const char *path, node->y = xmb->vspacing * xmb->active_item_factor; } } - - xmb->old_depth = xmb->depth; } static void xmb_frame(void)