-
- if(!freeze)
- globals->set_freeze( false );
-}
-#endif // #if defined( TR_HIRES_SNAP)
-
-
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
-
-static void rotateView( double roll, double pitch, double yaw )
-{
- // rotate view
-}
-
-static GlBitmap *b1 = NULL;
-extern FGInterface cur_view_fdm;
-GLubyte *hiResScreenCapture( int multiplier )
-{
- float oldfov = fgGetDouble("/sim/field-of-view");
- float fov = oldfov / multiplier;
- FGViewer *v = globals->get_current_view();
- fgSetDouble("/sim/field-of-view", fov);
- fgInitVisuals();
- int cur_width = fgGetInt("/sim/startup/xsize");
- int cur_height = fgGetInt("/sim/startup/ysize");
- if (b1) delete( b1 );
- // New empty (mostly) bitmap
- b1 = new GlBitmap( GL_RGB, 1, 1, (unsigned char *)"123" );
- int x,y;
- for ( y = 0; y < multiplier; y++ ) {
- for ( x = 0; x < multiplier; x++ ) {
- fgReshape( cur_width, cur_height );
- // pan to tile
- rotateView( 0, (y*fov)-((multiplier-1)*fov/2), (x*fov)-((multiplier-1)*fov/2) );
- fgRenderFrame();
- // restore view
- GlBitmap b2;
- b1->copyBitmap( &b2, cur_width*x, cur_height*y );
- }
- }
- fgSetDouble("/sim/field-of-view", oldfov);
- return b1->getBitmap();
-}
-#endif
-
-
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
-// win32 print screen function
-void printScreen ( puObject *obj ) {
- bool show_pu_cursor = false;
- TurnCursorOff();
- if ( !puCursorIsHidden() ) {
- show_pu_cursor = true;
- puHideCursor();
- }
- BusyCursor( 0 );
- mainMenuBar->hide();
-
- CGlPrinter p( CGlPrinter::PRINT_BITMAP );
- int cur_width = fgGetInt("/sim/startup/xsize");
- int cur_height = fgGetInt("/sim/startup/ysize");
- p.Begin( "FlightGear", cur_width*3, cur_height*3 );
- p.End( hiResScreenCapture(3) );
-
- if( gui_menu_on ) {
- mainMenuBar->reveal();
- }
- BusyCursor(1);
- if ( show_pu_cursor ) {
- puShowCursor();
- }
- TurnCursorOn();
-}
-#endif // #ifdef WIN32
-
-
-void dumpSnapShot ( puObject *obj ) {
- fgDumpSnapShot();
-}
-
-
-void dumpHiResSnapShot ( puObject *obj ) {
- fgHiResDump();
-}
-
-
-// do a screen snap shot
-void fgDumpSnapShot () {
- bool show_pu_cursor = false;
- char *filename = new char [24];
- string message;
- static int count = 1;
-
- int freeze = globals->get_freeze();
- if(!freeze)
- globals->set_freeze( true );
-
- mainMenuBar->hide();
- TurnCursorOff();
- if ( !puCursorIsHidden() ) {
- show_pu_cursor = true;
- puHideCursor();
- }
-
- fgInitVisuals();
- fgReshape( fgGetInt("/sim/startup/xsize"),
- fgGetInt("/sim/startup/ysize") );
-
- // we need two render frames here to clear the menu and cursor
- // ... not sure why but doing an extra fgRenderFrame() shouldn't
- // hurt anything
- fgRenderFrame();
- fgRenderFrame();
-
- while (count < 1000) {
- FILE *fp;
- snprintf(filename, 24, "fgfs-screen-%03d.ppm", count++);
- if ( (fp = fopen(filename, "r")) == NULL )
- break;
- fclose(fp);
- }
-
- if ( sg_glDumpWindow( filename,
- fgGetInt("/sim/startup/xsize"),
- fgGetInt("/sim/startup/ysize")) ) {
- message = "Snap shot saved to ";
- message += filename;
- } else {
- message = "Failed to save to ";
- message += filename;
- }
-
- mkDialog (message.c_str());
-
- delete [] filename;
-
- if ( show_pu_cursor ) {
- puShowCursor();
- }
-
- TurnCursorOn();
- if( gui_menu_on ) {
- mainMenuBar->reveal();
- }
-
- if(!freeze)
- globals->set_freeze( false );
-}
-
-#ifdef FG_NETWORK_OLK
-static void net_display_toggle( puObject *cb)
-{
- net_hud_display = (net_hud_display) ? 0 : 1;
- printf("Toggle net_hud_display : %d\n", net_hud_display);
-}
-
-static void net_register( puObject *cb)
-{
- fgd_send_com( "1", FGFS_host );
- net_is_registered = 0;
- printf("Registering to deamon\n");
-}
-
-static void net_unregister( puObject *cb)
-{
- fgd_send_com( "8", FGFS_host );
- net_is_registered = -1;
- printf("Unregistering from deamon\n");
-}
-
-extern void net_fgd_scan(puObject *cb);
-#endif // #ifdef FG_NETWORK_OLK
-
-/* -----------------------------------------------------------------------
-The menu stuff
----------------------------------------------------------------------*/
-char *fileSubmenu [] = {
- "Exit", /* "Close", "---------", */
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
- "Print",
-#endif
- "Snap Shot",
- "Hires Snap Shot",
- "---------",
- "Reset",
- "Load flight",
- "Save flight",
- NULL
-};
-puCallback fileSubmenuCb [] = {
- MayBeGoodBye, /* hideMenuCb, NULL, */
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
- printScreen,
-#endif
- /* NULL, notCb, */
- dumpSnapShot,
- dumpHiResSnapShot,
- NULL,
- reInit,
- loadFlight,
- saveFlight,
- NULL
-};
-
-/*
-char *editSubmenu [] = {
- "Edit text", NULL
-};
-puCallback editSubmenuCb [] = {
- notCb, NULL
-};
-*/
-
-extern void fgHUDalphaAdjust( puObject * );
-char *viewSubmenu [] = {
- "HUD Alpha",
- "Pilot Offset",
- /* "Cockpit View > ", "View >","------------", */
- "Toggle Panel...", NULL
-};
-puCallback viewSubmenuCb [] = {
- fgHUDalphaAdjust,
- PilotOffsetAdjust,
- /* notCb, notCb, NULL, */
- guiTogglePanel, NULL
-};
-
-// "---------",
-
-char *autopilotSubmenu [] = {
- "Toggle HUD Format", "Adjust AP Settings",
- "---------",
- "Clear Route", "Skip Current Waypoint", "Add Waypoint",
- "---------",
- "Set Altitude", "Set Heading",
- NULL
-};
-
-puCallback autopilotSubmenuCb [] = {
- fgLatLonFormatToggle, fgAPAdjust,
- NULL,
- ClearRoute, PopWayPoint, AddWayPoint,
- NULL,
- NewAltitude, NewHeading,
- /* notCb, */ NULL
-};
-
-char *environmentSubmenu [] = {
- "Goto Airport", /* "Terrain", "Weather", */ NULL
-};
-puCallback environmentSubmenuCb [] = {
- NewAirport, /* notCb, notCb, */ NULL
-};
-
-/*
-char *optionsSubmenu [] = {
- "Preferences", "Realism & Reliablity...", NULL
-};
-puCallback optionsSubmenuCb [] = {
- notCb, notCb, NULL
-};
-*/
-
-#ifdef FG_NETWORK_OLK
-char *networkSubmenu [] = {
- "Unregister from FGD ", /* "Send MSG to All", "Send MSG", "Show Pilots", */
- "Register to FGD",
- "Scan for Deamons", "Enter Callsign", /* "Display Netinfos", */
- "Toggle Display", NULL
-};
-puCallback networkSubmenuCb [] = {
- /* notCb, notCb, notCb, notCb, */
- net_unregister,
- net_register,
- net_fgd_scan, NewCallSign,
- net_display_toggle, NULL
-};
-#endif
-
-char *helpSubmenu [] = {
- /* "About...", */ "Help", NULL
-};
-puCallback helpSubmenuCb [] = {
- /* notCb, */ helpCb, NULL