Optimized property node accesses.
This commit is contained in:
parent
083ba99657
commit
64254d7410
1 changed files with 246 additions and 259 deletions
|
@ -442,106 +442,89 @@ readLabel(const SGPropertyNode * node)
|
|||
SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name);
|
||||
|
||||
|
||||
if(justi==0)
|
||||
if ( justi == 0 ) {
|
||||
justification = LEFT_JUST;
|
||||
else
|
||||
if(justi==1)
|
||||
} else {
|
||||
if ( justi == 1 ) {
|
||||
justification = CENTER_JUST;
|
||||
else
|
||||
if(justi==2)
|
||||
} else {
|
||||
if ( justi == 2 ) {
|
||||
justification = RIGHT_JUST;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(prelabel=="NULL")
|
||||
if ( prelabel == "NULL" ) {
|
||||
pre_label_string = NULL;
|
||||
else
|
||||
if(prelabel=="blank")
|
||||
} else {
|
||||
if ( prelabel == "blank" ) {
|
||||
pre_label_string = " ";
|
||||
else
|
||||
} else {
|
||||
pre_label_string = prelabel.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(postlabel=="blank")
|
||||
if ( postlabel == "blank" ) {
|
||||
post_label_string = " ";
|
||||
else
|
||||
if(postlabel=="NULL")
|
||||
} else {
|
||||
if ( postlabel == "NULL" ) {
|
||||
post_label_string = NULL;
|
||||
else
|
||||
if(postlabel=="units")
|
||||
} else {
|
||||
if ( postlabel == "units" ) {
|
||||
post_label_string = units;
|
||||
else
|
||||
} else {
|
||||
post_label_string = postlabel.c_str();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(loadfn=="aux16")
|
||||
if ( loadfn == "aux16" ) {
|
||||
load_fn = get_aux16;
|
||||
else
|
||||
if(loadfn=="aux17")
|
||||
} else if ( loadfn == "aux17" ) {
|
||||
load_fn = get_aux17;
|
||||
else
|
||||
if(loadfn=="aux9")
|
||||
} else if ( loadfn == "aux9" ) {
|
||||
load_fn = get_aux9;
|
||||
else
|
||||
if(loadfn=="aux11")
|
||||
} else if ( loadfn == "aux11" ) {
|
||||
load_fn = get_aux11;
|
||||
else
|
||||
if(loadfn=="aux12")
|
||||
} else if ( loadfn == "aux12" ) {
|
||||
load_fn = get_aux12;
|
||||
else
|
||||
if(loadfn=="aux10")
|
||||
} else if ( loadfn == "aux10" ) {
|
||||
load_fn = get_aux10;
|
||||
else
|
||||
if(loadfn=="aux13")
|
||||
} else if ( loadfn == "aux13" ) {
|
||||
load_fn = get_aux13;
|
||||
else
|
||||
if(loadfn=="aux14")
|
||||
} else if ( loadfn == "aux14" ) {
|
||||
load_fn = get_aux14;
|
||||
else
|
||||
if(loadfn=="aux15")
|
||||
} else if ( loadfn == "aux15" ) {
|
||||
load_fn = get_aux15;
|
||||
else
|
||||
if(loadfn=="aux8")
|
||||
} else if ( loadfn == "aux8" ) {
|
||||
load_fn = get_aux8;
|
||||
else
|
||||
if(loadfn=="ax")
|
||||
} else if ( loadfn == "ax" ) {
|
||||
load_fn = get_Ax;
|
||||
else
|
||||
if(loadfn=="speed")
|
||||
} else if ( loadfn == "speed" ) {
|
||||
load_fn = get_speed;
|
||||
else
|
||||
if(loadfn=="mach")
|
||||
} else if ( loadfn == "mach" ) {
|
||||
load_fn = get_mach;
|
||||
else
|
||||
if(loadfn=="altitude")
|
||||
} else if ( loadfn == "altitude" ) {
|
||||
load_fn = get_altitude;
|
||||
else
|
||||
if(loadfn=="agl")
|
||||
} else if ( loadfn == "agl" ) {
|
||||
load_fn = get_agl;
|
||||
else
|
||||
if(loadfn=="framerate")
|
||||
} else if ( loadfn == "framerate" ) {
|
||||
load_fn = get_frame_rate;
|
||||
else
|
||||
if(loadfn=="heading")
|
||||
} else if ( loadfn == "heading" ) {
|
||||
load_fn = get_heading;
|
||||
else
|
||||
if(loadfn=="fov")
|
||||
} else if ( loadfn == "fov" ) {
|
||||
load_fn = get_fov;
|
||||
else
|
||||
if(loadfn=="vfc_tris_culled")
|
||||
} else if ( loadfn == "vfc_tris_culled" ) {
|
||||
load_fn = get_vfc_tris_culled;
|
||||
else
|
||||
if(loadfn=="vfc_tris_drawn")
|
||||
} else if ( loadfn == "vfc_tris_drawn" ) {
|
||||
load_fn = get_vfc_tris_drawn;
|
||||
else
|
||||
if(loadfn=="aoa")
|
||||
} else if ( loadfn == "aoa" ) {
|
||||
load_fn = get_aoa;
|
||||
else
|
||||
if(loadfn=="latitude")
|
||||
} else if ( loadfn == "latitude" ) {
|
||||
load_fn = get_latitude;
|
||||
else
|
||||
if(loadfn=="longitude")
|
||||
} else if ( loadfn == "longitude" ) {
|
||||
load_fn = get_longitude;
|
||||
|
||||
}
|
||||
|
||||
p = (instr_item *) new instr_label ( x,
|
||||
y,
|
||||
|
@ -561,7 +544,6 @@ readLabel(const SGPropertyNode * node)
|
|||
working);
|
||||
|
||||
return p;
|
||||
|
||||
} // end readLabel
|
||||
|
||||
static instr_item *
|
||||
|
@ -656,6 +638,7 @@ int readInstrument(const SGPropertyNode * node)
|
|||
return 0;
|
||||
}//end readinstrument
|
||||
|
||||
|
||||
int readHud( istream &input )
|
||||
{
|
||||
|
||||
|
@ -700,6 +683,7 @@ int readHud( istream &input )
|
|||
|
||||
}//if
|
||||
}//for loop(i)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1010,7 +994,10 @@ void fgUpdateHUD( void ) {
|
|||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
if( fgGetBool("/sim/hud/antialiased") ) {
|
||||
static const SGPropertyNode * antialiased_node
|
||||
= fgGetNode("/sim/hud/antialiased");
|
||||
|
||||
if( antialiased_node->getBoolValue() ) {
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
// glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
@ -1104,9 +1091,9 @@ void fgUpdateHUD( void ) {
|
|||
// extern char *fgAPget_TargetLatLonStr( void );
|
||||
|
||||
int apY = 480 - 80;
|
||||
// char scratch[128];
|
||||
// HUD_TextList.add( fgText( "AUTOPILOT", 20, apY) );
|
||||
// apY -= 15;
|
||||
// char scratch[128];
|
||||
// HUD_TextList.add( fgText( "AUTOPILOT", 20, apY) );
|
||||
// apY -= 15;
|
||||
if( current_autopilot->get_HeadingEnabled() ) {
|
||||
HUD_TextList.add( fgText( 40, apY,
|
||||
current_autopilot->get_TargetHeadingStr()) );
|
||||
|
@ -1142,13 +1129,13 @@ void fgUpdateHUD( void ) {
|
|||
|
||||
HUD_LineList.draw();
|
||||
|
||||
// glEnable(GL_LINE_STIPPLE);
|
||||
// glLineStipple( 1, 0x00FF );
|
||||
// HUD_StippleLineList.draw();
|
||||
// glDisable(GL_LINE_STIPPLE);
|
||||
// glEnable(GL_LINE_STIPPLE);
|
||||
// glLineStipple( 1, 0x00FF );
|
||||
// HUD_StippleLineList.draw();
|
||||
// glDisable(GL_LINE_STIPPLE);
|
||||
|
||||
if( fgGetBool("/sim/hud/antialiased") ) {
|
||||
// glDisable(GL_BLEND);
|
||||
if( antialiased_node->getBoolValue() ) {
|
||||
// glDisable(GL_BLEND);
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
glLineWidth(1.0);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue