* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "config.h"
-
-#include "SFont.h"
-#include "file.h"
-#include "score.h"
-
#include <SDL.h>
#include <SDL_keysym.h>
-#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "SFont.h"
+
+#include "common.h"
+#include "config.h"
+#include "file.h"
+#include "globals.h"
+#include "score.h"
+
// High score table
struct highscore g_scores[N_SCORES] = {
{1*60*1000,"-"},
if(f) {
// If the file exists, read from it
for(i = 0; i<N_SCORES; i++) {
- g_scores[i].score = 0;
- g_scores[i].name[0] = 0;
fscanf(f, "%d %31[^\n]", &g_scores[i].score, g_scores[i].name);
}
fclose(f);
}
}
-int
-snprintscore_line(char *s, size_t n, int score)
+void
+show_score(void)
{
- int r = snprintf(s, n, "Time: ");
- return r + snprintscore(s+r, n-r, score);
+ char s[16];
+ int r = snprintf(s, 16, "Time: ");
+ snprintscore(s+r, 16-r, score);
+ SFont_Write(surf_screen, g_font, XSIZE-250, 0, s);
}
void