X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=score.c;h=31025a9761fb7034c976f1aa4c6e8a281bed89ff;hp=e49e956c862ea168edcef209df09ff20ba613e47;hb=3ef599c7104a20c4f5268dbefb6590aa3e285663;hpb=e10d6c0b95e2f4fe7acd75733370dae71bb3b73f diff --git a/score.c b/score.c index e49e956..31025a9 100644 --- a/score.c +++ b/score.c @@ -16,12 +16,6 @@ * 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 #include #include @@ -29,6 +23,13 @@ #include #include +#include "SFont.h" + +#include "common.h" +#include "config.h" +#include "file.h" +#include "score.h" + // High score table struct highscore g_scores[N_SCORES] = { {1*60*1000,"-"}, @@ -43,7 +44,7 @@ struct highscore g_scores[N_SCORES] = { extern SFont_Font *g_font; -int cur_score; // which score we're currently entering. +int cur_score = -1; // which score we're currently entering. void read_high_score_table() @@ -55,8 +56,6 @@ read_high_score_table() if(f) { // If the file exists, read from it for(i = 0; i 0) name[n--]=0; - else if(e.key.keysym.sym == SDLK_RETURN) { - SDL_EnableUNICODE(0); - return false; + if(k == SDLK_BACKSPACE) { + if(n > 0) name[--n]=0; + } else { + if(k == SDLK_RETURN) { + SDL_EnableUNICODE(0); + cur_score = -1; + return false; + } else name[n++] = c; } - else name[n++] = c; } return true; }