/* * IceBreaker * Copyright (c) 2000-2001 Matthew Miller * http://www.mattdm.org/ * * 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 "SDL/SDL.h" #ifndef _TINSPIRE #include #include #endif #include "icebreaker.h" #include "globals.h" #include "hiscore.h" char hiscorename[HISCORENUM][50]; long hiscoreval[HISCORENUM]; static char temphiscorename[HISCORENUM+1][50]; //used for sorting static long temphiscoreval[HISCORENUM+1]; static int cmpscore(int * a, int * b); void readhiscores() { #ifdef _TINSPIRE return; #endif printf("Beginning readhiscores\n"); FILE *hiscorefile; char linebuf[50]; int arrayindex[HISCORENUM]; int i; // fill the "helper" array. for (i=0;ihiscoreval[HISCORENUM-1]); } void addhiscore(char * username, long score) { #ifdef _TINSPIRE: return; #endif printf("addhiscore\n"); int arrayindex[HISCORENUM+1]; // note the +1 -- we're including the new score FILE *hiscorefile; int i; // make sure the temp array contains the right data for (i=0;i.\n"); } else { // FIX -- make this go. :) //for (i=0;hiscorename[i]!='\0';i++) // if (hiscorename[i]==' ') hiscorename[i]='_'; for (i=0;i