1 /**************************************************************************
4 * Based on gui.cxx and renamed on 2002/08/13 by Erik Hofman.
6 * Written 1998 by Durk Talsma, started Juni, 1998. For the flight gear
9 * Additional mouse supported added by David Megginson, 1999.
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 **************************************************************************/
33 #include <simgear/compiler.h>
35 #ifdef SG_MATH_EXCEPTION_CLASH
45 #if defined(FX) && defined(XMESA)
46 # include <GL/xmesa.h>
57 # include <shellapi.h>
59 # include <sys/cygwin.h>
63 #include <simgear/constants.h>
64 #include <simgear/debug/logstream.hxx>
65 #include <simgear/misc/sg_path.hxx>
66 #include <simgear/screen/screen-dump.hxx>
68 #include <Include/general.hxx>
69 #include <Aircraft/aircraft.hxx>
70 #include <Airports/simple.hxx>
71 #include <Autopilot/auto_gui.hxx>
72 #include <Cockpit/panel.hxx>
73 #include <Controls/controls.hxx>
74 #include <FDM/flight.hxx>
75 #include <Main/main.hxx>
76 #include <Main/fg_init.hxx>
77 #include <Main/fg_io.hxx>
78 #include <Main/globals.hxx>
79 #include <Main/fg_props.hxx>
80 #include <Main/viewmgr.hxx>
82 #if defined( WIN32 ) && !defined( __CYGWIN__ ) && !defined(__MINGW32__)
83 # include <simgear/screen/win32-printer.h>
84 # include <simgear/screen/GlBitmaps.h>
88 #include "gui_local.hxx"
89 #include "preset_dlg.hxx"
90 #include "prop_picker.hxx"
91 #include "sgVec3Slider.hxx"
96 extern void fgHUDalphaAdjust( puObject * );
99 extern void fgLatLonFormatToggle( puObject *);
101 #if defined( TR_HIRES_SNAP)
102 #include <simgear/screen/tr.h>
103 extern void trRenderFrame( void );
104 extern void fgUpdateHUD( GLfloat x_start, GLfloat y_start,
105 GLfloat x_end, GLfloat y_end );
108 puDialogBox *dialogBox = 0;
109 puFrame *dialogFrame = 0;
110 puText *dialogBoxMessage = 0;
111 puOneShot *dialogBoxOkButton = 0;
113 puDialogBox *YNdialogBox = 0;
114 puFrame *YNdialogFrame = 0;
115 puText *YNdialogBoxMessage = 0;
116 puOneShot *YNdialogBoxOkButton = 0;
117 puOneShot *YNdialogBoxNoButton = 0;
119 char *gui_msg_OK; // "OK"
120 char *gui_msg_NO; // "NO"
121 char *gui_msg_YES; // "YES"
122 char *gui_msg_CANCEL; // "CANCEL"
123 char *gui_msg_RESET; // "RESET"
125 char msg_OK[] = "OK";
126 char msg_NO[] = "NO";
127 char msg_YES[] = "YES";
128 char msg_CANCEL[] = "Cancel";
129 char msg_RESET[] = "Reset";
131 char global_dialog_string[256];
133 const __fg_gui_fn_t __fg_gui_fn[] = {
136 {"saveFlight", saveFlight},
137 {"loadFlight", loadFlight},
140 {"dumpHiResSnapShot", dumpHiResSnapShot},
142 {"dumpSnapShot", dumpSnapShot},
143 #if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
144 {"printScreen", printScreen},
146 {"MayBeGoodBye", MayBeGoodBye},
149 {"guiTogglePanel", guiTogglePanel},
150 {"PilotOffsetAdjust", PilotOffsetAdjust},
151 {"fgHUDalphaAdjust", fgHUDalphaAdjust},
152 {"prop_pickerView", prop_pickerView},
155 {"fgPresetAirport", fgPresetAirport},
156 {"fgPresetRunway", fgPresetRunway},
157 {"fgPresetOffsetDistance", fgPresetOffsetDistance},
158 {"fgPresetAltitude", fgPresetAltitude},
159 {"fgPresetGlideslope", fgPresetGlideslope},
160 {"fgPresetAirspeed", fgPresetAirspeed},
161 {"fgPresetCommit", fgPresetCommit},
164 {"NewAltitude", NewAltitude},
165 {"NewHeading", NewHeading},
166 {"AddWayPoint", AddWayPoint},
167 {"PopWayPoint", PopWayPoint},
168 {"ClearRoute", ClearRoute},
169 {"fgLatLonFormatToggle", fgLatLonFormatToggle},
174 // Structure termination
179 /* ================ General Purpose Functions ================ */
181 void initDialog(void) {
182 // Initialize our GLOBAL GUI STRINGS
183 gui_msg_OK = msg_OK; // "OK"
184 gui_msg_NO = msg_NO; // "NO"
185 gui_msg_YES = msg_YES; // "YES"
186 gui_msg_CANCEL = msg_CANCEL; // "CANCEL"
187 gui_msg_RESET = msg_RESET; // "RESET"
190 // General Purpose Message Box
191 void mkDialog (const char *txt)
193 strncpy(global_dialog_string, txt, 256);
194 dialogBoxMessage->setLabel(global_dialog_string);
195 FG_PUSH_PUI_DIALOG( dialogBox );
198 // Message Box to report an error.
199 void guiErrorMessage (const char *txt)
201 SG_LOG(SG_GENERAL, SG_ALERT, txt);
206 // Message Box to report a throwable (usually an exception).
207 void guiErrorMessage (const char *txt, const sg_throwable &throwable)
211 msg += throwable.getFormattedMessage();
212 if (!throwable.getOrigin().empty()) {
213 msg += "\n (reported by ";
214 msg += throwable.getOrigin();
217 SG_LOG(SG_GENERAL, SG_ALERT, msg);
219 mkDialog(msg.c_str());
222 // Intercept the Escape Key
223 void ConfirmExitDialog(void)
225 FG_PUSH_PUI_DIALOG( YNdialogBox );
230 /* -----------------------------------------------------------------------
231 the Gui callback functions
232 ____________________________________________________________________*/
235 // Hier Neu :-) This is my newly added code
236 // Added by David Findlay <nedz@bigpond.com>
237 // on Sunday 3rd of December
239 // Start new Save Dialog Box
240 puDialogBox *SaveDialog = 0;
241 puFrame *SaveDialogFrame = 0;
242 puText *SaveDialogMessage = 0;
243 puInput *SaveDialogInput = 0;
245 puOneShot *SaveDialogOkButton = 0;
246 puOneShot *SaveDialogCancelButton = 0;
247 // static puOneShot *SaveDialogResetButton = 0;
249 // Default save filename
250 char saveFile[256] = "fgfs.sav";
253 void SaveDialogCancel(puObject *) {
254 FG_POP_PUI_DIALOG( SaveDialog );
257 // If press OK do this
258 void SaveDialogOk(puObject*) {
260 FG_POP_PUI_DIALOG( SaveDialog );
263 SaveDialogInput->getValue(&s);
266 // cout << saveFile << endl;
267 if (output.good() && fgSaveFlight(output)) {
269 mkDialog("Saved flight");
270 SG_LOG(SG_INPUT, SG_INFO, "Saved flight");
272 mkDialog("Cannot save flight");
273 SG_LOG(SG_INPUT, SG_ALERT, "Cannot save flight");
278 void saveFlight(puObject *cv) {
279 SaveDialog = new puDialogBox (150, 50);
281 SaveDialogFrame = new puFrame (0,0,350, 150);
283 = new puText( (150 - puGetDefaultLabelFont().getStringWidth( "File Name:" ) / 2), 110 );
284 SaveDialogMessage -> setLabel ("File Name:");
286 SaveDialogInput = new puInput (50, 70, 300, 100);
287 SaveDialogInput -> setValue (saveFile);
288 SaveDialogInput -> acceptInput();
290 SaveDialogOkButton = new puOneShot (50, 10, 110, 50);
291 SaveDialogOkButton -> setLegend (gui_msg_OK);
292 SaveDialogOkButton -> setCallback ( SaveDialogOk );
293 SaveDialogOkButton -> makeReturnDefault(TRUE);
295 SaveDialogCancelButton = new puOneShot (140, 10, 210, 50);
296 SaveDialogCancelButton -> setLegend (gui_msg_CANCEL);
297 SaveDialogCancelButton -> setCallback ( SaveDialogCancel );
299 FG_FINALIZE_PUI_DIALOG( SaveDialog );
301 SaveDialog -> reveal();
305 puDialogBox *LoadDialog = 0;
306 puFrame *LoadDialogFrame = 0;
307 puText *LoadDialogMessage = 0;
308 puInput *LoadDialogInput = 0;
310 puOneShot *LoadDialogOkButton = 0;
311 puOneShot *LoadDialogCancelButton = 0;
312 // static puOneShot *LoadDialogResetButton = 0;
314 // Default load filename
315 char loadFile[256] = "fgfs.sav";
317 // Do this if the person click okay
318 void LoadDialogOk(puObject *) {
320 FG_POP_PUI_DIALOG( LoadDialog );
323 LoadDialogInput->getValue(&l);
326 if (input.good() && fgLoadFlight(input)) {
328 mkDialog("Loaded flight");
329 SG_LOG(SG_INPUT, SG_INFO, "Restored flight");
331 mkDialog("Failed to load flight");
332 SG_LOG(SG_INPUT, SG_ALERT, "Cannot load flight");
336 // Do this if the person presses cancel
337 void LoadDialogCancel(puObject *) {
338 FG_POP_PUI_DIALOG( LoadDialog );
341 // Create Load Dialog
342 void loadFlight(puObject *cb)
344 LoadDialog = new puDialogBox (150, 50);
346 LoadDialogFrame = new puFrame (0,0,350, 150);
348 = new puText( (150 - puGetDefaultLabelFont().getStringWidth( "File Name:" ) / 2), 110 );
349 LoadDialogMessage -> setLabel ("File Name:");
351 LoadDialogInput = new puInput (50, 70, 300, 100);
352 LoadDialogInput -> setValue (loadFile);
353 LoadDialogInput -> acceptInput();
355 LoadDialogOkButton = new puOneShot (50, 10, 110, 50);
356 LoadDialogOkButton -> setLegend (gui_msg_OK);
357 LoadDialogOkButton -> setCallback ( LoadDialogOk );
358 LoadDialogOkButton -> makeReturnDefault(TRUE);
360 LoadDialogCancelButton = new puOneShot (140, 10, 210, 50);
361 LoadDialogCancelButton -> setLegend (gui_msg_CANCEL);
362 LoadDialogCancelButton -> setCallback ( LoadDialogCancel );
364 FG_FINALIZE_PUI_DIALOG( LoadDialog );
366 LoadDialog -> reveal();
369 // This is the accessor function
370 void guiTogglePanel(puObject *cb)
372 if (fgGetBool("/sim/panel/visibility"))
373 fgSetBool("/sim/panel/visibility", false);
375 fgSetBool("/sim/panel/visibility", true);
377 fgReshape(fgGetInt("/sim/startup/xsize"),
378 fgGetInt("/sim/startup/ysize"));
381 void goodBye(puObject *)
383 // SG_LOG( SG_INPUT, SG_ALERT,
384 // "Program exiting normally at user request." );
385 cout << "Program exiting normally at user request." << endl;
387 // close all external I/O connections
388 globals->get_io()->shutdown_all();
394 void goAwayCb (puObject *me)
396 FG_POP_PUI_DIALOG( dialogBox );
399 void mkDialogInit (void)
401 // printf("mkDialogInit\n");
402 int x = (fgGetInt("/sim/startup/xsize")/2 - 400/2);
403 int y = (fgGetInt("/sim/startup/ysize")/2 - 100/2);
404 dialogBox = new puDialogBox (x, y); // 150, 50
406 dialogFrame = new puFrame (0,0,400,100);
407 dialogBoxMessage = new puText (10, 70);
408 dialogBoxMessage -> setLabel ("");
409 dialogBoxOkButton = new puOneShot (180, 10, 240, 50);
410 dialogBoxOkButton -> setLegend (gui_msg_OK);
411 dialogBoxOkButton -> makeReturnDefault (TRUE );
412 dialogBoxOkButton -> setCallback (goAwayCb);
414 FG_FINALIZE_PUI_DIALOG( dialogBox );
417 void MayBeGoodBye(puObject *)
422 void goAwayYesNoCb(puObject *me)
424 FG_POP_PUI_DIALOG( YNdialogBox);
427 void ConfirmExitDialogInit(void)
429 char msg[] = "Really Quit";
432 // printf("ConfirmExitDialogInit\n");
433 int len = 200 - puGetDefaultLabelFont().getStringWidth ( msg ) / 2;
435 int x = (fgGetInt("/sim/startup/xsize")/2 - 400/2);
436 int y = (fgGetInt("/sim/startup/ysize")/2 - 100/2);
438 YNdialogBox = new puDialogBox (x, y); // 150, 50
440 YNdialogFrame = new puFrame (0,0,400, 100);
442 YNdialogBoxMessage = new puText (len, 70);
443 YNdialogBoxMessage -> setDefaultValue (msg);
444 YNdialogBoxMessage -> getDefaultValue (&s);
445 YNdialogBoxMessage -> setLabel (s);
447 YNdialogBoxOkButton = new puOneShot (100, 10, 160, 50);
448 YNdialogBoxOkButton -> setLegend (gui_msg_OK);
449 YNdialogBoxOkButton -> makeReturnDefault (TRUE );
450 YNdialogBoxOkButton -> setCallback (goodBye);
452 YNdialogBoxNoButton = new puOneShot (240, 10, 300, 50);
453 YNdialogBoxNoButton -> setLegend (gui_msg_NO);
454 YNdialogBoxNoButton -> setCallback (goAwayYesNoCb);
456 FG_FINALIZE_PUI_DIALOG( YNdialogBox );
459 void notCb (puObject *)
461 mkDialog ("This function isn't implemented yet");
464 void helpCb (puObject *)
468 #if defined(FX) && !defined(WIN32)
469 # if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
470 if ( globals->get_fullscreen() ) {
471 globals->set_fullscreen(false);
472 XMesaSetFXmode( XMESA_FX_WINDOW );
477 SGPath path( globals->get_fg_root() );
478 path.append( "Docs/index.html" );
482 string help_app = fgGetString("/sim/startup/browser-app");
484 if ( system("xwininfo -name Netscape > /dev/null 2>&1") == 0 ) {
485 command = help_app + " -remote \"openURL(" + path.str() + ")\"";
487 command = help_app + " " + path.str();
490 system( command.c_str() );
494 // Look for favorite browser
495 char Dummy[1024], ExecName[1024], browserParameter[1024];
496 char win32_name[1024];
498 cygwin32_conv_to_full_win32_path(path.c_str(),win32_name);
500 strcpy(win32_name,path.c_str());
503 FindExecutable(win32_name, Dummy, ExecName);
504 sprintf(browserParameter, "file:///%s", win32_name);
505 ShellExecute ( NULL, "open", ExecName, browserParameter, Dummy,
510 mkDialog ("Help started in your web browser window.");
513 #if defined( TR_HIRES_SNAP)
518 bool show_pu_cursor = false;
519 char *filename = new char [24];
520 static int count = 1;
522 static const SGPropertyNode *master_freeze
523 = fgGetNode("/sim/freeze/master");
525 bool freeze = master_freeze->getBoolValue();
527 fgSetBool("/sim/freeze/master", true);
530 if ( !puCursorIsHidden() ) {
531 show_pu_cursor = true;
535 FGRenderer *rendrer = globals->get_renderer();
537 renderer->resize( fgGetInt("/sim/startup/xsize"),
538 fgGetInt("/sim/startup/ysize") );
540 // we need two render frames here to clear the menu and cursor
541 // ... not sure why but doing an extra fgRenderFrame() shouldn't
543 renderer->update( 0.0 );
544 renderer->update( 0.0 );
546 // Make sure we have SSG projection primed for current view
547 glMatrixMode(GL_MODELVIEW);
549 ssgSetCamera( (sgVec4 *)globals->get_current_view()->get_VIEW() );
550 ssgSetFOV( globals->get_current_view()->get_h_fov(),
551 globals->get_current_view()->get_v_fov() );
552 // ssgSetNearFar( 10.0f, 120000.0f );
553 ssgSetNearFar( 0.5f, 1200000.0f );
556 // This ImageSize stuff is a temporary hack
557 // should probably use 128x128 tile size and
558 // support any image size
560 // This should be a requester to get multiplier from user
562 int width = fgGetInt("/sim/startup/xsize");
563 int height = fgGetInt("/sim/startup/ysize");
565 /* allocate buffer large enough to store one tile */
566 GLubyte *tile = (GLubyte *)malloc(width * height * 3 * sizeof(GLubyte));
568 printf("Malloc of tile buffer failed!\n");
572 int imageWidth = multiplier*width;
573 int imageHeight = multiplier*height;
575 /* allocate buffer to hold a row of tiles */
577 = (GLubyte *)malloc(imageWidth * height * 3 * sizeof(GLubyte));
580 printf("Malloc of tile row buffer failed!\n");
583 TRcontext *tr = trNew();
584 trTileSize(tr, width, height, 0);
585 trTileBuffer(tr, GL_RGB, GL_UNSIGNED_BYTE, tile);
586 trImageSize(tr, imageWidth, imageHeight);
587 trRowOrder(tr, TR_TOP_TO_BOTTOM);
588 sgFrustum *frustum = ssgGetFrustum();
590 frustum->getLeft(), frustum->getRight(),
591 frustum->getBot(), frustum->getTop(),
592 frustum->getNear(), frustum->getFar());
594 /* Prepare ppm output file */
595 while (count < 1000) {
596 snprintf(filename, 24, "fgfs-screen-%03d.ppm", count++);
597 if ( (f = fopen(filename, "r")) == NULL )
601 f = fopen(filename, "wb");
603 printf("Couldn't open image file: %s\n", filename);
609 fprintf(f,"# ppm-file created by %s\n", "trdemo2");
610 fprintf(f,"%i %i\n", imageWidth, imageHeight);
613 /* just to be safe... */
614 glPixelStorei(GL_PACK_ALIGNMENT, 1);
616 /* Because the HUD and Panel change the ViewPort we will
617 * need to handle some lowlevel stuff ourselves */
618 int ncols = trGet(tr, TR_COLUMNS);
619 int nrows = trGet(tr, TR_ROWS);
621 bool do_hud = fgGetBool("/sim/hud/visibility");
622 GLfloat hud_col_step = 640.0 / ncols;
623 GLfloat hud_row_step = 480.0 / nrows;
625 bool do_panel = fgPanelVisible();
626 GLfloat panel_col_step = globals->get_current_panel()->getWidth() / ncols;
627 GLfloat panel_row_step = globals->get_current_panel()->getHeight() / nrows;
633 int curColumn = trGet(tr, TR_CURRENT_COLUMN);
634 int curRow = trGet(tr, TR_CURRENT_ROW);
637 fgUpdateHUD( curColumn*hud_col_step, curRow*hud_row_step,
638 (curColumn+1)*hud_col_step, (curRow+1)*hud_row_step );
640 globals->get_current_panel()->update(
641 curColumn*panel_col_step, panel_col_step,
642 curRow*panel_row_step, panel_row_step );
643 more = trEndTile(tr);
645 /* save tile into tile row buffer*/
646 int curTileWidth = trGet(tr, TR_CURRENT_TILE_WIDTH);
647 int bytesPerImageRow = imageWidth * 3*sizeof(GLubyte);
648 int bytesPerTileRow = (width) * 3*sizeof(GLubyte);
649 int xOffset = curColumn * bytesPerTileRow;
650 int bytesPerCurrentTileRow = (curTileWidth) * 3*sizeof(GLubyte);
652 for (i=0;i<height;i++) {
653 memcpy(buffer + i*bytesPerImageRow + xOffset, /* Dest */
654 tile + i*bytesPerTileRow, /* Src */
655 bytesPerCurrentTileRow); /* Byte count*/
658 if (curColumn == trGet(tr, TR_COLUMNS)-1) {
659 /* write this buffered row of tiles to the file */
660 int curTileHeight = trGet(tr, TR_CURRENT_TILE_HEIGHT);
661 int bytesPerImageRow = imageWidth * 3*sizeof(GLubyte);
663 for (i=0;i<curTileHeight;i++) {
664 /* Remember, OpenGL images are bottom to top. Have to reverse. */
665 GLubyte *rowPtr = buffer + (curTileHeight-1-i) * bytesPerImageRow;
666 fwrite(rowPtr, 1, imageWidth*3, f);
672 fgReshape( width, height );
678 message = "Snap shot saved to ";
680 mkDialog (message.c_str());
685 // message = "Snap shot saved to ";
686 // message += filename;
687 // mkDialog (message.c_str());
691 if ( show_pu_cursor ) {
696 fgSetBool("/sim/freeze/master", false);
699 #endif // #if defined( TR_HIRES_SNAP)
702 #if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
704 void rotateView( double roll, double pitch, double yaw )
710 GLubyte *hiResScreenCapture( int multiplier )
712 float oldfov = fgGetDouble("/sim/current-view/field-of-view");
713 float fov = oldfov / multiplier;
714 FGViewer *v = globals->get_current_view();
715 fgSetDouble("/sim/current-view/field-of-view", fov);
717 int cur_width = fgGetInt("/sim/startup/xsize");
718 int cur_height = fgGetInt("/sim/startup/ysize");
719 if (b1) delete( b1 );
720 // New empty (mostly) bitmap
721 b1 = new GlBitmap( GL_RGB, 1, 1, (unsigned char *)"123" );
723 for ( y = 0; y < multiplier; y++ ) {
724 for ( x = 0; x < multiplier; x++ ) {
725 fgReshape( cur_width, cur_height );
727 rotateView( 0, (y*fov)-((multiplier-1)*fov/2), (x*fov)-((multiplier-1)*fov/2) );
731 b1->copyBitmap( &b2, cur_width*x, cur_height*y );
734 fgSetDouble("/sim/current-view/field-of-view", oldfov);
735 return b1->getBitmap();
739 #if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
740 // win32 print screen function
741 void printScreen ( puObject *obj ) {
742 bool show_pu_cursor = false;
744 if ( !puCursorIsHidden() ) {
745 show_pu_cursor = true;
750 CGlPrinter p( CGlPrinter::PRINT_BITMAP );
751 int cur_width = fgGetInt("/sim/startup/xsize");
752 int cur_height = fgGetInt("/sim/startup/ysize");
753 p.Begin( "FlightGear", cur_width*3, cur_height*3 );
754 p.End( hiResScreenCapture(3) );
757 if ( show_pu_cursor ) {
762 #endif // #ifdef WIN32
765 void dumpSnapShot ( puObject *obj ) {
770 void dumpHiResSnapShot ( puObject *obj ) {
775 // do a screen snap shot
776 void fgDumpSnapShot () {
777 bool show_pu_cursor = false;
778 char *filename = new char [24];
780 static int count = 1;
782 static const SGPropertyNode *master_freeze
783 = fgGetNode("/sim/freeze/master");
785 bool freeze = master_freeze->getBoolValue();
787 fgSetBool("/sim/freeze/master", true);
791 if ( !puCursorIsHidden() ) {
792 show_pu_cursor = true;
797 fgReshape( fgGetInt("/sim/startup/xsize"),
798 fgGetInt("/sim/startup/ysize") );
800 // we need two render frames here to clear the menu and cursor
801 // ... not sure why but doing an extra fgRenderFrame() shouldn't
806 while (count < 1000) {
808 snprintf(filename, 24, "fgfs-screen-%03d.ppm", count++);
809 if ( (fp = fopen(filename, "r")) == NULL )
814 if ( sg_glDumpWindow( filename,
815 fgGetInt("/sim/startup/xsize"),
816 fgGetInt("/sim/startup/ysize")) ) {
817 message = "Snap shot saved to ";
820 message = "Failed to save to ";
824 mkDialog (message.c_str());
828 if ( show_pu_cursor ) {
835 fgSetBool("/sim/freeze/master", false);