Skip to content

Commit

Permalink
reset frame counter on animation update
Browse files Browse the repository at this point in the history
  • Loading branch information
savaughn committed Nov 2, 2023
1 parent 9335779 commit 93674c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/screens/MainMenuScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void slide_animate_details_pane(uint8_t button_selection)

void draw_trade_arrow_animation(void)
{
static int frame_counter = 0;
static uint8_t frame_counter = 0;
static uint8_t arrow_anim_index = 0;

// Draw arrow to right of consoles[0]
Expand Down Expand Up @@ -85,14 +85,15 @@ void draw_trade_arrow_animation(void)
if (frame_counter % 10 == 0)
{
arrow_anim_index++;
frame_counter = 0;
}
arrow_anim_index %= 9;
frame_counter++;
}

void draw_evolution_arrow_animation(void)
{
static int frame_counter = 0;
static uint8_t frame_counter = 0;
static uint8_t arrow_anim_index = 0;

if (arrow_anim_index > 0)
Expand All @@ -108,6 +109,7 @@ void draw_evolution_arrow_animation(void)
if (frame_counter % 15 == 0)
{
arrow_anim_index++;
frame_counter = 0;
}
arrow_anim_index %= 4;
frame_counter++;
Expand Down

0 comments on commit 93674c4

Please sign in to comment.