Difference for main/inferno.c from version 1.17 to 1.18


version 1.17 version 1.18
Line 18
 
Line 18
  * main() for Inferno     * main() for Inferno 
  *   *
  * $Log$   * $Log$
    * Revision 1.18  1999/11/21 13:00:08  donut
    * Changed screen_mode format.  Now directly encodes res into a 32bit int, rather than using arbitrary values.
    *
  * Revision 1.17  1999/11/20 10:05:17  donut   * Revision 1.17  1999/11/20 10:05:17  donut
  * 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).   * 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).
  *   *
Line 828
 
Line 831
 unsigned int descent_critical_deverror = 0;  unsigned int descent_critical_deverror = 0;
 unsigned int descent_critical_errcode = 0;  unsigned int descent_critical_errcode = 0;
   
 int menu_screen_mode; // mode used for menus -- jb  u_int32_t menu_screen_mode=SM(320,200); // mode used for menus -- jb
   int menu_use_game_res=1;
   
 #ifdef EDITOR  #ifdef EDITOR
 int Inferno_is_800x600_available = 0;  int Inferno_is_800x600_available = 0;
Line 838
 
Line 842
 {  {
 #ifdef __MSDOS__  #ifdef __MSDOS__
  int result;   int result;
  result=gr_check_mode(SM_320x200C);   result=gr_check_mode(SM(320,200));
   
 #ifdef EDITOR  #ifdef EDITOR
  if ( result==0 )    if ( result==0 )
  result=gr_check_mode(SM_800x600V);   result=gr_check_mode(SM(800,600));
 #endif  #endif
   
  switch( result ) {   switch( result ) {
Line 952
 
Line 956
         printf( "  -niceautomap    %s\n", "Free cpu while doing automap");          printf( "  -niceautomap    %s\n", "Free cpu while doing automap");
         printf( "  -automap<X>x<Y> %s\n", "Set automap resolution to <X> by <Y>");          printf( "  -automap<X>x<Y> %s\n", "Set automap resolution to <X> by <Y>");
         printf( "  -automap_gameres %s\n", "Set automap to use the same resolution as in game");          printf( "  -automap_gameres %s\n", "Set automap to use the same resolution as in game");
           printf( "  -menu<X>x<Y>    %s\n", "Set menu resolution to <X> by <Y>");
           printf( "  -menu_gameres   %s\n", "Set menus to use the same resolution as in game");
         printf( "  -ackmsg         %s\n", "Turn on packet acknowledgement debug msgs");          printf( "  -ackmsg         %s\n", "Turn on packet acknowledgement debug msgs");
  printf( "\n%s\n",TXT_PRESS_ANY_KEY3);   printf( "\n%s\n",TXT_PRESS_ANY_KEY3);
  getch();   getch();
Line 1042
 
Line 1048
  char start_demo[13];   char start_demo[13];
  int screen_width = 640;   int screen_width = 640;
  int screen_height = 480;   int screen_height = 480;
  int screen_mode = SM_640x480V;   u_int32_t screen_mode = SM(640,480);
   
  error_init(NULL);   error_init(NULL);
   
Line 1309
 
Line 1315
  int screen_compatible = 1;   int screen_compatible = 1;
  int use_double_buffer = 0;   int use_double_buffer = 0;
   
  if ( (i=FindArg( "-320x100" ))) {  
  argnum=i;  
  if (Inferno_verbose) printf( "Using 320x100 VGA...\n" );  
                         screen_mode = 19;  
                         screen_width = 320;  
  screen_height = 100;  
  screen_compatible = 0;  
  }  
   
 //added/edited on 12/14/98 by Matt Mueller - override res in d1x.ini with command line args  //added/edited on 12/14/98 by Matt Mueller - override res in d1x.ini with command line args
 //added on 9/30/98 by Matt Mueller clean up screen mode code, and add higher resolutions  //added on 9/30/98 by Matt Mueller clean up screen mode code, and add higher resolutions
 #define SCREENMODE(V,X,Y,C) if ( (i=FindArg( "-" #X "x" #Y ))&&(i<argnum))  {argnum=i; screen_mode = SM_ ## X ## x ## Y ## V;if (Inferno_verbose) printf( "Using " #X "x" #Y " " #V "...\n" );screen_width = X;screen_height = Y;use_double_buffer = 1;screen_compatible = C;}  #define SCREENMODE(X,Y,C) if ( (i=FindArg( "-" #X "x" #Y ))&&(i<argnum))  {argnum=i; screen_mode = SM( X , Y );if (Inferno_verbose) printf( "Using " #X "x" #Y " ...\n" );screen_width = X;screen_height = Y;use_double_buffer = 1;screen_compatible = C;}
 //aren't #defines great? :)  //aren't #defines great? :)
   
  SCREENMODE(C,320,200,1);   SCREENMODE(320,100,0);
    SCREENMODE(320,200,1);
 //end addition/edit -MM  //end addition/edit -MM
  SCREENMODE(U,320,240,0);   SCREENMODE(320,240,0);
  SCREENMODE(U,320,400,0);   SCREENMODE(320,400,0);
  SCREENMODE(V,640,400,0);   SCREENMODE(640,400,0);
  SCREENMODE(V,640,480,0);   SCREENMODE(640,480,0);
  SCREENMODE(V,800,600,0);   SCREENMODE(800,600,0);
  SCREENMODE(V,1024,768,0);   SCREENMODE(1024,768,0);
    SCREENMODE(1280,1024,0);
    SCREENMODE(1600,1200,0);
 //end addition -MM  //end addition -MM
    
 //added ifdefs on 9/30/98 by Matt Mueller to fix high res in linux  //added ifdefs on 9/30/98 by Matt Mueller to fix high res in linux
Line 1353
 
Line 1353
  {   {
 //added/edited on 12/14/98 by Matt Mueller - override res in d1x.ini with command line args  //added/edited on 12/14/98 by Matt Mueller - override res in d1x.ini with command line args
  int i, argnum=INT_MAX;   int i, argnum=INT_MAX;
 //added on 9/30/98 by Matt Mueller for selectable automap modes  //added on 9/30/98 by Matt Mueller for selectable automap modes - edited 11/21/99 whee, more fun with defines.
 #define MAPMODE(V,X,Y) if ( (i=FindArg( "-automap" #X "x" #Y )) && (i<argnum))  {argnum=i; automap_mode = SM_ ## X ## x ## Y ## V;automap_width = X;automap_height = Y;}  #define SMODE(V,VV,VG,X,Y) if ( (i=FindArg( "-" #V #X "x" #Y )) && (i<argnum))  {argnum=i; VV = SM( X , Y );VG=0;}
   #define SMODE_GR(V,VG) if ((i=FindArg("-" #V "_gameres"))){if (i<argnum) VG=1;}
   #define SMODE_PRINT(V,VV,VG) if (Inferno_verbose) { if (VG) printf( #V " using game resolution ...\n"); else printf( #V " using %ix%i ...\n",SM_W(VV),SM_H(VV) ); }
 //aren't #defines great? :)  //aren't #defines great? :)
 //end addition/edit -MM  //end addition/edit -MM
   #define S_MODE(V,VV,VG) argnum=INT_MAX;SMODE(V,VV,VG,320,200);SMODE(V,VV,VG,320,240);SMODE(V,VV,VG,320,400);SMODE(V,VV,VG,640,400);SMODE(V,VV,VG,640,480);SMODE(V,VV,VG,800,600);SMODE(V,VV,VG,1024,768);SMODE(V,VV,VG,1280,1024);SMODE(V,VV,VG,1600,1200);SMODE_GR(V,VG);SMODE_PRINT(V,VV,VG);
   
  MAPMODE(C,320,200);  
  MAPMODE(U,320,240);  
  MAPMODE(U,320,400);  
  MAPMODE(V,640,400);  
  MAPMODE(V,640,480);  
  MAPMODE(V,800,600);  
  MAPMODE(V,1024,768);  
  if ((i=FindArg("-automap_gameres"))){  
  if (i<argnum)  
  automap_use_game_res=1;  
  }  
   
  if (Inferno_verbose) {   S_MODE(automap,automap_mode,automap_use_game_res);
  if (automap_use_game_res)   S_MODE(menu,menu_screen_mode,menu_use_game_res);
  printf( "automap using game resolution ...\n");  
  else  
  printf( "automap using %ix%i ...\n",automap_width,automap_height );  
  }  
  }   }
 //end addition -MM  //end addition -MM
    
Line 1400
 
Line 1388
  Error(TXT_CANT_INIT_GFX,t);   Error(TXT_CANT_INIT_GFX,t);
  // Load the palette stuff. Returns non-zero if error.   // Load the palette stuff. Returns non-zero if error.
  mprintf( (0, "Going into graphics mode..." ));   mprintf( (0, "Going into graphics mode..." ));
  menu_screen_mode = SM_320x200C;   gr_set_mode(MENU_SCREEN_MODE);
  if(screen_width >= 640 && screen_height >= 480)  
  menu_screen_mode = SM_640x480V;  
  gr_set_mode(menu_screen_mode);  
  mprintf( (0, "\nInitializing palette system..." ));   mprintf( (0, "\nInitializing palette system..." ));
  gr_use_palette_table( "PALETTE.256" );   gr_use_palette_table( "PALETTE.256" );
  mprintf( (0, "\nInitializing font system..." ));   mprintf( (0, "\nInitializing font system..." ));

Legend:
line(s) removed in v.1.17 
line(s) changed
 line(s) added in v.1.18