fclose(file);
}
+static void ConvertScore_OLD(void)
+{
+ // only convert score to time for levels that rate playing time over score
+ if (!level.rate_time_over_score)
+ return;
+
+ // convert old score to playing time for score-less levels (like Supaplex)
+ int time_final_max = 999;
+ int i;
+
+ for (i = 0; i < MAX_SCORE_ENTRIES; i++)
+ {
+ int score = scores.entry[i].score;
+
+ if (score > 0 && score < time_final_max)
+ scores.entry[i].time = (time_final_max - score - 1) * FRAMES_PER_SECOND;
+ }
+}
+
static int LoadScore_VERS(File *file, int chunk_size, struct ScoreInfo *scores)
{
scores->file_version = getFileVersion(file);
{
// score files from versions before 4.2.4.0 without chunk structure
LoadScore_OLD(nr);
+
+ // convert score to time, if possible (mainly for Supaplex levels)
+ ConvertScore_OLD();
}
else
{
return int2str(scores.entry[nr].time, 5);
static char score_text[10];
- int time_final_max = 999;
int time_seconds = scores.entry[nr].time / FRAMES_PER_SECOND;
- int score = scores.entry[nr].score;
-
- // convert old score file entries without playing time
- if (time_seconds == 0 && score > 0 && score < time_final_max)
- time_seconds = time_final_max - score - 1;
-
int mm = (time_seconds / 60) % 60;
int ss = (time_seconds % 60);