#include <Cockpit/panel.hxx>
#include <Controls/controls.hxx>
#include <FDM/flight.hxx>
-#include <Main/options.hxx>
+#include <Main/bfi.hxx>
#include <Main/fg_init.hxx>
+#include <Main/globals.hxx>
+#include <Main/options.hxx>
#include <Main/views.hxx>
#include <Main/save.hxx>
-#include <Main/bfi.hxx>
#ifdef FG_NETWORK_OLK
#include <NetworkOLK/network.h>
#endif
// Repair any damage done to the Panel by other Gui Items
void guiFixPanel( void )
{
- int toggle_pause;
+#if 0 // this function does nothing anyway
+ bool freeze = globals->get_freeze();
if ( current_options.get_panel_status() ) {
// FGView *v = ¤t_view;
- if( (toggle_pause = !current_options.get_pause()) )
- current_options.toggle_pause();
+ if( !freeze )
+ globals->set_freeze( true );
- if(toggle_pause)
- current_options.toggle_pause();
+ // 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
FGAirport a;
- int PauseMode = current_options.get_pause();
- if(!PauseMode)
- current_options.toggle_pause();
+ int freeze = globals->get_freeze();
+ if(!freeze)
+ globals->set_freeze( true );
char *s;
AptDialogInput->getValue(&s);
mkDialog(AptId.c_str());
}
}
- if( PauseMode != current_options.get_pause() )
- current_options.toggle_pause();
+ if(!freeze)
+ globals->set_freeze( false );
}
void AptDialog_Reset(puObject *)
{
string NetId;
- int PauseMode = current_options.get_pause();
- if(!PauseMode)
- current_options.toggle_pause();
+ bool freeze = globals->get_freeze();
+ if(!freeze)
+ globals->set_freeze( true );
/*
The following needs some cleanup because
"string options.NetId" and "char *net_callsign"
/* Entering a callsign indicates : user wants Net HUD Info */
net_hud_display = 1;
- if( PauseMode != current_options.get_pause() )
- current_options.toggle_pause();
+ if(!freeze)
+ globals->set_freeze( false );
}
void NewCallSign(puObject *cb)
{
char *NetFGD;
- int PauseMode = current_options.get_pause();
- if(!PauseMode) current_options.toggle_pause();
+ bool freeze = globals->get_freeze();
+ if(!freeze)
+ globals->set_freeze( true );
NetFGDHostDialogInput->getValue( &NetFGD );
strcpy( fgd_host, NetFGD);
NetFGDPortLoDialogInput->getValue( (int *) &base_port );
NetFGDPortHiDialogInput->getValue( (int *) &end_port );
NetFGDDialog_Cancel( NULL );
- if( PauseMode != current_options.get_pause() )
- current_options.toggle_pause();
+ if(!freeze)
+ globals->set_freeze( false );
}
void NetFGDDialog_SCAN (puObject *)
char *NetFGD;
int fgd_port;
- int PauseMode = current_options.get_pause();
- if(!PauseMode) current_options.toggle_pause();
+ bool freeze = globals->get_freeze();
+ if(!freeze)
+ globals->set_freeze( true );
// printf("Vor getvalue %s\n");
NetFGDHostDialogInput->getValue( &NetFGD );
// printf("Vor strcpy %s\n", (char *) NetFGD);
base_port, end_port);
net_resolv_fgd(fgd_host);
printf("Resolve : %d\n", net_r);
- if( PauseMode != current_options.get_pause() ) {
- current_options.toggle_pause();
- }
+ if(!freeze)
+ globals->set_freeze( false );
if ( net_r == 0 ) {
fgd_port = 10000;
strcpy( fgd_name, "");
#include "fg_init.hxx"
#include "fg_io.hxx"
+#include "globals.hxx"
#include "options.hxx"
#include "views.hxx"
#include "bfi.hxx"
void fgReInitSubsystems( void )
{
- int toggle_pause = current_options.get_pause();
-
- if( !toggle_pause )
- current_options.toggle_pause();
+ bool freeze = globals->get_freeze();
+ if( !freeze )
+ globals->set_freeze( true );
fgInitPosition();
if( global_tile_mgr.init() ) {
controls.reset_all();
current_autopilot->reset();
- if( !toggle_pause )
- current_options.toggle_pause();
+ if( !freeze )
+ globals->set_freeze( false );
}
FGGlobals();
~FGGlobals();
- inline bool get_frozen() const { return freeze; }
- inline void toggle_frozen() { freeze = !freeze; }
+ inline bool get_freeze() const { return freeze; }
+ inline void set_freeze( bool f ) { freeze = f; }
inline long int get_warp() const { return warp; }
inline void set_warp( long int w ) { warp = w; }
fgUpdateSkyAndLightingParams();
return;
case 112: // p key
- current_options.toggle_pause();
+ globals->set_freeze( ! globals->get_freeze() );
{
FGBucket p( f->get_Longitude() * RAD_TO_DEG,
switch (k) {
case GLUT_KEY_F2: // F2 Reload Tile Cache...
{
- int toggle_pause;
+ bool freeze;
FG_LOG(FG_INPUT, FG_INFO, "ReIniting TileCache");
- if( (toggle_pause = !current_options.get_pause()) )
- current_options.toggle_pause();
+ if ( !freeze )
+ globals->set_freeze( true );
BusyCursor(0);
if( global_tile_mgr.init() ) {
// Load the local scenery data
exit(-1);
}
BusyCursor(1);
- if(toggle_pause)
- current_options.toggle_pause();
+ if ( !freeze )
+ globals->set_freeze( false );
return;
}
case GLUT_KEY_F3: // F3 Take a screen shot
multi_loop = 1;
}
- if ( !current_options.get_pause() ) {
+ if ( !globals->get_freeze() ) {
// run Autopilot system
current_autopilot->run();
splash_screen(1),
intro_music(1),
mouse_pointer(0),
- pause(0),
control_mode(FG_JOYSTICK),
auto_coordination(FG_AUTO_COORD_NOT_SPECIFIED),
void
fgOPTIONS::toggle_panel() {
- if( !pause )
- toggle_pause();
+ bool freeze = globals->get_freeze();
+
+ if( !freeze )
+ globals->set_freeze(true);
if( panel_status ) {
panel_status = false;
// fgReshape( xsize, ysize);
fgReshape( current_view.get_winWidth(), current_view.get_winHeight() );
- if( !pause )
- toggle_pause();
+ if( !freeze )
+ globals->set_freeze( false );
}
double
mouse_pointer = 1;
} else if ( arg == "--enable-mouse-pointer" ) {
mouse_pointer = 2;
- } else if ( arg == "--disable-pause" ) {
- pause = false;
- } else if ( arg == "--enable-pause" ) {
- pause = true;
+ } else if ( arg == "--disable-freeze" ) {
+ globals->set_freeze( false );
+ } else if ( arg == "--enable-freeze" ) {
+ globals->set_freeze( true );
} else if ( arg == "--disable-anti-alias-hud" ) {
anti_alias_hud = false;
} else if ( arg == "--enable-anti-alias-hud" ) {
cout << "\t--enable-mouse-pointer: enable extra mouse pointer (i.e. for"
<< endl;
cout << "\t\tfull screen voodoo/voodoo-II based cards.)" << endl;
- cout << "\t--disable-pause: start out in an active state" << endl;
- cout << "\t--enable-pause: start out in a paused state" << endl;
+ cout << "\t--disable-freeze: start out in an running state" << endl;
+ cout << "\t--enable-freeze: start out in a frozen state" << endl;
cout << "\t--control=mode: primary control mode "
<< "(joystick, keyboard, mouse)" << endl;
cout << endl;
bool splash_screen; // show splash screen
bool intro_music; // play introductory music
int mouse_pointer; // show mouse pointer
- bool pause; // pause intially enabled/disabled
fgControlMode control_mode; // primary control mode
fgAutoCoordMode auto_coordination; // enable auto coordination
inline bool get_splash_screen() const { return splash_screen; }
inline bool get_intro_music() const { return intro_music; }
inline int get_mouse_pointer() const { return mouse_pointer; }
- inline bool get_pause() const { return pause; }
inline bool get_anti_alias_hud() const { return anti_alias_hud; }
inline fgControlMode get_control_mode() const { return control_mode; }
inline void set_control_mode( fgControlMode mode ) { control_mode = mode; }
inline void set_splash_screen (bool value) { splash_screen = value; }
inline void set_intro_music (bool value) { intro_music = value; }
inline void set_mouse_pointer (int value) { mouse_pointer = value; }
- inline void set_pause (bool value) { pause = value; }
- inline void toggle_pause () { pause = !pause; }
inline void set_anti_alias_hud (bool value) { anti_alias_hud = value; }
inline void set_hud_status( bool status ) { hud_status = status; }
inline void set_sound (bool value) { sound = value; }