#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/misc/sg_path.hxx>
#include <Include/general.hxx>
-#include <simgear/xgl/xgl.h>
+#include <GL/gl.h>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
void NetIdDialog_OK (puObject *)
{
- string NetId;
+ string NetId;
+
+ static const SGPropertyNode *master_freeze
+ = fgGetNode("/sim/freeze/master");
+
+ bool freeze = master_freeze->getBoolValue();
+ if ( !freeze ) {
+ fgSetBool("/sim/freeze/master", true);
+ }
- bool freeze = globals->get_freeze();
- if(!freeze)
- globals->set_freeze( true );
/*
The following needs some cleanup because
"string options.NetId" and "char *net_callsign"
*/
- NetIdDialogInput->getValue(&net_callsign);
- NetId = net_callsign;
+ NetIdDialogInput->getValue(&net_callsign);
+ NetId = net_callsign;
- NetIdDialog_Cancel( NULL );
- fgSetString("/networking/call-sign", NetId.c_str() );
- strcpy( fgd_callsign, net_callsign);
+ NetIdDialog_Cancel( NULL );
+ fgSetString("/networking/call-sign", NetId.c_str() );
+ strcpy( fgd_callsign, net_callsign);
// strcpy( fgd_callsign, fgGetString("/sim/networking/call-sign").c_str());
/* Entering a callsign indicates : user wants Net HUD Info */
- net_hud_display = 1;
+ net_hud_display = 1;
- if(!freeze)
- globals->set_freeze( false );
+ if ( !freeze ) {
+ fgSetBool("/sim/freeze/master", false);
+ }
}
void NewCallSign(puObject *cb)
{
- sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign").c_str() );
+ sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign") );
// sprintf( NewNetId, "%s", fgd_callsign );
NetIdDialogInput->setValue( NewNetId );
void NewNetIdInit(void)
{
- sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign").c_str() );
+ sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign") );
// sprintf( NewNetId, "%s", fgd_callsign );
- int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
- NewNetIdLabel ) / 2;
+ int len = 150 - puGetDefaultLabelFont().getStringWidth( NewNetIdLabel ) / 2;
NetIdDialog = new puDialogBox (150, 50);
{
void NetFGDDialog_OK (puObject *)
{
- char *NetFGD;
-
- 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(!freeze)
- globals->set_freeze( false );
+ char *NetFGD;
+
+ static const SGPropertyNode *master_freeze
+ = fgGetNode("/sim/freeze/master");
+
+ bool freeze = master_freeze->getBoolValue();
+ if ( !freeze ) {
+ fgSetBool("/sim/freeze/master", true);
+ }
+
+ NetFGDHostDialogInput->getValue( &NetFGD );
+ strcpy( fgd_host, NetFGD);
+ NetFGDPortLoDialogInput->getValue( (int *) &base_port );
+ NetFGDPortHiDialogInput->getValue( (int *) &end_port );
+ NetFGDDialog_Cancel( NULL );
+
+ if ( !freeze ) {
+ fgSetBool("/sim/freeze/master", false);
+ }
}
void NetFGDDialog_SCAN (puObject *)
{
- char *NetFGD;
- int fgd_port;
+ char *NetFGD;
+ int fgd_port;
+
+ static const SGPropertyNode *master_freeze
+ = fgGetNode("/sim/freeze/master");
+
+ bool freeze = master_freeze->getBoolValue();
+ if ( !freeze ) {
+ fgSetBool("/sim/freeze/master", true);
+ }
- bool freeze = globals->get_freeze();
- if(!freeze)
- globals->set_freeze( true );
// printf("Vor getvalue %s\n");
- NetFGDHostDialogInput->getValue( &NetFGD );
+ NetFGDHostDialogInput->getValue( &NetFGD );
// printf("Vor strcpy %s\n", (char *) NetFGD);
- strcpy( fgd_host, NetFGD);
- NetFGDPortLoDialogInput->getValue( (int *) &base_port );
- NetFGDPortHiDialogInput->getValue( (int *) &end_port );
- printf("FGD: %s Port-Start: %d Port-End: %d\n", fgd_host,
- base_port, end_port);
- net_resolv_fgd(fgd_host);
- printf("Resolve : %d\n", net_r);
- if(!freeze)
- globals->set_freeze( false );
- if ( net_r == 0 ) {
- fgd_port = 10000;
- strcpy( fgd_name, "");
- for( current_port = base_port; ( current_port <= end_port); current_port++) {
- fgd_send_com("0" , FGFS_host);
- sprintf( NewNetFGDLabel , "Scanning for deamon Port: %d", current_port);
- printf("FGD: searching %s\n", fgd_name);
- if ( strcmp( fgd_name, "") != 0 ) {
- sprintf( NewNetFGDLabel , "Found %s at Port: %d",
- fgd_name, current_port);
- fgd_port = current_port;
- current_port = end_port+1;
- }
- }
- current_port = end_port = base_port = fgd_port;
+ strcpy( fgd_host, NetFGD);
+ NetFGDPortLoDialogInput->getValue( (int *) &base_port );
+ NetFGDPortHiDialogInput->getValue( (int *) &end_port );
+ printf("FGD: %s Port-Start: %d Port-End: %d\n", fgd_host,
+ base_port, end_port);
+ net_resolv_fgd(fgd_host);
+ printf("Resolve : %d\n", net_r);
+
+ if ( !freeze ) {
+ fgSetBool("/sim/freeze/master", false);
+ }
+
+ if ( net_r == 0 ) {
+ fgd_port = 10000;
+ strcpy( fgd_name, "");
+ for( current_port = base_port; ( current_port <= end_port); current_port++) {
+ fgd_send_com("0" , FGFS_host);
+ sprintf( NewNetFGDLabel , "Scanning for deamon Port: %d", current_port);
+ printf("FGD: searching %s\n", fgd_name);
+ if ( strcmp( fgd_name, "") != 0 ) {
+ sprintf( NewNetFGDLabel , "Found %s at Port: %d",
+ fgd_name, current_port);
+ fgd_port = current_port;
+ current_port = end_port+1;
+ }
}
- NetFGDDialog_Cancel( NULL );
+ current_port = end_port = base_port = fgd_port;
+ }
+ NetFGDDialog_Cancel( NULL );
}
{
// sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign").c_str() );
// sprintf( NewNetId, "%s", fgd_callsign );
- int len = 170 - puGetStringWidth( puGetDefaultLabelFont(),
- NewNetFGDLabel ) / 2;
+ int len = 170
+ - puGetDefaultLabelFont().getStringWidth( NewNetFGDLabel ) / 2;
NetFGDDialog = new puDialogBox (310, 30);
{