1
0
Fork 0

Fixed some warnings, updated whitespace.

This commit is contained in:
curt 2001-06-12 23:37:29 +00:00
parent 3d0ed99651
commit d0126ec533
5 changed files with 515 additions and 524 deletions

View file

@ -714,7 +714,7 @@ void fgCockpitUpdate( void ) {
int iwidth = xsize_node->getIntValue();
int iheight = ysize_node->getIntValue();
float width = iwidth;
float height = iheight;
// float height = iheight;
// FIXME: inefficient
if ( hud_visibility_node->getBoolValue() ) {

View file

@ -890,10 +890,10 @@ void fgHUDalphaInit( void ) {
puGetStringDescender (HUDalphaLabelFont) +
PUSTR_TGAP + PUSTR_BGAP + 5;
puFrame *
HUDalphaFrame = new puFrame ( 0, 0,
DialogWidth,
85 + nSliders * horiz_slider_height );
/* puFrame *
HUDalphaFrame = new puFrame ( 0, 0, DialogWidth,
85 + nSliders
* horiz_slider_height ); */
puText *
HUDalphaDialogMessage = new puText ( labelX,
@ -920,7 +920,6 @@ void fgHUDalphaInit( void ) {
sprintf( SliderText[ 0 ], "%05.2f", hud_trans_alpha );
HUDalphaText-> setLabel ( SliderText[ 0 ] ) ;
puOneShot *
HUDalphaOkButton = new puOneShot ( 10, 10, 60, 45 );
HUDalphaOkButton-> setLegend ( gui_msg_OK );
@ -937,6 +936,7 @@ void fgHUDalphaInit( void ) {
#undef HORIZONTAL
}
void fgHUDReshape(void) {
if ( HUDtext )
delete HUDtext;
@ -956,6 +956,7 @@ static void set_hud_color(float r, float g, float b) {
glColor3f(r,g,b);
}
// fgUpdateHUD
//
// Performs a once around the list of calls to instruments installed in

View file

@ -76,6 +76,7 @@ hud_card ::
hud_card( const hud_card & image):
instr_scale( (const instr_scale & ) image),
val_span( image.val_span),
type(image.type),
half_width_units (image.half_width_units),
draw_tick_bottom (image.draw_tick_bottom),
draw_tick_top (image.draw_tick_top),
@ -86,7 +87,6 @@ hud_card( const hud_card & image):
draw_cap_right (image.draw_cap_right),
draw_cap_left (image.draw_cap_left),
marker_offset (image.marker_offset),
type(image.type),
pointer (image.pointer),
pointer_type (image.pointer_type)
@ -120,8 +120,8 @@ operator = (const hud_card & rhs )
type = rhs.type;
pointer = rhs.pointer;
pointer_type = rhs.pointer_type;
}
return *this;
}
@ -129,12 +129,12 @@ void hud_card ::
draw( void ) // (HUD_scale * pscale )
{
float vmin, vmax;
float vmin = 0.0, vmax = 0.0;
int marker_xs;
int marker_xe;
int marker_ys;
int marker_ye;
int text_x, text_y;
int text_x = 0, text_y = 0;
int lenstr;
int height, width;
int i, last;
@ -142,7 +142,6 @@ draw( void ) // (HUD_scale * pscale )
bool condition;
int disp_val = 0;
POINT mid_scr = get_centroid();
float cur_value = get_value();
RECT scrn_rect = get_location();
@ -151,16 +150,13 @@ draw( void ) // (HUD_scale * pscale )
height = scrn_rect.top + scrn_rect.bottom;
width = scrn_rect.left + scrn_rect.right;
if(type=="guage") {
vmin = min_val();
vmax = max_val();
text_y = scrn_rect.top + FloatToInt((cur_value - vmin) * factor() /*+.5f*/);
text_x = marker_xs;
}
else
} else {
if(type=="tape") {
vmin = cur_value - half_width_units; // width units == needle travel
@ -168,7 +164,7 @@ draw( void ) // (HUD_scale * pscale )
text_x = mid_scr.x;
text_y = mid_scr.y;
}
}
// Draw the basic markings for the scale...
@ -202,9 +198,9 @@ draw( void ) // (HUD_scale * pscale )
// glEnd();
// We do not use else in the following so that combining the two
// options produces a "caged" display with double carrots. The
// same is done for horizontal card indicators.
// We do not use else in the following so that combining the
// two options produces a "caged" display with double
// carrots. The same is done for horizontal card indicators.
if( huds_left(options) ) { // Calculate x marker offset
@ -221,7 +217,7 @@ draw( void ) // (HUD_scale * pscale )
// drawOneLine( marker_xs, mid_scr.y,
// marker_xe, mid_scr.y - scrn_rect.right / 6);
// draw pointer
// draw pointer
if(pointer) {
if(pointer_type=="fixed") {
glBegin(GL_LINE_STRIP);
@ -229,13 +225,12 @@ draw( void ) // (HUD_scale * pscale )
glVertex2f( marker_offset+marker_xs, text_y);
glVertex2f( marker_offset+marker_xe, text_y - scrn_rect.right / 6);
glEnd();
}
else
} else {
if(pointer_type=="moving") {
//Code for Moving Type Pointer to be included.
}
}
}
}
if( huds_right(options) ) { // We'll default this for now.
@ -251,7 +246,7 @@ draw( void ) // (HUD_scale * pscale )
// drawOneLine( scrn_rect.left, mid_scr.y - scrn_rect.right / 6,
// marker_xe, mid_scr.y);
// draw pointer
// draw pointer
if(pointer) {
if(pointer_type=="fixed") {
glBegin(GL_LINE_STRIP);
@ -260,12 +255,13 @@ draw( void ) // (HUD_scale * pscale )
glVertex2f( -marker_offset+scrn_rect.left, text_y - scrn_rect.right / 6);
glEnd();
}
else
else {
if(pointer_type=="moving") {
// Code for Moving Type Pointer to be included.
}
}
}
}
// At this point marker x_start and x_end values are transposed.
// To keep this from confusing things they are now interchanged.
@ -278,13 +274,12 @@ draw( void ) // (HUD_scale * pscale )
// Work through from bottom to top of scale. Calculating where to put
// minor and major ticks.
// draw scale or tape
// draw scale or tape
// last = FloatToInt(vmax)+1;
// i = FloatToInt(vmin);
last = (int)vmax + 1;
i = (int)vmin;
for( ; i <last ; i++ )
{
for( ; i <last ; i++ ) {
condition = true;
if( !modulo()) {
if( i < min_val()) {
@ -300,7 +295,8 @@ draw( void ) // (HUD_scale * pscale )
// Calculation here accounts for text height.
if(( marker_ys < (scrn_rect.top + 4)) |
( marker_ys > (height - 4))) {
( marker_ys > (height - 4)))
{
// Magic numbers!!!
continue;
}
@ -320,13 +316,11 @@ draw( void ) // (HUD_scale * pscale )
// glVertex2f( marker_xe, marker_ys);
// glVertex2f( scrn_rect.left + scrn_rect.right, marker_ys );
// glEnd();
}
else {
} else {
if( huds_left(options) ) {
drawOneLine( marker_xs + 4, marker_ys,
marker_xe, marker_ys );
}
else {
} else {
drawOneLine( marker_xs, marker_ys,
marker_xe - 4, marker_ys );
}
@ -334,9 +328,9 @@ draw( void ) // (HUD_scale * pscale )
}
}
}
if( div_max() ) {
if( !(i%(int)div_max()) )
{
if( !(i%(int)div_max()) ) {
if(modulo()) {
if( disp_val < 0) {
while(disp_val < 0)
@ -369,16 +363,14 @@ draw( void ) // (HUD_scale * pscale )
textString ( marker_xs + 2, marker_ys,
TextScale, GLUT_BITMAP_8_BY_13 );
}
}
else {
} else {
drawOneLine( marker_xs, marker_ys, marker_xe, marker_ys );
if( !huds_notext(options) ) {
if( huds_left(options) ) {
textString( marker_xs - 8 * lenstr - 2,
marker_ys - 4,
TextScale, GLUT_BITMAP_8_BY_13 );
}
else {
} else {
textString( marker_xe + 3 * lenstr,
marker_ys - 4,
TextScale, GLUT_BITMAP_8_BY_13 );
@ -436,7 +428,7 @@ draw( void ) // (HUD_scale * pscale )
// mid_scr.x - scrn_rect.bottom / 4, scrn_rect.top);
// drawOneLine( mid_scr.x, marker_ye,
// mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
// draw pointer
// draw pointer
if(pointer) {
if(pointer_type=="fixed") {
glBegin(GL_LINE_STRIP);
@ -444,14 +436,14 @@ draw( void ) // (HUD_scale * pscale )
glVertex2f( marker_xs, marker_ye);
glVertex2f( marker_xs + scrn_rect.bottom / 4, scrn_rect.top);
glEnd();
}
else
} else {
if(pointer_type=="moving") {
// Code for Moving type Pointer to be included.
}
}
}
}
if( huds_bottom(options) ) {
// Top box line
if (draw_cap_top) {
@ -469,7 +461,7 @@ draw( void ) // (HUD_scale * pscale )
// scrn_rect.top + scrn_rect.bottom,
// mid_scr.x , marker_ys );
// draw pointer
// draw pointer
if(pointer) {
if(pointer_type=="fixed") {
glBegin(GL_LINE_STRIP);
@ -477,14 +469,13 @@ draw( void ) // (HUD_scale * pscale )
glVertex2f( marker_xs, marker_ys );
glVertex2f( marker_xs - scrn_rect.bottom / 4, height);
glEnd();
}
else
} else {
if(pointer_type=="moving") {
// Code for Moving Type Pointer to be included.
}
}
}//if pointer
}
// if(( options & HUDS_BOTTOM) == HUDS_BOTTOM ) {
@ -530,14 +521,12 @@ draw( void ) // (HUD_scale * pscale )
// glVertex2f( marker_xs, marker_ye + 4);
// glVertex2f( marker_xs, scrn_rect.top + scrn_rect.bottom);
// glEnd();
}
else {
} else {
if( huds_top(options)) {
// draw minor ticks
drawOneLine( marker_xs, marker_ys,
marker_xs, marker_ye - 4);
}
else {
} else {
drawOneLine( marker_xs, marker_ys + 4,
marker_xs, marker_ye);
}
@ -582,8 +571,7 @@ draw( void ) // (HUD_scale * pscale )
marker_ys + 4,
TextScale, GLUT_BITMAP_8_BY_13 );
}
}
else {
} else {
drawOneLine( marker_xs, marker_ys,
marker_xs, marker_ye );
if( !huds_notext(options)) {
@ -591,8 +579,7 @@ draw( void ) // (HUD_scale * pscale )
textString ( marker_xs - 4 * lenstr,
height - 10,
TextScale, GLUT_BITMAP_8_BY_13 );
}
else {
} else {
textString( marker_xs - 4 * lenstr,
scrn_rect.top,
TextScale, GLUT_BITMAP_8_BY_13 );

View file

@ -45,12 +45,12 @@ HudLadder :: HudLadder( string name,
factor ( factr ),
hudladder_type ( name ),
frl ( frl_spot ),
target_spot ( target ),
velocity_vector ( vel_vec ),
drift_marker ( drift ),
alpha_bracket ( alpha ),
energy_marker ( energy ),
climb_dive_marker ( climb ),
target_spot ( target ),
glide_slope_marker ( glide ),
glide_slope ( glide_slope_val),
energy_worm ( worm_energy),
@ -79,12 +79,12 @@ HudLadder( const HudLadder & image ) :
factor ( image.factor ),
hudladder_type ( image.hudladder_type),
frl ( image.frl),
target_spot ( image.target_spot),
velocity_vector ( image.velocity_vector),
drift_marker ( image.drift_marker),
alpha_bracket ( image.alpha_bracket),
energy_marker ( image.energy_marker),
climb_dive_marker ( image.climb_dive_marker),
target_spot ( image.target_spot),
glide_slope_marker ( image.glide_slope_marker),
glide_slope ( image.glide_slope),
energy_worm ( image.energy_worm),
@ -127,15 +127,17 @@ void HudLadder :: draw( void )
float x_ini,x_ini2;
float x_end,x_end2;
float y;
float y = 0;
int count;
float cosine, sine,xvvr,yvvr,Vxx,Vyy,Vzz,up_vel,ground_vel,actslope;
float Axx,Ayy,Azz,total_vel,pot_slope,t1,t2,psi,alpha,pla;
float vel_x,vel_y,drift;
char Textaux[8] ;
bool pitch_ladder;
bool climb_dive_ladder;
bool clip_plane;
float cosine, sine, xvvr, yvvr, Vxx = 0.0, Vyy = 0.0, Vzz = 0.0,
up_vel, ground_vel, actslope = 0.0;
float Axx = 0.0, Ayy = 0.0, Azz = 0.0, total_vel = 0.0, pot_slope, t1,
t2 = 0.0, psi = 0.0, alpha,pla;
float vel_x = 0.0, vel_y = 0.0, drift;
// char Textaux[8] ;
bool pitch_ladder = false;
bool climb_dive_ladder = false;
bool clip_plane = false;
GLdouble eqn_top[4] = {0.0,-1.0,0.0,0.0};
GLdouble eqn_left[4] = {-1.0,0.0,0.0,100.0};
@ -473,13 +475,15 @@ void HudLadder :: draw( void )
float bot ;
float top ;
float text_offset = 4.0f ;
float zero_offset;
float zero_offset = 0.0;
if(climb_dive_ladder)
if ( climb_dive_ladder ) {
zero_offset = 50.0f ;
else
if(pitch_ladder)
} else {
if ( pitch_ladder ) {
zero_offset = 10.0f ;
}
}
fntFont *font = HUDtext->getFont();
float pointsize = HUDtext->getPointSize();

View file

@ -482,7 +482,6 @@ double FGSteam::get_HackOBS2_deg () {
double FGSteam::get_HackADF_deg () {
static double last_r = 0;
double r;
if ( current_radiostack->get_adf_inrange() ) {
double r = current_radiostack->get_adf_heading()