X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=score.c;h=6823b575a7961248cd6fe905f643de7a8b7dc343;hp=78a03acc1ccd4438f49b73452992e87d9dfba9e2;hb=88a9e026caed5568363cefb7d49308b875dc5e4a;hpb=100372ba9cc83542b9d9894001d70f40e28f8f4b diff --git a/score.c b/score.c index 78a03ac..6823b57 100644 --- a/score.c +++ b/score.c @@ -22,7 +22,7 @@ #include #include -#include "SFont.h" +#include "font.h" #include "common.h" #include "config.h" @@ -56,8 +56,6 @@ struct highscore g_scores[2][N_SCORES] = { static char *titles[2] = { "Normal\n", "Easy\n" }; -extern SFont_Font *g_font; - int g_easy = 0; int cur_score = -1; // which score we're currently entering. @@ -155,28 +153,28 @@ show_score(void) 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); + font_write(XSIZE-250, 0, s); } void display_scores(SDL_Surface *s, uint32_t x, uint32_t y) { char t[1024]; - int i,h = SFont_TextHeight(g_font); + int i,h = font_height(); - SFont_Write(s,g_font,x+30,y,"High scores"); + font_write(x+30, y, "High scores"); y += h; - if(g_easy) SFont_Write(s,g_font,x+75,y,"(easy)"); - else SFont_Write(s,g_font,x+60,y,"(normal)"); + if(g_easy) font_write(x+75,y,"(easy)"); + else font_write(x+60,y,"(normal)"); for(i = 0; isym == SDLK_RETURN) { SDL_EnableUNICODE(0); cur_score = -1; + if(n == 0) { + name[0] = '-'; + } return false; - } else name[n++] = key->unicode; + } else if(n < 12) { + if(key->unicode >= 32 && key->unicode <= 126) { + name[n++] = key->unicode; + } + } // else drop it } return true; }