sprintf (string, "Score: %d", (int)(bonustotal - startbonustotal));
text->glPrintOutlined(1024 / 30, 768 * 6 / 8, string, 1, 2, 1024, 768);
- if (campaign)
- sprintf (string, "Press Escape or Space to continue");
- else
- sprintf (string, "Press Escape to return to menu or Space to continue");
+ sprintf (string, "Press Escape to return to menu or Space to continue");
text->glPrintOutlined(640 / 2 - strlen(string) * 5, 480 * 1 / 16, string, 1, 1, 640, 480);
char temp[255];
for (int i = 0; i < 255; i++)
string[i] = '\0';
- sprintf (temp, "Time: %d:", (int)(((int)leveltime - (int)(leveltime) % 60) / 60));
+ int wontime = (int)round(wonleveltime);
+ sprintf (temp, "Time: %d:", int((wontime - wontime % 60) / 60));
strcat(string, temp);
- if ((int)(leveltime) % 60 < 10)
+ if (wontime % 60 < 10)
strcat(string, "0");
- sprintf (temp, "%d", (int)(leveltime) % 60);
+ sprintf (temp, "%d", wontime % 60);
strcat(string, temp);
text->glPrintOutlined(1024 / 30, 768 * 6 / 8 - 40, string, 1, 2, 1024, 768);
firstload = 1;
leveltime = 0;
+ wonleveltime = 0;
visibleloading = 0;
}
accountactive->winCampaignLevel(whichchoice, bonustotal, leveltime);
scoreadded = 1;
} else {
+ wonleveltime = leveltime;
accountactive->winLevel(whichlevel, bonustotal - startbonustotal, leveltime);
}
won = 1;
if (name.size() < 32) {
name.append((32 - name.size()), ' ');
}
- name += to_string(int((int(accountactive->getFastTime(i)) - int(accountactive->getFastTime(i)) % 60) / 60));
+ int fasttime = (int)round(accountactive->getFastTime(i));
+ name += to_string(int((fasttime - fasttime % 60) / 60));
name += ":";
- if ((int)(accountactive->getFastTime(i)) % 60 < 10)
+ if (fasttime % 60 < 10)
name += "0";
- name += to_string((int)(accountactive->getFastTime(i)) % 60);
+ name += to_string(fasttime % 60);
addButton(i, name, 10, 400 - i * 25, i > accountactive->getProgress() ? 0.5 : 1, 0, 0);
}