Difference for main/scores.c from version 1.1 to 1.2


version 1.1 version 1.2
Line 19
 
Line 19
  * Inferno High Scores and Statistics System   * Inferno High Scores and Statistics System
  *   *
  * $Log$   * $Log$
  * Revision 1.1  1999/06/14 22:11:32  donut   * Revision 1.2  1999/11/20 10:05:18  donut
  * Initial revision   * variable size menu patch from Jan Bobrowski.  Variable menu font size support and a bunch of fixes for menus that didn't work quite right, by me (MPM).
    *
    * Revision 1.1.1.1  1999/06/14 22:11:32  donut
    * Import of d1x 1.37 source.
  *   *
  * Revision 2.2  1995/06/15  12:13:54  john   * Revision 2.2  1995/06/15  12:13:54  john
  * Made end game, win game and title sequences all go   * Made end game, win game and title sequences all go
Line 270
 
Line 273
 void scores_view(int citem);  void scores_view(int citem);
   
 #define VERSION_NUMBER 1  #define VERSION_NUMBER 1
 #define SCORES_FILENAME "DESCENT.HI"  #define SCORES_FILENAME "descent.hi"//"DESCENT.HI"
 #define COOL_MESSAGE_LEN 50  #define COOL_MESSAGE_LEN 50
 #define MAX_HIGH_SCORES 10  #define MAX_HIGH_SCORES 10
   
Line 487
 
Line 490
   
 #define TEXT_FONT  (Gamefonts[GFONT_MEDIUM_3])  #define TEXT_FONT  (Gamefonts[GFONT_MEDIUM_3])
   
   static float scale=1.0;
   #define scaley scale
   #define scalex scale
   
 void scores_rprintf(int x, int y, char * format, ... )  void scores_rprintf(int x, int y, char * format, ... )
 {  {
  va_list args;   va_list args;
Line 504
 
Line 511
   
  gr_get_string_size(buffer, &w, &h, &aw );   gr_get_string_size(buffer, &w, &h, &aw );
   
  gr_string( x-w, y, buffer );   gr_string( x*scalex-w, y*scaley, buffer );
 }  }
   
   
Line 526
 
Line 533
  }   }
   
  if (strlen(stats->name)==0) {   if (strlen(stats->name)==0) {
  gr_printf( 26+33+XX, y+YY, TXT_EMPTY );   gr_printf( (26+33+XX)*scalex, (y+YY)*scaley, TXT_EMPTY );
  return;   return;
  }   }
  gr_printf( 26+33+XX, y+YY, "%s", stats->name );   gr_printf( (26+33+XX)*scalex, (y+YY)*scaley, "%s", stats->name );
  int_to_string(stats->score, buffer);   int_to_string(stats->score, buffer);
  scores_rprintf( 109+33+XX, y+YY, "%s", buffer );   scores_rprintf( 109+33+XX, y+YY, "%s", buffer );
   
  gr_printf( 125+33+XX, y+YY, "%s", MENU_DIFFICULTY_TEXT(stats->diff_level) );   gr_printf( (125+33+XX)*scalex, (y+YY)*scaley, "%s", MENU_DIFFICULTY_TEXT(stats->diff_level) );
   
  if ( (stats->starting_level > 0 ) && (stats->ending_level > 0 ))   if ( (stats->starting_level > 0 ) && (stats->ending_level > 0 ))
  scores_rprintf( 192+33+XX, y+YY, "%d-%d", stats->starting_level, stats->ending_level );   scores_rprintf( 192+33+XX, y+YY, "%d-%d", stats->starting_level, stats->ending_level );
Line 561
 
Line 568
  int i,done,looper;   int i,done,looper;
  int k;   int k;
  byte fades[64] = { 1,1,1,2,2,3,4,4,5,6,8,9,10,12,13,15,16,17,19,20,22,23,24,26,27,28,28,29,30,30,31,31,31,31,31,30,30,29,28,28,27,26,24,23,22,20,19,17,16,15,13,12,10,9,8,6,5,4,4,3,2,2,1,1 };   byte fades[64] = { 1,1,1,2,2,3,4,4,5,6,8,9,10,12,13,15,16,17,19,20,22,23,24,26,27,28,28,29,30,30,31,31,31,31,31,30,30,29,28,28,27,26,24,23,22,20,19,17,16,15,13,12,10,9,8,6,5,4,4,3,2,2,1,1 };
    grs_canvas canvas;
   
 ReshowScores:  ReshowScores:
  scores_read();   scores_read();
   
  set_screen_mode(SCREEN_MENU);   set_screen_mode(SCREEN_MENU);
    
  gr_set_current_canvas(NULL);  // menu screen scaling, 10/14/99 Jan Bobrowski - scaling for different font sizes 11/18/99 Matt Mueller
    scale=GAME_FONT->ft_h/5.0;//5 is the size of the standard font the menus were designed for.
    gr_init_sub_canvas(&canvas, &grd_curscreen->sc_canvas, (SWIDTH - 320*scale)/2, (SHEIGHT - 200*scale)/2, 320*scale, 200*scale);
    gr_set_current_canvas(&canvas);
    
  nm_draw_background(0,0,grd_curcanv->cv_bitmap.bm_w, grd_curcanv->cv_bitmap.bm_h );   nm_draw_background(0, 0, GWIDTH-1, GHEIGHT-1);//args are x,y,x2,y2 NOT x,y,w,h
   
  grd_curcanv->cv_font = Gamefonts[GFONT_MEDIUM_3];   grd_curcanv->cv_font = Gamefonts[GFONT_MEDIUM_3];
   
  gr_string( 0x8000, 15, TXT_HIGH_SCORES );   gr_string( 0x8000, 15*scaley, TXT_HIGH_SCORES );
   
  grd_curcanv->cv_font = Gamefonts[GFONT_SMALL];   grd_curcanv->cv_font = Gamefonts[GFONT_SMALL];
   
  gr_set_fontcolor( BM_XRGB(31,26,5), -1 );   gr_set_fontcolor( BM_XRGB(31,26,5), -1 );
  gr_string(  31+33+XX, 46+7+YY, TXT_NAME );   gr_string( ( 31+33+XX)*scalex, (46+7+YY)*scaley, TXT_NAME );
  gr_string(  82+33+XX, 46+7+YY, TXT_SCORE );   gr_string( ( 82+33+XX)*scalex, (46+7+YY)*scaley, TXT_SCORE );
  gr_string( 127+33+XX, 46+7+YY, TXT_SKILL );   gr_string( (127+33+XX)*scalex, (46+7+YY)*scaley, TXT_SKILL );
  gr_string( 170+33+XX, 46+7+YY, TXT_LEVELS );   gr_string( (170+33+XX)*scalex, (46+7+YY)*scaley, TXT_LEVELS );
 // gr_string( 202, 46, "Kills" );  // gr_string( 202, 46, "Kills" );
 // gr_string( 234, 46, "Rescues" );  // gr_string( 234, 46, "Rescues" );
  gr_string( 288-42+XX, 46+7+YY, TXT_TIME );   gr_string( (288-42+XX)*scalex, (46+7+YY)*scaley, TXT_TIME );
   
  if ( citem < 0 )    if ( citem < 0 )
  gr_string( 0x8000, 175, TXT_PRESS_CTRL_R );   gr_string( 0x8000, 175*scaley, TXT_PRESS_CTRL_R );
   
  gr_set_fontcolor( BM_XRGB(28,28,28), -1 );   gr_set_fontcolor( BM_XRGB(28,28,28), -1 );
   
  gr_printf( 0x8000, 31, "%c%s%c  - %s", 34, Scores.cool_saying, 34, Scores.stats[0].name );   gr_printf( 0x8000, 31*scaley, "%c%s%c  - %s", 34, Scores.cool_saying, 34, Scores.stats[0].name );
    
  for (i=0; i<MAX_HIGH_SCORES; i++ ) {   for (i=0; i<MAX_HIGH_SCORES; i++ ) {
  if (i==0) {   if (i==0) {

Legend:
line(s) removed in v.1.1 
line(s) changed
 line(s) added in v.1.2