From 011851d9068d59a7092a9d9ffe19c7d49b0758dc Mon Sep 17 00:00:00 2001 From: Steve Date: Thu, 2 Jun 2016 12:34:35 +0100 Subject: [PATCH] Always sparkle trophies. --- src/game/trophies.c | 18 ++++-------------- src/game/trophies.h | 1 + 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/game/trophies.c b/src/game/trophies.c index d1dec2c..1aa1b34 100644 --- a/src/game/trophies.c +++ b/src/game/trophies.c @@ -57,6 +57,8 @@ void initTrophies(void) alertRect.h = 90; alertRect.y = 10; + + sparkleAngle = 0; resetAlert(); } @@ -99,8 +101,6 @@ void initTrophiesDisplay(void) next = getWidget("next", "trophies"); next->action = nextPage; next->visible = 1; - - sparkleAngle = 0; } static void nextPage(void) @@ -119,15 +119,6 @@ static void prevPage(void) prev->visible = page > 0; } -void doTrophies(void) -{ - sparkleAngle += 0.25; - if (sparkleAngle >= 360) - { - sparkleAngle = 0; - } -} - void drawTrophies(void) { Trophy *t; @@ -255,10 +246,9 @@ void doTrophyAlerts(void) alertTrophy->notify = 0; resetAlert(); } - - /* do the sparkle rotation */ - doTrophies(); } + + sparkleAngle = mod(sparkleAngle + 0.25, 360); } static void nextAlert(void) diff --git a/src/game/trophies.h b/src/game/trophies.h index f2c2a82..eeedfb2 100644 --- a/src/game/trophies.h +++ b/src/game/trophies.h @@ -41,6 +41,7 @@ extern void drawWidgets(char *groupName); extern char *timeToDate(long millis); extern void textSize(char *text, int size, int *w, int *h); extern void awardPandoranCraftTrophy(void); +extern float mod(float n, float x); extern App app; extern Battle battle;