X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=score.c;h=31025a9761fb7034c976f1aa4c6e8a281bed89ff;hp=ac619dd58cac9138fd2222465c1ff75f7f67b391;hb=3ef599c7104a20c4f5268dbefb6590aa3e285663;hpb=6f82bba8833f187abebab53375ac87905487cf8c diff --git a/score.c b/score.c index ac619dd..31025a9 100644 --- a/score.c +++ b/score.c @@ -1,8 +1,20 @@ -#include "config.h" - -#include "SFont.h" -#include "file.h" -#include "score.h" +/* Variations on RockDodger + * Copyright (C) 2004 Joshua Grams + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include #include @@ -11,21 +23,28 @@ #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] = { - {13000,"Pad"}, - {12500,"Pad"}, - {6500,"Pad"}, - {5000,"Pad"}, - {3000,"Pad"}, - {2500,"Pad"}, - {2000,"Pad"}, - {1500,"Pad"} + {1*60*1000,"-"}, + {45*1000,"-"}, + {30*1000,"-"}, + {20*1000,"-"}, + {10*1000,"-"}, + {7*1000,"-"}, + {5*1000,"-"}, + {3*1000,"-"} }; 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() @@ -37,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; }