Get rid of gx_timer_kill

This commit is contained in:
twinaphex 2020-10-14 02:09:39 +02:00
parent 6e09eada2d
commit 992e780407
7 changed files with 16 additions and 15 deletions

View File

@ -2242,12 +2242,6 @@ void gfx_timer_start(gfx_timer_t *timer, gfx_timer_ctx_entry_t *timer_entry)
gfx_animation_push(&entry);
}
void gfx_timer_kill(gfx_timer_t *timer)
{
uintptr_t tag = (uintptr_t) timer;
gfx_animation_kill_by_tag(&tag);
}
uint64_t gfx_animation_get_ticker_idx(void)
{
gfx_animation_t *p_anim = anim_get_ptr();

View File

@ -229,8 +229,6 @@ typedef struct gfx_animation gfx_animation_t;
void gfx_timer_start(gfx_timer_t *timer, gfx_timer_ctx_entry_t *timer_entry);
void gfx_timer_kill(gfx_timer_t *timer);
bool gfx_animation_update(
gfx_animation_t *p_anim,
retro_time_t current_time,

View File

@ -249,7 +249,8 @@ void gfx_widgets_msg_queue_push(
{
if (msg_widget->expiration_timer_started)
{
gfx_timer_kill(&msg_widget->expiration_timer);
uintptr_t _tag = (uintptr_t)&msg_widget->expiration_timer;
gfx_animation_kill_by_tag(&_tag);
msg_widget->expiration_timer_started = false;
}
@ -414,7 +415,10 @@ static void gfx_widgets_msg_queue_free(
/* Kill all timers */
if (msg->expiration_timer_started)
gfx_timer_kill(&msg->expiration_timer);
{
uintptr_t _tag = (uintptr_t)&msg->expiration_timer;
gfx_animation_kill_by_tag(&_tag);
}
/* Free it */
if (msg->msg)

View File

@ -103,9 +103,10 @@ static void gfx_widget_generic_message_reset(bool cancel_pending)
{
gfx_widget_generic_message_state_t *state = &p_w_generic_message_st;
uintptr_t alpha_tag = (uintptr_t)&state->alpha;
uintptr_t timer_tag = (uintptr_t)&state->timer;
/* Kill any existing timers/animations */
gfx_timer_kill(&state->timer);
gfx_animation_kill_by_tag(&timer_tag);
gfx_animation_kill_by_tag(&alpha_tag);
/* Reset status */

View File

@ -97,9 +97,10 @@ static void gfx_widget_libretro_message_reset(bool cancel_pending)
{
gfx_widget_libretro_message_state_t *state = &p_w_libretro_message_st;
uintptr_t alpha_tag = (uintptr_t)&state->alpha;
uintptr_t timer_tag = (uintptr_t)&state->timer;
/* Kill any existing timers/animations */
gfx_timer_kill(&state->timer);
gfx_animation_kill_by_tag(&timer_tag);
gfx_animation_kill_by_tag(&alpha_tag);
/* Reset status */

View File

@ -166,9 +166,10 @@ static void gfx_widget_load_content_animation_reset(void)
gfx_widget_load_content_animation_state_t *state = &p_w_load_content_animation_st;
uintptr_t alpha_tag = (uintptr_t)&state->alpha;
uintptr_t slide_offset_tag = (uintptr_t)&state->slide_offset;
uintptr_t timer_tag = (uintptr_t)&state->timer;
/* Kill any existing timers/animations */
gfx_timer_kill(&state->timer);
gfx_animation_kill_by_tag(&timer_tag);
gfx_animation_kill_by_tag(&alpha_tag);
gfx_animation_kill_by_tag(&slide_offset_tag);

View File

@ -131,6 +131,7 @@ void gfx_widget_set_progress_message(void *data,
gfx_widget_progress_message_state_t *state = &p_w_progress_message_st;
gfx_widget_font_data_t *font_regular = &p_dispwidget->gfx_widget_fonts.regular;
uintptr_t alpha_tag = (uintptr_t)&state->alpha;
uintptr_t timer_tag = (uintptr_t)&state->timer;
/* Ensure we have a valid message string */
if (string_is_empty(message))
@ -154,7 +155,7 @@ void gfx_widget_set_progress_message(void *data,
1.0f);
/* Kill any existing timer/animation */
gfx_timer_kill(&state->timer);
gfx_animation_kill_by_tag(&timer_tag);
gfx_animation_kill_by_tag(&alpha_tag);
/* Start new message timer */
@ -313,9 +314,10 @@ static void gfx_widget_progress_message_free(void)
{
gfx_widget_progress_message_state_t *state = &p_w_progress_message_st;
uintptr_t alpha_tag = (uintptr_t)&state->alpha;
uintptr_t timer_tag = (uintptr_t)&state->timer;
/* Kill any existing timer / animation */
gfx_timer_kill(&state->timer);
gfx_animation_kill_by_tag(&timer_tag);
gfx_animation_kill_by_tag(&alpha_tag);
/* Deactivate widget */