Esempio n. 1
0
void menu_display_free(menu_handle_t *menu)
{
   if (!menu)
      return;

   menu_animation_free(menu->animation);
   menu->animation = NULL;
}
Esempio n. 2
0
void menu_display_free(void)
{
   menu_display_t *disp = menu_display_get_ptr();
   if (!disp)
      return;

   if (disp->msg_queue)
      msg_queue_free(disp->msg_queue);
   disp->msg_queue = NULL;

   menu_animation_free();

   menu_display_fb_free(&frame_buf_state);
   memset(&frame_buf_state,    0, sizeof(menu_framebuf_t));
   memset(&menu_display_state, 0, sizeof(menu_display_t));
}
Esempio n. 3
0
bool menu_animation_ctl(enum menu_animation_ctl_state state, void *data)
{
    menu_animation_t *anim   = menu_animation_get_ptr();

    if (!anim)
        return false;

    switch (state)
    {
    case MENU_ANIMATION_CTL_DEINIT:
        menu_animation_free();
        break;
    case MENU_ANIMATION_CTL_IS_ACTIVE:
        return anim->is_active;
    case MENU_ANIMATION_CTL_CLEAR_ACTIVE:
        anim->is_active           = false;
        return true;
    case MENU_ANIMATION_CTL_SET_ACTIVE:
        anim->is_active           = true;
        return true;
    case MENU_ANIMATION_CTL_DELTA_TIME:
    {
        float *ptr = (float*)data;
        if (!ptr)
            return false;
        *ptr = anim->delta_time;
    }
    return true;
    case MENU_ANIMATION_CTL_UPDATE_TIME:
    {
        static retro_time_t last_clock_update = 0;
        settings_t *settings     = config_get_ptr();

        anim->cur_time           = retro_get_time_usec();
        anim->delta_time         = anim->cur_time - anim->old_time;

        if (anim->delta_time >= IDEAL_DT * 4)
            anim->delta_time = IDEAL_DT * 4;
        if (anim->delta_time <= IDEAL_DT / 4)
            anim->delta_time = IDEAL_DT / 4;
        anim->old_time      = anim->cur_time;

        if (((anim->cur_time - last_clock_update) > 1000000)
                && settings->menu.timedate_enable)
        {
            anim->is_active           = true;
            last_clock_update = anim->cur_time;
        }
    }
    return true;
    case MENU_ANIMATION_CTL_UPDATE:
    {
        unsigned i;
        unsigned active_tweens = 0;
        float *dt = (float*)data;

        if (!dt)
            return false;

        for(i = 0; i < anim->size; i++)
            menu_animation_iterate(anim, i, *dt, &active_tweens);

        if (!active_tweens)
        {
            anim->size = 0;
            anim->first_dead = 0;
            return false;
        }

        anim->is_active = true;
    }
    return true;
    }

    return false;
}