- fgSetDouble("/sim/field-of-view", oldfov);
- return b1->getBitmap();
-}
-#endif
-
-
-#if defined( WIN32 ) && !defined( __CYGWIN__)
-// 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();
-}
-
-
-// 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__)
- "Print",
-#endif
- "Snap Shot",
- "---------",
- "Reset",
- "Load flight",
- "Save flight",
- NULL