Common subdirectories: rockdodger-0.4.2/data and rockdodger-0.4.2-josh/data diff -u rockdodger-0.4.2/main.c rockdodger-0.4.2-josh/main.c --- rockdodger-0.4.2/main.c 2002-02-15 15:55:41.000000000 -0500 +++ rockdodger-0.4.2-josh/main.c 2004-08-28 13:16:57.000000000 -0400 @@ -275,6 +275,16 @@ fclose(f); } }/*}}}*/ +void snprintscore(char *s, size_t n, int score) {/*{{{*/ + int min = score/60000; + int sec = score/1000%60; + int tenths = score%1000/100; + if(min) { + snprintf(s, n, "%2d:%.2d.%d", min, sec, tenths); + } else { + snprintf(s, n, " %2d.%d", sec, tenths); + } +}/*}}}*/ float rnd() {/*{{{*/ return (float)random()/(float)RAND_MAX; }/*}}}*/ @@ -566,7 +576,7 @@ } int drawdots(SDL_Surface *s) {/*{{{*/ - int m, scorepos; + int m, scorepos, n; SDL_LockSurface(s); // Draw the background stars aka space dots @@ -578,7 +588,8 @@ SDL_UnlockSurface(s); scorepos = XSIZE-250; - snprintf(topline, 50, "Score: %d", score); + n = snprintf(topline, 50, "Time: "); + snprintscore(topline+n, 50-n, score); PutString(s,scorepos,0,topline); SDL_LockSurface(s); @@ -997,7 +1008,7 @@ char s[1024]; sprintf(s, "#%1d",i+1); PutString(surf_screen, 150, 50+(i+2)*font_height,s); - sprintf(s, "%04d", high[i].score); + snprintscore(s, 1024, high[i].score); PutString(surf_screen, 200, 50+(i+2)*font_height,s); sprintf(s, "%3s", high[i].name); PutString(surf_screen, 330, 50+(i+2)*font_height,s);