Trophy screenshot update.

This commit is contained in:
Steve 2018-02-24 15:58:33 +00:00
parent 0d08f6096f
commit 891d551179
3 changed files with 17 additions and 4 deletions

View File

@ -39,6 +39,7 @@ static Atlas *left;
static Atlas *right; static Atlas *right;
static int page; static int page;
static float maxPages; static float maxPages;
static int savedScreenshot;
void initTrophies(void) void initTrophies(void)
{ {
@ -63,6 +64,8 @@ void initTrophies(void)
sparkleAngle = 0; sparkleAngle = 0;
savedScreenshot = 0;
page = 0; page = 0;
maxPages = STAT_TIME_PLAYED; maxPages = STAT_TIME_PLAYED;
@ -266,10 +269,6 @@ void doTrophyAlerts(void)
if (alertTimer <= 0) if (alertTimer <= 0)
{ {
if (app.config.trophyScreenshot)
{
saveScreenshot(alertTrophy->id);
}
alertTrophy->notify = 0; alertTrophy->notify = 0;
resetAlert(); resetAlert();
} }
@ -313,6 +312,7 @@ static void resetAlert(void)
{ {
alertTimer = FPS * 3; alertTimer = FPS * 3;
alertTrophy = NULL; alertTrophy = NULL;
savedScreenshot = 0;
} }
void drawTrophyAlert(void) void drawTrophyAlert(void)
@ -339,6 +339,16 @@ void drawTrophyAlert(void)
} }
} }
void saveTrophyScreenshot(void)
{
if (alertTrophy && alertRect.x == -1 && app.config.trophyScreenshot && !savedScreenshot)
{
saveScreenshot(alertTrophy->id);
savedScreenshot = 1;
}
}
static void loadTrophyData(void) static void loadTrophyData(void)
{ {
cJSON *root, *node; cJSON *root, *node;

View File

@ -67,6 +67,8 @@ int main(int argc, char *argv[])
presentScene(); presentScene();
saveTrophyScreenshot();
then = capFrameRate(then); then = capFrameRate(then);
frames++; frames++;

View File

@ -34,6 +34,7 @@ extern void awardTrophies(void);
extern void doTrophyAlerts(void); extern void doTrophyAlerts(void);
extern void drawTrophyAlert(void); extern void drawTrophyAlert(void);
extern void expireTexts(int all); extern void expireTexts(int all);
extern void saveTrophyScreenshot(void);
App app; App app;
Camera camera; Camera camera;