#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/polar3d.hxx>
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_options()->get_xsize();
- int iheight = globals->get_options()->get_ysize();
- 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();
sprintf(buf,"%-5.1f", fps);
glMatrixMode( GL_PROJECTION );
glPushMatrix();
glLoadIdentity();
sprintf(buf,"%-5.1f", fps);
glMatrixMode( GL_PROJECTION );
glPushMatrix();
glLoadIdentity();
- gluOrtho2D( 0, globals->get_options()->get_xsize(),
- 0, globals->get_options()->get_ysize() );
+ gluOrtho2D( 0, iwidth, 0, iheight );
- glViewport( 0, 0,
- globals->get_options()->get_xsize(),
- globals->get_options()->get_ysize() );
-
- if (current_panel != 0)
- current_panel->update();
+ glViewport( 0, 0, iwidth, iheight );