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 int page;
static float maxPages;
static int savedScreenshot;
void initTrophies(void)
{
@ -63,6 +64,8 @@ void initTrophies(void)
sparkleAngle = 0;
savedScreenshot = 0;
page = 0;
maxPages = STAT_TIME_PLAYED;
@ -266,10 +269,6 @@ void doTrophyAlerts(void)
if (alertTimer <= 0)
{
if (app.config.trophyScreenshot)
{
saveScreenshot(alertTrophy->id);
}
alertTrophy->notify = 0;
resetAlert();
}
@ -313,6 +312,7 @@ static void resetAlert(void)
{
alertTimer = FPS * 3;
alertTrophy = NULL;
savedScreenshot = 0;
}
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)
{
cJSON *root, *node;

View File

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

View File

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