sprintf( buf, "%d/%d/%4d %d:%02d:%02d",
p->tm_mon+1, p->tm_mday, 1900 + p->tm_year,
p->tm_hour, p->tm_min, p->tm_sec);
sprintf( buf, "%d/%d/%4d %d:%02d:%02d",
p->tm_mon+1, p->tm_mday, 1900 + p->tm_year,
p->tm_hour, p->tm_min, p->tm_sec);
- FG_LOG( FG_COCKPIT, FG_DEBUG,
- "Cockpit: code " << ac_cockpit->code() << " status "
- << ac_cockpit->status() );
+ SG_LOG( SG_COCKPIT, SG_DEBUG,
+ "Cockpit: code " << ac_cockpit->code() << " status "
+ << ac_cockpit->status() );
- int iwidth = globals->get_current_view()->get_winWidth();
- int iheight = globals->get_current_view()->get_winHeight();
- float width = iwidth;
- float height = iheight;
+ static const SGPropertyNode * xsize_node = fgGetNode("/sim/startup/xsize");
+ static const SGPropertyNode * ysize_node = fgGetNode("/sim/startup/ysize");
+ static const SGPropertyNode * hud_visibility_node
+ = fgGetNode("/sim/hud/visibility");
- if ( globals->get_options()->get_hud_status() ) {
+ int iwidth = xsize_node->getIntValue();
+ int iheight = ysize_node->getIntValue();
+ float width = iwidth;
+ // float height = iheight;
+
+ // FIXME: inefficient
+ if ( hud_visibility_node->getBoolValue() ) {
- float fps = get_frame_rate();
-// float tris = fps * get_vfc_tris_drawn();
-// float culled = fps * get_vfc_tris_culled();
-// sprintf(buf,"%-4.1f %7.0f %7.0f", fps, tris, culled);
+ float fps = get_frame_rate();
- gluOrtho2D(0, width, 0, height);
- glMatrixMode(GL_MODELVIEW);
+ gluOrtho2D( 0, iwidth, 0, iheight );
+ glMatrixMode( GL_MODELVIEW );
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LIGHTING);
- glMatrixMode(GL_PROJECTION);
+ glEnable( GL_DEPTH_TEST );
+ glEnable( GL_LIGHTING );
+ glMatrixMode( GL_PROJECTION );
- xglViewport( 0, 0, iwidth, iheight );
-
- if (current_panel != 0)
- current_panel->update();
+ glViewport( 0, 0, iwidth, iheight );