Start creating menu_animation_ctl

This commit is contained in:
twinaphex 2015-09-25 23:33:11 +02:00
parent 5e1987597b
commit 824e6618b2
3 changed files with 17 additions and 6 deletions

View File

@ -694,10 +694,15 @@ float menu_animation_get_delta_time(void)
return anim->delta_time;
}
bool menu_animation_is_active(void)
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data)
{
menu_animation_t *anim = menu_animation_get_ptr();
if (!anim)
return false;
return anim->is_active;
switch (state)
{
case MENU_ANIMATION_CTL_IS_ACTIVE:
return anim->is_active;
}
return false;
}

View File

@ -26,6 +26,7 @@
#define IDEAL_DT (1.0 / 60.0 * 1000000.0)
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -33,6 +34,11 @@ extern "C" {
typedef float (*easingFunc)(float, float, float, float);
typedef void (*tween_cb) (void);
enum menu_animation_ctl_state
{
MENU_ANIMATION_CTL_IS_ACTIVE = 0
};
enum menu_animation_easing_type
{
/* Linear */
@ -113,7 +119,7 @@ void menu_animation_clear_active(void);
float menu_animation_get_delta_time(void);
bool menu_animation_is_active(void);
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data);
#ifdef __cplusplus
}

View File

@ -294,7 +294,7 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
}
return true;
case MENU_DISPLAY_CTL_UPDATE_PENDING:
if (menu_animation_is_active() || (frame_buf && frame_buf->dirty))
if (menu_animation_ctl(MENU_ANIMATION_CTL_IS_ACTIVE, NULL) || (frame_buf && frame_buf->dirty))
return true;
return false;
case MENU_DISPLAY_CTL_SET_VIEWPORT: