Difference for main/game.c from version 1.15 to 1.16


version 1.15 version 1.16
Line 19
 
Line 19
  * Game loop for Inferno   * Game loop for Inferno
  *   *
  * $Log$   * $Log$
    * Revision 1.16  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.15  1999/11/20 10:05:17  donut   * Revision 1.15  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 514
 
Line 517
   
 ubyte VR_use_paging = 0;  ubyte VR_use_paging = 0;
 ubyte VR_current_page = 0;  ubyte VR_current_page = 0;
 int VR_screen_mode = 0;  u_int32_t VR_screen_mode = 0;
 int VR_render_width = 0;  int VR_render_width = 0;
 int VR_render_height = 0;  int VR_render_height = 0;
 int VR_render_mode = VR_NONE;  int VR_render_mode = VR_NONE;
Line 701
 
Line 704
 //end killed - OE  //end killed - OE
   
 //added 3/24/99 by Owen Evans for screen res changing  //added 3/24/99 by Owen Evans for screen res changing
 int Game_screen_mode = 0;  u_int32_t Game_screen_mode = 0;
 //end added - OE  //end added - OE
 int Game_window_w = 0;  int Game_window_w = 0;
 int Game_window_h = 0;  int Game_window_h = 0;
Line 771
 
Line 774
  Cockpit_mode = CM_FULL_SCREEN;   Cockpit_mode = CM_FULL_SCREEN;
   
 //changed 7/5/99 - Owen Evans for letterbox in hi res  //changed 7/5/99 - Owen Evans for letterbox in hi res
         if ( VR_screen_mode != SM_320x200C && Cockpit_mode != CM_LETTERBOX)    {               // This really should be 'if VR_screen_mode isn't linear'          if ( VR_screen_mode != SM(320,200) && Cockpit_mode != CM_LETTERBOX)    {               // This really should be 'if VR_screen_mode isn't linear'
 //end changed - OE  //end changed - OE
                 // We can only use cockpit or rearview mode in mode 13h                  // We can only use cockpit or rearview mode in mode 13h
                 //if ( (Cockpit_mode==CM_FULL_COCKPIT) || (Cockpit_mode==CM_REAR_VIEW) )        {                  //if ( (Cockpit_mode==CM_FULL_COCKPIT) || (Cockpit_mode==CM_REAR_VIEW) )        {
Line 922
 
Line 925
   
 void grow_window()  void grow_window()
 {  {
  if ((Cockpit_mode == CM_FULL_COCKPIT) && (grd_curscreen->sc_mode == SM_320x200C)) {   if ((Cockpit_mode == CM_FULL_COCKPIT) && (grd_curscreen->sc_mode == SM(320,200))) {
  Game_window_h = max_window_h;   Game_window_h = max_window_h;
  Game_window_w = VR_render_width;   Game_window_w = VR_render_width;
  toggle_cockpit();   toggle_cockpit();
Line 931
 
Line 934
  return;   return;
  }   }
   
  if ((Cockpit_mode != CM_STATUS_BAR) && (grd_curscreen->sc_mode == SM_320x200C))   if ((Cockpit_mode != CM_STATUS_BAR) && (grd_curscreen->sc_mode == SM(320,200)))
  return;   return;
   
  if (Cockpit_mode == CM_FULL_SCREEN)   if (Cockpit_mode == CM_FULL_SCREEN)
  max_window_h = VR_render_height;    max_window_h = VR_render_height;
   
  if ((Game_window_h >= max_window_h) && (grd_curscreen->sc_mode == SM_320x200C)) {   if ((Game_window_h >= max_window_h) && (grd_curscreen->sc_mode == SM(320,200))) {
  Game_window_w = VR_render_width;   Game_window_w = VR_render_width;
  Game_window_h = VR_render_height;   Game_window_h = VR_render_height;
  select_cockpit(CM_FULL_SCREEN);   select_cockpit(CM_FULL_SCREEN);
Line 1039
 
Line 1042
  return;   return;
  }   }
   
  if ((Cockpit_mode == CM_FULL_SCREEN) && (grd_curscreen->sc_mode == SM_320x200C)) {   if ((Cockpit_mode == CM_FULL_SCREEN) && (grd_curscreen->sc_mode == SM(320,200))) {
  Game_window_h = max_window_h;   Game_window_h = max_window_h;
  select_cockpit(CM_STATUS_BAR);   select_cockpit(CM_STATUS_BAR);
  return;   return;
  }   }
   
  if ((Cockpit_mode != CM_STATUS_BAR) && (grd_curscreen->sc_mode == SM_320x200C))   if ((Cockpit_mode != CM_STATUS_BAR) && (grd_curscreen->sc_mode == SM(320,200)))
  return;   return;
    
  if (Cockpit_mode == CM_FULL_SCREEN)   if (Cockpit_mode == CM_FULL_SCREEN)
Line 1100
 
Line 1103
   
   
 // Sets up the canvases we will be rendering to  // Sets up the canvases we will be rendering to
 void game_init_render_buffers(int screen_mode, int render_w, int render_h, int use_paging, int render_method, int compatible_menus )  void game_init_render_buffers(u_int32_t screen_mode, int render_w, int render_h, int use_paging, int render_method, int compatible_menus )
 {  {
  if (!VR_offscreen_buffer) {   if (!VR_offscreen_buffer) {
  VR_use_paging = use_paging;   VR_use_paging = use_paging;
Line 1201
 
Line 1204
   
  switch( Screen_mode ) {   switch( Screen_mode ) {
  case SCREEN_MENU:   case SCREEN_MENU:
  if (grd_curscreen->sc_mode != menu_screen_mode) {   if (grd_curscreen->sc_mode != MENU_SCREEN_MODE) {
  if (gr_set_mode(menu_screen_mode)) Error("Cannot set screen mode for game!");   if (gr_set_mode(MENU_SCREEN_MODE)) Error("Cannot set screen mode for game!");
  gr_palette_load( gr_palette );   gr_palette_load( gr_palette );
  }   }
                 gr_init_sub_canvas( &VR_screen_pages[0], &grd_curscreen->sc_canvas, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );                  gr_init_sub_canvas( &VR_screen_pages[0], &grd_curscreen->sc_canvas, 0, 0, grd_curscreen->sc_w, grd_curscreen->sc_h );
Line 1211
 
Line 1214
  case SCREEN_GAME:   case SCREEN_GAME:
  if (grd_curscreen->sc_mode != VR_screen_mode)   if (grd_curscreen->sc_mode != VR_screen_mode)
  if (gr_set_mode(VR_screen_mode)) {   if (gr_set_mode(VR_screen_mode)) {
  if ( VR_screen_mode != SM_640x480V )   if ( VR_screen_mode != SM(640,480) )
  Error("Cannot set screen mode for game!");   Error("Cannot set screen mode for game!");
  else   else
  Error( "Cannot set screen mode for game!\nMake sure that you have a VESA driver loaded\nthat can display 640x480 in 256 colors.\n" );   Error( "Cannot set screen mode for game!\nMake sure that you have a VESA driver loaded\nthat can display 640x480 in 256 colors.\n" );
Line 1224
 
Line 1227
 //End section  //End section
   
  if ( VR_render_mode == VR_NONE ) {   if ( VR_render_mode == VR_NONE ) {
  if ( max_window_h == 0 && grd_curscreen->sc_mode == SM_320x200C) {   if ( max_window_h == 0 && grd_curscreen->sc_mode == SM(320,200)) {
  max_window_h = grd_curscreen->sc_h - GameBitmaps[cockpit_bitmap[CM_STATUS_BAR].index].bm_h;   max_window_h = grd_curscreen->sc_h - GameBitmaps[cockpit_bitmap[CM_STATUS_BAR].index].bm_h;
  Game_window_h = max_window_h;   Game_window_h = max_window_h;
  } else if (grd_curscreen->sc_mode == SM_320x200C) {   } else if (grd_curscreen->sc_mode == SM(320,200)) {
  max_window_h = grd_curscreen->sc_h - GameBitmaps[cockpit_bitmap[CM_STATUS_BAR].index].bm_h;   max_window_h = grd_curscreen->sc_h - GameBitmaps[cockpit_bitmap[CM_STATUS_BAR].index].bm_h;
  } else {   } else {
  max_window_h = grd_curscreen->sc_h;   max_window_h = grd_curscreen->sc_h;
Line 1261
 
Line 1264
  break;   break;
  #ifdef EDITOR   #ifdef EDITOR
  case SCREEN_EDITOR:   case SCREEN_EDITOR:
  if (grd_curscreen->sc_mode != SM_800x600V) {   if (grd_curscreen->sc_mode != SM(800,600)) {
  int gr_error;   int gr_error;
  if ((gr_error=gr_set_mode(SM_800x600V))!=0) { //force into game scrren   if ((gr_error=gr_set_mode(SM(800,600)))!=0) { //force into game scrren
  Warning("Cannot init editor screen (error=%d)",gr_error);   Warning("Cannot init editor screen (error=%d)",gr_error);
  return 0;   return 0;
  }   }
Line 4123
 
Line 4126
  if (VR_render_mode == VR_NONE ) return;   if (VR_render_mode == VR_NONE ) return;
   
  if (VR_screen_mode == SCREEN_MENU) // low res 320x200 (overall) mode   if (VR_screen_mode == SCREEN_MENU) // low res 320x200 (overall) mode
  gr_set_mode( SM_320x400U );   gr_set_mode( SM(320,400) );
  set_screen_mode (SCREEN_MENU);   set_screen_mode (SCREEN_MENU);
  set_screen_mode (SCREEN_GAME);   set_screen_mode (SCREEN_GAME);
 }  }

Legend:
line(s) removed in v.1.15 
line(s) changed
 line(s) added in v.1.16