#include <FDM/flight.hxx>
#include <Main/bfi.hxx>
#include <Main/fg_init.hxx>
+#include <Main/fg_io.hxx>
#include <Main/globals.hxx>
#include <Main/options.hxx>
-#include <Main/views.hxx>
#include <Main/save.hxx>
#ifdef FG_NETWORK_OLK
#include <NetworkOLK/network.h>
}
#endif
#if defined(X_CURSOR_TWEAKS)
- glutWarpPointer( current_view.get_winWidth()/2, current_view.get_winHeight()/2);
+ glutWarpPointer( globals->get_current_view()->get_winWidth()/2,
+ globals->get_current_view()->get_winHeight()/2);
#endif
}
#if defined(WIN32_CURSOR_TWEAKS)
glutSetCursor(GLUT_CURSOR_NONE);
#elif defined(X_CURSOR_TWEAKS)
- glutWarpPointer( current_view.get_winWidth(), current_view.get_winHeight());
+ glutWarpPointer( globals->get_current_view()->get_winWidth(),
+ globals->get_current_view()->get_winHeight());
#endif
}
// reset left click MOUSE_VIEW toggle feature
_mVtoggle = 0;
- ww = current_view.get_winWidth();
- wh = current_view.get_winHeight();
+ ww = globals->get_current_view()->get_winWidth();
+ wh = globals->get_current_view()->get_winHeight();
switch (mouse_mode) {
case MOUSE_YOKE:
// do horizontal pan
// this could be done in above quat
// but requires redoing view pipeline
- offset = current_view.get_goal_view_offset();
+ offset = globals->get_current_view()->get_goal_view_offset();
offset += ((_mX - x) * FG_2PI / W );
while (offset < 0.0) {
offset += FG_2PI;
while (offset > FG_2PI) {
offset -= FG_2PI;
}
- current_view.set_goal_view_offset(offset);
+ globals->get_current_view()->set_goal_view_offset(offset);
#ifdef NO_SMOOTH_MOUSE_VIEW
- current_view.set_view_offset(offset);
+ globals->get_current_view()->set_view_offset(offset);
#endif
break;
curquat[1] = _quat[1];
curquat[2] = _quat[2];
curquat[3] = _quat[3];
- current_view.set_goal_view_offset(_view_offset);
+ globals->get_current_view()->set_goal_view_offset(_view_offset);
#ifdef NO_SMOOTH_MOUSE_VIEW
- current_view.set_view_offset(_view_offset);
+ globals->get_current_view()->set_view_offset(_view_offset);
#endif
} else {
// center view
_quat[1] = curquat[1];
_quat[2] = curquat[2];
_quat[3] = curquat[3];
- x = current_view.get_winWidth()/2;
- y = current_view.get_winHeight()/2;
+ x = globals->get_current_view()->get_winWidth()/2;
+ y = globals->get_current_view()->get_winHeight()/2;
Quat0();
- _view_offset = current_view.get_goal_view_offset();
- current_view.set_goal_view_offset(0.0);
+ _view_offset = globals->get_current_view()->get_goal_view_offset();
+ globals->get_current_view()->set_goal_view_offset(0.0);
#ifdef NO_SMOOTH_MOUSE_VIEW
- current_view.set_view_offset(0.0);
+ globals->get_current_view()->set_view_offset(0.0);
#endif
}
glutWarpPointer( x , y);
_savedX = x;
_savedY = y;
// start with zero point in center of screen
- _mX = current_view.get_winWidth()/2;
- _mY = current_view.get_winHeight()/2;
+ _mX = globals->get_current_view()->get_winWidth()/2;
+ _mY = globals->get_current_view()->get_winHeight()/2;
// try to have the MOUSE_YOKE position
// reflect the current stick position
case MOUSE_YOKE:
mouse_mode = MOUSE_VIEW;
current_options.set_control_mode( fgOPTIONS::FG_JOYSTICK );
- x = current_view.get_winWidth()/2;
- y = current_view.get_winHeight()/2;
+ x = globals->get_current_view()->get_winWidth()/2;
+ y = globals->get_current_view()->get_winHeight()/2;
_mVtoggle = 0;
Quat0();
build_rotmatrix(quat_mat, curquat);
#ifdef RESET_VIEW_ON_LEAVING_MOUSE_VIEW
Quat0();
build_rotmatrix(quat_mat, curquat);
- current_view.set_goal_view_offset(0.0);
+ globals->get_current_view()->set_goal_view_offset(0.0);
#ifdef NO_SMOOTH_MOUSE_VIEW
- current_view.set_view_offset(0.0);
+ globals->get_current_view()->set_view_offset(0.0);
#endif
#endif // RESET_VIEW_ON_LEAVING_MOUSE_VIEW
glutSetCursor(GLUT_CURSOR_INHERIT);
FG_PUSH_PUI_DIALOG( dialogBox );
}
-// Repair any damage done to the Panel by other Gui Items
-void guiFixPanel( void )
-{
-#if 0 // this function does nothing anyway
- bool freeze = globals->get_freeze();
-
- if ( current_options.get_panel_status() ) {
- // FGView *v = ¤t_view;
- if( !freeze )
- globals->set_freeze( true );
-
- // we must have some something here at some point but this
- // function does nothing now.
-
- if( !freeze )
- globals->set_freeze( false );
- }
-#endif
-}
-
// Toggle the Menu and Mouse display state
void guiToggleMenu(void)
{
}
#endif
- // if(gps_bug)
- // fclose(gps_bug);
+ // close all external I/O connections
+ fgIOShutdownAll();
- exit(-1);
+ exit(0);
}
{
float oldfov = current_options.get_fov();
float fov = oldfov / multiplier;
- FGView *v = ¤t_view;
+ FGViewer *v = globals->get_current_view();
current_options.set_fov(fov);
v->force_update_fov_math();
fgInitVisuals();
- int cur_width = current_view.get_winWidth( );
- int cur_height = current_view.get_winHeight( );
+ int cur_width = globals->get_current_view()->get_winWidth( );
+ int cur_height = globals->get_current_view()->get_winHeight( );
if (b1) delete( b1 );
// New empty (mostly) bitmap
b1 = new GlBitmap( GL_RGB, 1, 1, (unsigned char *)"123" );
b1->copyBitmap( &b2, cur_width*x, cur_height*y );
}
}
- current_view.UpdateViewParams(cur_view_fdm);
+ globals->get_current_view()->UpdateViewParams(cur_view_fdm);
current_options.set_fov(oldfov);
v->force_update_fov_math();
return b1->getBitmap();
mainMenuBar->hide();
CGlPrinter p( CGlPrinter::PRINT_BITMAP );
- int cur_width = current_view.get_winWidth( );
- int cur_height = current_view.get_winHeight( );
+ int cur_width = globals->get_current_view()->get_winWidth( );
+ int cur_height = globals->get_current_view()->get_winHeight( );
p.Begin( "FlightGear", cur_width*3, cur_height*3 );
p.End( hiResScreenCapture(3) );
}
fgInitVisuals();
- fgReshape( current_view.get_winWidth(), current_view.get_winHeight() );
+ fgReshape( globals->get_current_view()->get_winWidth(),
+ globals->get_current_view()->get_winHeight() );
// we need two render frames here to clear the menu and cursor
// ... not sure why but doing an extra fgFenderFrame() shoulnd't
if ( airports.search( AptId, &a ) )
{
current_options.set_airport_id( AptId.c_str() );
+ current_options.set_altitude( -9999.0 );
+ // fgSetPosFromAirportID( AptId );
+ fgSetPosFromAirportIDandHdg( AptId,
+ cur_fdm_state->get_Psi() * RAD_TO_DEG);
BusyCursor(0);
fgReInitSubsystems();
BusyCursor(1);
guiTogglePanel, NULL
};
-char *aircraftSubmenu [] = {
- "Autopilot", "Heading", "Altitude", "Navigation", "Airport",
- /* "Communication", */ NULL
+// "---------",
+
+char *autopilotSubmenu [] = {
+ "Toggle HUD Format", "Adjust AP Settings",
+ "---------",
+ "Clear Route", "Skip Current Waypoint", "Add Waypoint",
+ "---------",
+ "Set Altitude", "Set Heading",
+ NULL
};
-puCallback aircraftSubmenuCb [] = {
- fgAPAdjust, NewHeading, NewAltitude, fgLatLonFormatToggle, NewTgtAirport,
+
+puCallback autopilotSubmenuCb [] = {
+ fgLatLonFormatToggle, fgAPAdjust,
+ NULL,
+ ClearRoute, PopWayPoint, AddWayPoint,
+ NULL,
+ NewAltitude, NewHeading,
/* notCb, */ NULL
};
mainMenuBar -> add_submenu ("File", fileSubmenu, fileSubmenuCb);
// mainMenuBar -> add_submenu ("Edit", editSubmenu, editSubmenuCb);
mainMenuBar -> add_submenu ("View", viewSubmenu, viewSubmenuCb);
- mainMenuBar -> add_submenu ("Aircraft", aircraftSubmenu, aircraftSubmenuCb);
mainMenuBar -> add_submenu ("Environment", environmentSubmenu, environmentSubmenuCb);
+ mainMenuBar -> add_submenu ("Autopilot", autopilotSubmenu, autopilotSubmenuCb);
// mainMenuBar -> add_submenu ("Options", optionsSubmenu, optionsSubmenuCb);
#ifdef FG_NETWORK_OLK
- mainMenuBar -> add_submenu ("Network", networkSubmenu, networkSubmenuCb);
+ if ( current_options.get_network_olk() ) {
+ mainMenuBar -> add_submenu ("Network", networkSubmenu, networkSubmenuCb);
+ }
#endif
mainMenuBar -> add_submenu ("Help", helpSubmenu, helpSubmenuCb);
mainMenuBar-> close ();