1
0
Fork 0

Make NetworkOLK optional even if compiled in.

This commit is contained in:
curt 2000-02-28 04:16:12 +00:00
parent c2226f6e34
commit 749462f9bb
4 changed files with 39 additions and 21 deletions

View file

@ -742,7 +742,9 @@ void goodBye(puObject *)
cout << "Program exiting normally at user request." << endl;
#ifdef FG_NETWORK_OLK
if ( net_is_registered == 0 ) fgd_send_com( "8", FGFS_host);
if ( current_options.get_network_olk() ) {
if ( net_is_registered == 0 ) fgd_send_com( "8", FGFS_host);
}
#endif
// if(gps_bug)

View file

@ -553,22 +553,24 @@ void fgRenderFrame( void ) {
}
# ifdef FG_NETWORK_OLK
sgCoord fgdpos;
other = head->next; /* put listpointer to start */
while ( other != tail) { /* display all except myself */
if ( strcmp( other->ipadr, fgd_mcp_ip) != 0) {
other->fgd_sel->select(1);
sgSetCoord( &fgdpos, other->sgFGD_COORD );
other->fgd_pos->setTransform( &fgdpos );
if ( current_options.get_network_olk() ) {
sgCoord fgdpos;
other = head->next; /* put listpointer to start */
while ( other != tail) { /* display all except myself */
if ( strcmp( other->ipadr, fgd_mcp_ip) != 0) {
other->fgd_sel->select(1);
sgSetCoord( &fgdpos, other->sgFGD_COORD );
other->fgd_pos->setTransform( &fgdpos );
}
other = other->next;
}
other = other->next;
}
// fgd_sel->select(1);
// sgCopyMat4( sgTUX, current_view.sgVIEW);
// sgCoord fgdpos;
// sgSetCoord( &fgdpos, sgFGD_VIEW );
// fgd_pos->setTransform( &fgdpos);
// fgd_sel->select(1);
// sgCopyMat4( sgTUX, current_view.sgVIEW);
// sgCoord fgdpos;
// sgSetCoord( &fgdpos, sgFGD_VIEW );
// fgd_pos->setTransform( &fgdpos);
}
# endif
ssgSetCamera( current_view.VIEW );
@ -734,10 +736,12 @@ static void fgMainLoop( void ) {
FG_LOG( FG_ALL, FG_DEBUG, "======= ==== ====");
#ifdef FG_NETWORK_OLK
if ( net_is_registered == 0 ) { // We first have to reg. to fgd
// printf("FGD: Netupdate\n");
fgd_send_com( "A", FGFS_host); // Send Mat4 data
fgd_send_com( "B", FGFS_host); // Recv Mat4 data
if ( current_options.get_network_olk() ) {
if ( net_is_registered == 0 ) { // We first have to reg. to fgd
// printf("FGD: Netupdate\n");
fgd_send_com( "A", FGFS_host); // Send Mat4 data
fgd_send_com( "B", FGFS_host); // Recv Mat4 data
}
}
#endif
@ -1318,7 +1322,9 @@ int main( int argc, char **argv ) {
#ifdef FG_NETWORK_OLK
// Do the network intialization
printf("Multipilot mode %s\n", fg_net_init( scene ) );
if ( current_options.get_network_olk() ) {
printf("Multipilot mode %s\n", fg_net_init( scene ) );
}
#endif
scene->addKid( terrain );

View file

@ -189,7 +189,9 @@ fgOPTIONS::fgOPTIONS() :
tris_or_culled(0),
// Time options
time_offset(0)
time_offset(0),
network_olk(false)
{
// set initial values/defaults
time_offset_type=FG_TIME_SYS_OFFSET;
@ -762,6 +764,10 @@ int fgOPTIONS::parse_option( const string& arg ) {
} else if ( arg.find( "--rul=" ) != string::npos ) {
parse_channel( "rul", arg.substr(6) );
#ifdef FG_NETWORK_OLK
} else if ( arg == "--disable-network-olk" ) {
network_olk = false;
} else if ( arg== "--enable-network-olk") {
network_olk = true;
} else if ( arg == "--net-hud" ) {
net_hud_display = 1;
} else if ( arg.find( "--net-id=") != string::npos ) {

View file

@ -194,6 +194,7 @@ private:
string_list channel_options_list;
// Network options
bool network_olk;
string net_id;
public:
@ -271,6 +272,8 @@ public:
inline string_list get_channel_options_list() const {
return channel_options_list;
}
inline bool get_network_olk() const { return network_olk; }
inline string get_net_id() const { return net_id; }
// Update functions
@ -332,6 +335,7 @@ public:
}
}
inline void set_network_olk( bool net ) { network_olk = net; }
inline void set_net_id( const string id ) { net_id = id; }
private: