Get rid of the conditionals

This commit is contained in:
twinaphex 2017-08-11 01:20:57 +02:00
parent 22139dc4a0
commit dad0fcbbe8

View File

@ -1193,24 +1193,20 @@ static void xmb_selection_pointer_changed(
entry.tag = tag;
entry.cb = NULL;
if (entry.subject)
menu_animation_push(&entry);
entry.subject = &node->label_alpha;
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = iz;
entry.subject = &node->zoom;
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = iy;
entry.subject = &node->y;
if (entry.subject)
menu_animation_push(&entry);
}
}
@ -1261,19 +1257,16 @@ static void xmb_list_open_old(xmb_handle_t *xmb,
entry.tag = -1;
entry.cb = NULL;
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = 0;
entry.subject = &node->label_alpha;
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = xmb->icon.size * dir * -2;
entry.subject = &node->x;
if (entry.subject)
menu_animation_push(&entry);
}
}
@ -1334,18 +1327,15 @@ static void xmb_list_open_new(xmb_handle_t *xmb,
entry.tag = -1;
entry.cb = NULL;
if (entry.subject)
menu_animation_push(&entry);
entry.subject = &node->label_alpha;
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = 0;
entry.subject = &node->x;
if (entry.subject)
menu_animation_push(&entry);
}
}
@ -1405,18 +1395,15 @@ static void xmb_push_animations(xmb_node_t *node, uintptr_t tag, float ia, float
entry.tag = tag;
entry.cb = NULL;
if (entry.subject)
menu_animation_push(&entry);
entry.subject = &node->label_alpha;
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = ix;
entry.subject = &node->x;
if (entry.subject)
menu_animation_push(&entry);
}
@ -1597,13 +1584,11 @@ static void xmb_list_switch_horizontal_list(xmb_handle_t *xmb)
entry.tag = -1;
entry.cb = NULL;
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = iz;
entry.subject = &node->zoom;
if (entry.subject)
menu_animation_push(&entry);
}
}
@ -1966,27 +1951,22 @@ static void xmb_list_open(xmb_handle_t *xmb)
entry.tag = -1;
entry.cb = NULL;
switch (xmb->depth)
{
case 1:
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = 0;
entry.subject = &xmb->textures.arrow.alpha;
if (entry.subject)
menu_animation_push(&entry);
break;
case 2:
if (entry.subject)
menu_animation_push(&entry);
entry.target_value = 1;
entry.subject = &xmb->textures.arrow.alpha;
if (entry.subject)
menu_animation_push(&entry);
break;
}
@ -3968,7 +3948,6 @@ static void xmb_toggle(void *userdata, bool menu_on)
entry.tag = -1;
entry.cb = NULL;
if (entry.subject)
menu_animation_push(&entry);
tmp = !menu_entries_ctl(MENU_ENTRIES_CTL_NEEDS_REFRESH, NULL);