Difference for main/gauges.c from version 1.2 to 1.3


version 1.2 version 1.3
Line 19
 
Line 19
  * Inferno gauge drivers   * Inferno gauge drivers
  *   *
  * $Log$   * $Log$
    * Revision 1.3  1999/10/07 20:59:18  donut
    * support for variable game font sizes
    *
  * Revision 1.2  1999/08/31 07:47:03  donut   * Revision 1.2  1999/08/31 07:47:03  donut
  * added user configurable number of hud message lines (and moved some defines to hudmsg.h to remove redundancy in gauges.c)   * added user configurable number of hud message lines (and moved some defines to hudmsg.h to remove redundancy in gauges.c)
  *   *
Line 895
 
Line 898
  //gr_set_current_canvas(&VR_render_sub_buffer[0]); //render off-screen   //gr_set_current_canvas(&VR_render_sub_buffer[0]); //render off-screen
  gr_set_curfont( GAME_FONT );   gr_set_curfont( GAME_FONT );
  gr_set_fontcolor(gr_getcolor(0,31,0),-1 );   gr_set_fontcolor(gr_getcolor(0,31,0),-1 );
  gr_printf(0x8000, grd_curcanv->cv_h-8,TXT_LOCK);   gr_printf(0x8000, grd_curcanv->cv_h-(GAME_FONT->ft_h+3),TXT_LOCK);//originally cv_h-8
  }   }
  }   }
 }  }
Line 929
 
Line 932
  gr_set_curfont( GAME_FONT );   gr_set_curfont( GAME_FONT );
  gr_set_fontcolor(gr_getcolor(0,31,0),-1 );   gr_set_fontcolor(gr_getcolor(0,31,0),-1 );
  if (Game_mode & GM_MULTI)   if (Game_mode & GM_MULTI)
       gr_printf(2, grd_curcanv->cv_h-40,"%s: %i", TXT_ENERGY, f2ir(Players[Player_num].energy));        gr_printf(2, grd_curcanv->cv_h-(GAME_FONT->ft_h*5+3*5),"%s: %i", TXT_ENERGY, f2ir(Players[Player_num].energy));//originally cv_h-40
  else   else
       gr_printf(2, grd_curcanv->cv_h-8,"%s: %i", TXT_ENERGY, f2ir(Players[Player_num].energy));        gr_printf(2, grd_curcanv->cv_h-(GAME_FONT->ft_h+3),"%s: %i", TXT_ENERGY, f2ir(Players[Player_num].energy));//originally cv_h-8
  }   }
 //end edit -MM  //end edit -MM
  if (Newdemo_state==ND_STATE_RECORDING ) {   if (Newdemo_state==ND_STATE_RECORDING ) {
Line 953
 
Line 956
  int i,w,h,aw;   int i,w,h,aw;
  char weapon_str[10];   char weapon_str[10];
  if (vertical){   if (vertical){
              y=y+23;//32;               //y=y+23;//32;
                y=y+GAME_FONT->ft_h*4+3;//originally y+23;
  if (type==0 && clear)   if (type==0 && clear)
       x=x-3;//quick hack to prevent 10000 vulcan from going into the hud        x=x-3;//quick hack to prevent 10000 vulcan from going into the hud
  }   }
Line 1041
 
Line 1045
  gr_set_fontcolor(gr_getcolor(0,31,0),-1 );   gr_set_fontcolor(gr_getcolor(0,31,0),-1 );
   
  if (Game_mode & GM_MULTI)   if (Game_mode & GM_MULTI)
  y = grd_curcanv->cv_h-32;   y = grd_curcanv->cv_h-(GAME_FONT->ft_h*4+3*4);//originally cv_h-32
  else   else
  y = grd_curcanv->cv_h;   y = grd_curcanv->cv_h;
   
  if (Gauge_hud_mode==1){   if (Gauge_hud_mode==1){
  hud_show_weapons_mode1(0,0,0,grd_curcanv->cv_w,y-16);   hud_show_weapons_mode1(0,0,0,grd_curcanv->cv_w,y-(GAME_FONT->ft_h*2+3*2));//originally y-16
  hud_show_weapons_mode1(1,0,0,grd_curcanv->cv_w,y-8);   hud_show_weapons_mode1(1,0,0,grd_curcanv->cv_w,y-(GAME_FONT->ft_h+3));//originally y-8
  }   }
 //edited 02/10/99 Matt Mueller - put energy/shield as part of new hud modes  //edited 02/10/99 Matt Mueller - put energy/shield as part of new hud modes
  else if (Gauge_hud_mode==2 || Gauge_hud_mode==3){   else if (Gauge_hud_mode==2 || Gauge_hud_mode==3){
  int x1,x2;   int x1,x2;
    int w, aw;
    gr_get_string_size("V1000", &w, &x1, &aw );
    gr_get_string_size("0 ", &x2, &x1, &aw);
  if (Gauge_hud_mode==2){   if (Gauge_hud_mode==2){
  y=grd_curcanv->cv_h-(grd_curcanv->cv_h/4);   y=grd_curcanv->cv_h-(grd_curcanv->cv_h/4);
  x1=grd_curcanv->cv_w/2-20;   x1=grd_curcanv->cv_w/2-(w);//originally /2-20
  x2=grd_curcanv->cv_w/2+10;   x2=grd_curcanv->cv_w/2+x2;//originally /2+10
  }else{   }else{
  y=grd_curcanv->cv_h/2+8;   y=grd_curcanv->cv_h/2+8;
  x1=grd_curcanv->cv_w/2-60;   x1=grd_curcanv->cv_w/2-(40+w);//originally /2-60
  x2=grd_curcanv->cv_w/2+50;   x2=grd_curcanv->cv_w/2+(42+x2);//originally /2+50
  }   }
  hud_show_weapons_mode1(0,1,0,x1,y);   hud_show_weapons_mode1(0,1,0,x1,y);
  hud_show_weapons_mode1(1,1,0,x2,y);   hud_show_weapons_mode1(1,1,0,x2,y);
  gr_set_fontcolor(gr_getcolor(14,14,23),-1 );   gr_set_fontcolor(gr_getcolor(14,14,23),-1 );
 // gr_printf(grd_curcanv->cv_w/2-8, y-27,"S%i", f2ir(Players[Player_num].shields));  // gr_printf(grd_curcanv->cv_w/2-8, y-27,"S%i", f2ir(Players[Player_num].shields));
 // gr_printf(grd_curcanv->cv_w/2-20, y-27,"S%i", f2ir(Players[Player_num].shields));  // gr_printf(grd_curcanv->cv_w/2-20, y-27,"S%i", f2ir(Players[Player_num].shields));
  gr_printf(x2, y-24,"S%i", f2ir(Players[Player_num].shields));   gr_printf(x2, y-(GAME_FONT->ft_h*4+4),"S%i", f2ir(Players[Player_num].shields));//originally y-24
  gr_set_fontcolor(gr_getcolor(25,18,6),-1 );   gr_set_fontcolor(gr_getcolor(25,18,6),-1 );
 // gr_printf(grd_curcanv->cv_w/2-20, y-19,"E%i", f2ir(Players[Player_num].energy));  // gr_printf(grd_curcanv->cv_w/2-20, y-19,"E%i", f2ir(Players[Player_num].energy));
  gr_printf(x1, y-24,"E%i", f2ir(Players[Player_num].energy));   gr_printf(x1, y-(GAME_FONT->ft_h*4+4),"E%i", f2ir(Players[Player_num].energy));//originally y-24
  }   }
 //end edit -MM  //end edit -MM
  else{   else{
Line 1077
 
Line 1084
  int w, h, aw;   int w, h, aw;
   
 // #ifndef RELEASE  // #ifndef RELEASE
  y -= 8;   y -= GAME_FONT->ft_h+3;//originally 8
 // #endif  // #endif
    
  switch (Primary_weapon) {   switch (Primary_weapon) {
Line 1104
 
Line 1111
  }   }
    
  gr_get_string_size(weapon_str, &w, &h, &aw );   gr_get_string_size(weapon_str, &w, &h, &aw );
  gr_printf(grd_curcanv->cv_w-5-w, y-8, weapon_str);   gr_printf(grd_curcanv->cv_w-5-w, y-(GAME_FONT->ft_h+3), weapon_str);//originally y-8
    
    
   
Line 1135
 
Line 1142
 //added on 10/5/98 by Victor Rachels to add bomb count  //added on 10/5/98 by Victor Rachels to add bomb count
  sprintf(weapon_str, "PROX %u",Players[Player_num].secondary_ammo[2]);   sprintf(weapon_str, "PROX %u",Players[Player_num].secondary_ammo[2]);
  gr_get_string_size(weapon_str, &w,&h, &aw );   gr_get_string_size(weapon_str, &w,&h, &aw );
  gr_printf(grd_curcanv->cv_w-5-w, y-16, weapon_str);   gr_printf(grd_curcanv->cv_w-5-w, y-(GAME_FONT->ft_h*2+3*2), weapon_str);//originally y-16
    
 //end this section addition  //end this section addition
  }   }
Line 1165
 
Line 1172
  int y = grd_curcanv->cv_h;   int y = grd_curcanv->cv_h;
   
  if (Game_mode & GM_MULTI)   if (Game_mode & GM_MULTI)
  y -= 72;   y -= (GAME_FONT->ft_h*9+3*9);//originally y-72
  else   else
  y -= 32;   y -= (GAME_FONT->ft_h*4+3*4);//originally y-32
   
  if ((Players[Player_num].cloak_time+CLOAK_TIME_MAX - GameTime > F1_0*3 ) || (GameTime & 0x8000))   if ((Players[Player_num].cloak_time+CLOAK_TIME_MAX - GameTime > F1_0*3 ) || (GameTime & 0x8000))
  gr_printf(2, y, "%s", TXT_CLOAKED);   gr_printf(2, y, "%s", TXT_CLOAKED);
Line 1177
 
Line 1184
  int y = grd_curcanv->cv_h;   int y = grd_curcanv->cv_h;
   
  if (Game_mode & GM_MULTI)   if (Game_mode & GM_MULTI)
  y -= 80;   y -= (GAME_FONT->ft_h*10+3*10);//originally y-80
  else   else
  y -= 40;   y -= (GAME_FONT->ft_h*5+3*5);//originally y-40
   
  if (((Players[Player_num].invulnerable_time + INVULNERABLE_TIME_MAX - GameTime) > F1_0*4) || (GameTime & 0x8000))   if (((Players[Player_num].invulnerable_time + INVULNERABLE_TIME_MAX - GameTime) > F1_0*4) || (GameTime & 0x8000))
  gr_printf(2, y, "%s", TXT_INVULNERABLE);   gr_printf(2, y, "%s", TXT_INVULNERABLE);
Line 1196
 
Line 1203
  gr_set_fontcolor(gr_getcolor(0,31,0),-1 );   gr_set_fontcolor(gr_getcolor(0,31,0),-1 );
  if ( Players[Player_num].shields >= 0 ) {   if ( Players[Player_num].shields >= 0 ) {
  if (Game_mode & GM_MULTI)   if (Game_mode & GM_MULTI)
       gr_printf(2, grd_curcanv->cv_h-48,"%s: %i", TXT_SHIELD, f2ir(Players[Player_num].shields));        gr_printf(2, grd_curcanv->cv_h-(GAME_FONT->ft_h*6+3*6),"%s: %i", TXT_SHIELD, f2ir(Players[Player_num].shields));//originally cv_h-48
  else   else
       gr_printf(2, grd_curcanv->cv_h-16,"%s: %i", TXT_SHIELD, f2ir(Players[Player_num].shields));        gr_printf(2, grd_curcanv->cv_h-(GAME_FONT->ft_h*2+3*2),"%s: %i", TXT_SHIELD, f2ir(Players[Player_num].shields));//originally cv_h-16
  } else {   } else {
  if (Game_mode & GM_MULTI)   if (Game_mode & GM_MULTI)
       gr_printf(2, grd_curcanv->cv_h-48,"%s: 0", TXT_SHIELD );        gr_printf(2, grd_curcanv->cv_h-(GAME_FONT->ft_h*6+3*6),"%s: 0", TXT_SHIELD );//originally cv_h-48
  else   else
       gr_printf(2, grd_curcanv->cv_h-16,"%s: 0", TXT_SHIELD );        gr_printf(2, grd_curcanv->cv_h-(GAME_FONT->ft_h*2+3*2),"%s: 0", TXT_SHIELD );//originally cv_h-16
  }   }
  }   }
 //end edit -MM  //end edit -MM
Line 2372
 
Line 2379
 #endif  #endif
   
 //draw all the things on the HUD  //draw all the things on the HUD
   
   extern int last_drawn_cockpit[2];
   
 void draw_hud()  void draw_hud()
 {  {
   
   #ifdef OGL
    if (Cockpit_mode==CM_STATUS_BAR){
    //ogl needs to redraw every frame, at least currently.
   // init_cockpit();
   // last_drawn_cockpit[0]=-1;
   // last_drawn_cockpit[1]=-1;
      init_gauges();
   
   // vr_reset_display();
    }
   #endif
  // Show score so long as not in rearview   // Show score so long as not in rearview
  if ( !Rear_view && Cockpit_mode!=CM_REAR_VIEW && Cockpit_mode!=CM_STATUS_BAR) {   if ( !Rear_view && Cockpit_mode!=CM_REAR_VIEW && Cockpit_mode!=CM_STATUS_BAR) {
  hud_show_score();   hud_show_score();

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