From: Holger Schemel Date: Wed, 23 Feb 2022 22:33:43 +0000 (+0100) Subject: moved code to get time string for hall of fame to separate function X-Git-Tag: 4.3.2.0~111 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3ff933d0df6a6b8a54819b7e10f74b9f54bde01c;p=rocksndiamonds.git moved code to get time string for hall of fame to separate function --- diff --git a/src/screens.c b/src/screens.c index 7b05d4f1..4d5eee91 100644 --- a/src/screens.c +++ b/src/screens.c @@ -5769,14 +5769,8 @@ void DrawHallOfFame(int level_nr) DrawChooseTree(&score_entry_current); } -static char *getHallOfFameScoreText(int nr) +static char *getHallOfFameTimeText(int nr) { - if (!level.rate_time_over_score) - return int2str(scores.entry[nr].score, 5); // show normal score - - if (level.use_step_counter) - return int2str(scores.entry[nr].time, 5); // show number of steps - static char score_text[10]; int time_seconds = scores.entry[nr].time / FRAMES_PER_SECOND; int mm = (time_seconds / 60) % 60; @@ -5787,6 +5781,16 @@ static char *getHallOfFameScoreText(int nr) return score_text; } +static char *getHallOfFameScoreText(int nr) +{ + if (!level.rate_time_over_score) + return int2str(scores.entry[nr].score, 5); // show normal score + else if (level.use_step_counter) + return int2str(scores.entry[nr].time, 5); // show number of steps + else + return getHallOfFameTimeText(nr); // show playing time +} + static void HandleHallOfFame_SelectLevel(int step, int direction) { int old_level_nr = level_nr;