]> git.mxchange.org Git - flightgear.git/blob - src/Main/options.cxx
9e77dd783d49438607327b6135718d775e7a3ff7
[flightgear.git] / src / Main / options.cxx
1 // options.cxx -- class to handle command line options
2 //
3 // Written by Curtis Olson, started April 1998.
4 //
5 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22
23
24 #ifdef HAVE_CONFIG_H
25 #  include <config.h>
26 #endif
27
28 #include <simgear/compiler.h>
29 #include <simgear/misc/exception.hxx>
30
31 /* normans fix */
32 #if defined(FX) && defined(XMESA)
33 bool global_fullscreen = true;
34 #endif
35
36 #include <math.h>            // rint()
37 #include <stdio.h>
38 #include <stdlib.h>          // atof(), atoi()
39 #include <string.h>
40
41 #include STL_STRING
42
43 #include <simgear/misc/sgstream.hxx>
44
45 // #include <Include/general.hxx>
46 // #include <Airports/simple.hxx>
47 // #include <Cockpit/cockpit.hxx>
48 // #include <FDM/flight.hxx>
49 // #include <FDM/UIUCModel/uiuc_aircraftdir.h>
50 #ifdef FG_NETWORK_OLK
51 #  include <NetworkOLK/network.h>
52 #endif
53
54 #include <GUI/gui.h>
55
56 #include "globals.hxx"
57 #include "fg_init.hxx"
58 #include "fg_props.hxx"
59 #include "options.hxx"
60
61 SG_USING_STD(string);
62 SG_USING_NAMESPACE(std);
63
64
65 #define NEW_DEFAULT_MODEL_HZ 120
66
67 enum
68 {
69     FG_OPTIONS_OK = 0,
70     FG_OPTIONS_HELP = 1,
71     FG_OPTIONS_ERROR = 2
72 };
73
74 static double
75 atof( const string& str )
76 {
77
78 #ifdef __MWERKS__ 
79     // -dw- if ::atof is called, then we get an infinite loop
80     return std::atof( str.c_str() );
81 #else
82     return ::atof( str.c_str() );
83 #endif
84 }
85
86 static int
87 atoi( const string& str )
88 {
89 #ifdef __MWERKS__ 
90     // -dw- if ::atoi is called, then we get an infinite loop
91     return std::atoi( str.c_str() );
92 #else
93     return ::atoi( str.c_str() );
94 #endif
95 }
96
97
98 /**
99  * Set a few fail-safe default property values.
100  *
101  * These should all be set in $FG_ROOT/preferences.xml, but just
102  * in case, we provide some initial sane values here. This method 
103  * should be invoked *before* reading any init files.
104  */
105 void
106 fgSetDefaults ()
107 {
108     // set a possibly independent location for scenery data
109     char *envp = ::getenv( "FG_SCENERY" );
110
111     if ( envp != NULL ) {
112         // fg_root could be anywhere, so default to environmental
113         // variable $FG_ROOT if it is set.
114         globals->set_fg_scenery(envp);
115     } else {
116         // Otherwise, default to Scenery being in $FG_ROOT/Scenery
117         globals->set_fg_scenery("");
118     }
119                                 // Position (Globe, AZ)
120     fgSetDouble("/position/longitude-deg", -110.6642444);
121     fgSetDouble("/position/latitude-deg", 33.3528917);
122     fgSetDouble("/position/altitude-ft", -9999.0);
123
124                                 // Orientation
125     fgSetDouble("/orientation/heading-deg", 270);
126     fgSetDouble("/orientation/roll-deg", 0);
127     fgSetDouble("/orientation/pitch-deg", 0.424);
128
129                                 // Velocities
130     fgSetString("/sim/startup/speed-set", "knots");
131     fgSetDouble("/velocities/uBody-fps", 0.0);
132     fgSetDouble("/velocities/vBody-fps", 0.0);
133     fgSetDouble("/velocities/wBody-fps", 0.0);
134     fgSetDouble("/velocities/speed-north-fps", 0.0);
135     fgSetDouble("/velocities/speed-east-fps", 0.0);
136     fgSetDouble("/velocities/speed-down-fps", 0.0);
137     fgSetDouble("/velocities/airspeed-kt", 0.0);
138     fgSetDouble("/velocities/mach", 0.0);
139
140                                 // Miscellaneous
141     fgSetBool("/sim/startup/game-mode", false);
142     fgSetBool("/sim/startup/splash-screen", true);
143     fgSetBool("/sim/startup/intro-music", true);
144     // we want mouse-pointer to have an undefined value if nothing is
145     // specified so we can do the right thing for voodoo-1/2 cards.
146     // fgSetString("/sim/startup/mouse-pointer", "disabled");
147     fgSetString("/sim/control-mode", "joystick");
148     fgSetBool("/sim/auto-coordination", false);
149 #if !defined(WIN32)
150     fgSetString("/sim/startup/browser-app", "netscape");
151 #else
152     fgSetString("/sim/startup/browser-app", "webrun.bat");
153 #endif
154                                 // Features
155     fgSetBool("/sim/hud/visibility", false);
156     fgSetBool("/sim/panel/visibility", true);
157     fgSetBool("/sim/sound", true);
158     fgSetBool("/sim/hud/antialiased", false);
159
160                                 // Flight Model options
161     fgSetString("/sim/flight-model", "larcsim");
162     fgSetString("/sim/aircraft", "c172");
163     fgSetInt("/sim/model-hz", NEW_DEFAULT_MODEL_HZ);
164     fgSetInt("/sim/speed-up", 1);
165     fgSetBool("/sim/startup/trim", false);
166     fgSetBool("/sim/startup/onground", true);
167
168                                 // Rendering options
169     fgSetString("/sim/rendering/fog", "nicest");
170     fgSetBool("/environment/clouds/status", true);
171     fgSetDouble("/environment/clouds/altitude-ft", 5000);
172     fgSetBool("/sim/startup/fullscreen", false);
173     fgSetBool("/sim/rendering/shading", true);
174     fgSetBool("/sim/rendering/skyblend", true);
175     fgSetBool("/sim/rendering/textures", true);
176     fgSetBool("/sim/rendering/wireframe", false);
177     fgSetInt("/sim/startup/xsize", 800);
178     fgSetInt("/sim/startup/ysize", 600);
179     fgSetInt("/sim/rendering/bits-per-pixel", 16);
180     fgSetString("/sim/view-mode", "pilot");
181     fgSetDouble("/sim/view/offset-deg", 0);
182     fgSetDouble("/environment/visibility-m", 20000);
183
184                                 // HUD options
185     fgSetString("/sim/startup/units", "feet");
186     fgSetString("/sim/hud/frame-stat-type", "tris");
187         
188                                 // Time options
189     fgSetInt("/sim/startup/time-offset", 0);
190     fgSetString("/sim/startup/time-offset-type", "system-offset");
191
192     fgSetBool("/sim/networking/network-olk", false);
193     fgSetString("/sim/networking/call-sign", "Johnny");
194 }
195
196
197 // parse a time string ([+/-]%f[:%f[:%f]]) into hours
198 static double
199 parse_time(const string& time_in) {
200     char *time_str, num[256];
201     double hours, minutes, seconds;
202     double result = 0.0;
203     int sign = 1;
204     int i;
205
206     time_str = (char *)time_in.c_str();
207
208     // printf("parse_time(): %s\n", time_str);
209
210     // check for sign
211     if ( strlen(time_str) ) {
212         if ( time_str[0] == '+' ) {
213             sign = 1;
214             time_str++;
215         } else if ( time_str[0] == '-' ) {
216             sign = -1;
217             time_str++;
218         }
219     }
220     // printf("sign = %d\n", sign);
221
222     // get hours
223     if ( strlen(time_str) ) {
224         i = 0;
225         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
226             num[i] = time_str[0];
227             time_str++;
228             i++;
229         }
230         if ( time_str[0] == ':' ) {
231             time_str++;
232         }
233         num[i] = '\0';
234         hours = atof(num);
235         // printf("hours = %.2lf\n", hours);
236
237         result += hours;
238     }
239
240     // get minutes
241     if ( strlen(time_str) ) {
242         i = 0;
243         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
244             num[i] = time_str[0];
245             time_str++;
246             i++;
247         }
248         if ( time_str[0] == ':' ) {
249             time_str++;
250         }
251         num[i] = '\0';
252         minutes = atof(num);
253         // printf("minutes = %.2lf\n", minutes);
254
255         result += minutes / 60.0;
256     }
257
258     // get seconds
259     if ( strlen(time_str) ) {
260         i = 0;
261         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
262             num[i] = time_str[0];
263             time_str++;
264             i++;
265         }
266         num[i] = '\0';
267         seconds = atof(num);
268         // printf("seconds = %.2lf\n", seconds);
269
270         result += seconds / 3600.0;
271     }
272
273     return(sign * result);
274 }
275
276
277 // parse a date string (yyyy:mm:dd:hh:mm:ss) into a time_t (seconds)
278 static long int 
279 parse_date( const string& date)
280 {
281     struct tm gmt;
282     char * date_str, num[256];
283     int i;
284     // initialize to zero
285     gmt.tm_sec = 0;
286     gmt.tm_min = 0;
287     gmt.tm_hour = 0;
288     gmt.tm_mday = 0;
289     gmt.tm_mon = 0;
290     gmt.tm_year = 0;
291     gmt.tm_isdst = 0; // ignore daylight savings time for the moment
292     date_str = (char *)date.c_str();
293     // get year
294     if ( strlen(date_str) ) {
295         i = 0;
296         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
297             num[i] = date_str[0];
298             date_str++;
299             i++;
300         }
301         if ( date_str[0] == ':' ) {
302             date_str++;
303         }
304         num[i] = '\0';
305         gmt.tm_year = atoi(num) - 1900;
306     }
307     // get month
308     if ( strlen(date_str) ) {
309         i = 0;
310         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
311             num[i] = date_str[0];
312             date_str++;
313             i++;
314         }
315         if ( date_str[0] == ':' ) {
316             date_str++;
317         }
318         num[i] = '\0';
319         gmt.tm_mon = atoi(num) -1;
320     }
321     // get day
322     if ( strlen(date_str) ) {
323         i = 0;
324         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
325             num[i] = date_str[0];
326             date_str++;
327             i++;
328         }
329         if ( date_str[0] == ':' ) {
330             date_str++;
331         }
332         num[i] = '\0';
333         gmt.tm_mday = atoi(num);
334     }
335     // get hour
336     if ( strlen(date_str) ) {
337         i = 0;
338         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
339             num[i] = date_str[0];
340             date_str++;
341             i++;
342         }
343         if ( date_str[0] == ':' ) {
344             date_str++;
345         }
346         num[i] = '\0';
347         gmt.tm_hour = atoi(num);
348     }
349     // get minute
350     if ( strlen(date_str) ) {
351         i = 0;
352         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
353             num[i] = date_str[0];
354             date_str++;
355             i++;
356         }
357         if ( date_str[0] == ':' ) {
358             date_str++;
359         }
360         num[i] = '\0';
361         gmt.tm_min = atoi(num);
362     }
363     // get second
364     if ( strlen(date_str) ) {
365         i = 0;
366         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
367             num[i] = date_str[0];
368             date_str++;
369             i++;
370         }
371         if ( date_str[0] == ':' ) {
372             date_str++;
373         }
374         num[i] = '\0';
375         gmt.tm_sec = atoi(num);
376     }
377     time_t theTime = sgTimeGetGMT( gmt.tm_year, gmt.tm_mon, gmt.tm_mday,
378                                    gmt.tm_hour, gmt.tm_min, gmt.tm_sec );
379     //printf ("Date is %s\n", ctime(&theTime));
380     //printf ("in seconds that is %d\n", theTime);
381     //exit(1);
382     return (theTime);
383 }
384
385
386 // parse angle in the form of [+/-]ddd:mm:ss into degrees
387 static double
388 parse_degree( const string& degree_str) {
389     double result = parse_time( degree_str );
390
391     // printf("Degree = %.4f\n", result);
392
393     return(result);
394 }
395
396
397 // parse time offset string into seconds
398 static int
399 parse_time_offset( const string& time_str) {
400     int result;
401
402     // printf("time offset = %s\n", time_str);
403
404 #ifdef HAVE_RINT
405     result = (int)rint(parse_time(time_str) * 3600.0);
406 #else
407     result = (int)(parse_time(time_str) * 3600.0);
408 #endif
409
410     // printf("parse_time_offset(): %d\n", result);
411
412     return( result );
413 }
414
415
416 // Parse --fov=x.xx type option 
417 static double
418 parse_fov( const string& arg ) {
419     double fov = atof(arg);
420
421     if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
422     if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
423
424     fgSetDouble("/sim/field-of-view", fov);
425
426     // printf("parse_fov(): result = %.4f\n", fov);
427
428     return fov;
429 }
430
431
432 // Parse I/O channel option
433 //
434 // Format is "--protocol=medium,direction,hz,medium_options,..."
435 //
436 //   protocol = { native, nmea, garmin, fgfs, rul, pve, etc. }
437 //   medium = { serial, socket, file, etc. }
438 //   direction = { in, out, bi }
439 //   hz = number of times to process channel per second (floating
440 //        point values are ok.
441 //
442 // Serial example "--nmea=serial,dir,hz,device,baud" where
443 // 
444 //  device = OS device name of serial line to be open()'ed
445 //  baud = {300, 1200, 2400, ..., 230400}
446 //
447 // Socket exacmple "--native=socket,dir,hz,machine,port,style" where
448 // 
449 //  machine = machine name or ip address if client (leave empty if server)
450 //  port = port, leave empty to let system choose
451 //  style = tcp or udp
452 //
453 // File example "--garmin=file,dir,hz,filename" where
454 // 
455 //  filename = file system file name
456
457 static bool 
458 parse_channel( const string& type, const string& channel_str ) {
459     // cout << "Channel string = " << channel_str << endl;
460
461     globals->get_channel_options_list()->push_back( type + "," + channel_str );
462
463     return true;
464 }
465
466
467 // Parse --wp=ID[@alt]
468 static bool 
469 parse_wp( const string& arg ) {
470     string id, alt_str;
471     double alt = 0.0;
472
473     unsigned int pos = arg.find( "@" );
474     if ( pos != string::npos ) {
475         id = arg.substr( 0, pos );
476         alt_str = arg.substr( pos + 1 );
477         // cout << "id str = " << id << "  alt str = " << alt_str << endl;
478         alt = atof( alt_str.c_str() );
479         if ( fgGetString("/sim/startup/units") == "feet" ) {
480             alt *= SG_FEET_TO_METER;
481         }
482     } else {
483         id = arg;
484     }
485
486     FGAirport a;
487     if ( fgFindAirportID( id, &a ) ) {
488         SGWayPoint wp( a.longitude, a.latitude, alt, SGWayPoint::WGS84, id );
489         globals->get_route()->add_waypoint( wp );
490
491         return true;
492     } else {
493         return false;
494     }
495 }
496
497
498 // Parse --flight-plan=[file]
499 static bool 
500 parse_flightplan(const string& arg)
501 {
502     sg_gzifstream in(arg.c_str());
503     if ( !in.is_open() ) {
504         return false;
505     }
506     while ( true ) {
507         string line;
508
509 #if defined( macintosh )
510         getline( in, line, '\r' );
511 #else
512         getline( in, line, '\n' );
513 #endif
514
515         // catch extraneous (DOS) line ending character
516         if ( line[line.length() - 1] < 32 ) {
517             line = line.substr( 0, line.length()-1 );
518         }
519
520         if ( in.eof() ) {
521             break;
522         }
523         parse_wp(line);
524     }
525
526     return true;
527 }
528
529
530 // Parse a single option
531 static int 
532 parse_option (const string& arg) 
533 {
534     // General Options
535     if ( (arg == "--help") || (arg == "-h") ) {
536         // help/usage request
537         return(FG_OPTIONS_HELP);
538     } else if ( arg == "--disable-game-mode") {
539         fgSetBool("/sim/startup/game-mode", false);
540     } else if ( arg == "--enable-game-mode" ) {
541         fgSetBool("/sim/startup/game-mode", true);
542     } else if ( arg == "--disable-splash-screen" ) {
543         fgSetBool("/sim/startup/splash-screen", false); 
544     } else if ( arg == "--enable-splash-screen" ) {
545         fgSetBool("/sim/startup/splash-screen", true);
546     } else if ( arg == "--disable-intro-music" ) {
547         fgSetBool("/sim/startup/intro-music", false);
548     } else if ( arg == "--enable-intro-music" ) {
549         fgSetBool("/sim/startup/intro-music", true);
550     } else if ( arg == "--disable-mouse-pointer" ) {
551         fgSetString("/sim/startup/mouse-pointer", "disabled");
552     } else if ( arg == "--enable-mouse-pointer" ) {
553         fgSetString("/sim/startup/mouse-pointer", "enabled");
554     } else if ( arg == "--disable-freeze" ) {
555         fgSetBool("/sim/freeze", false);
556     } else if ( arg == "--enable-freeze" ) {
557         fgSetBool("/sim/freeze", true);
558     } else if ( arg == "--disable-anti-alias-hud" ) {
559         fgSetBool("/sim/hud/antialiased", false);
560     } else if ( arg == "--enable-anti-alias-hud" ) {
561         fgSetBool("/sim/hud/antialiased", true);
562     } else if ( arg.find( "--control=") == 0 ) {
563         fgSetString("/sim/control-mode", arg.substr(10));
564     } else if ( arg == "--disable-auto-coordination" ) {
565         fgSetBool("/sim/auto-coordination", false);
566     } else if ( arg == "--enable-auto-coordination" ) {
567         fgSetBool("/sim/auto-coordination", true);
568     } else if ( arg.find( "--browser-app=") == 0 ) {
569         fgSetString("/sim/startup/browser-app", arg.substr(14));
570     } else if ( arg == "--disable-hud" ) {
571         fgSetBool("/sim/hud/visibility", false);
572     } else if ( arg == "--enable-hud" ) {
573         fgSetBool("/sim/hud/visibility", true);
574     } else if ( arg == "--disable-panel" ) {
575         fgSetBool("/sim/panel/visibility", false);
576     } else if ( arg == "--enable-panel" ) {
577         fgSetBool("/sim/panel/visibility", true);
578     } else if ( arg == "--disable-sound" ) {
579         fgSetBool("/sim/sound", false);
580     } else if ( arg == "--enable-sound" ) {
581         fgSetBool("/sim/sound", true);
582     } else if ( arg.find( "--airport-id=") == 0 ) {
583                                 // NB: changed property name!!!
584         fgSetString("/sim/startup/airport-id", arg.substr(13));
585     } else if ( arg.find( "--offset-distance=") == 0 ) {
586         fgSetDouble("/sim/startup/offset-distance", atof(arg.substr(18)));
587     } else if ( arg.find( "--offset-azimuth=") == 0 ) {
588         fgSetDouble("/sim/startup/offset-azimuth", atof(arg.substr(17))); 
589     } else if ( arg.find( "--lon=" ) == 0 ) {
590         fgSetDouble("/position/longitude-deg",
591                               parse_degree(arg.substr(6)));
592         fgSetString("/sim/startup/airport-id", "");
593     } else if ( arg.find( "--lat=" ) == 0 ) {
594         fgSetDouble("/position/latitude-deg",
595                               parse_degree(arg.substr(6)));
596         fgSetString("/sim/startup/airport-id", "");
597     } else if ( arg.find( "--altitude=" ) == 0 ) {
598         fgSetBool("/sim/startup/onground", false);
599         if ( fgGetString("/sim/startup/units") == "feet" )
600             fgSetDouble("/position/altitude-ft", atof(arg.substr(11)));
601         else
602             fgSetDouble("/position/altitude-ft",
603                         atof(arg.substr(11)) * SG_METER_TO_FEET);
604     } else if ( arg.find( "--uBody=" ) == 0 ) {
605         fgSetString("/sim/startup/speed-set", "UVW");
606         if ( fgGetString("/sim/startup/units") == "feet" )
607           fgSetDouble("/velocities/uBody-fps", atof(arg.substr(8)));
608         else
609           fgSetDouble("/velocities/uBody-fps",
610                                atof(arg.substr(8)) * SG_METER_TO_FEET);
611     } else if ( arg.find( "--vBody=" ) == 0 ) {
612         fgSetString("/sim/startup/speed-set", "UVW");
613         if ( fgGetString("/sim/startup/units") == "feet" )
614           fgSetDouble("/velocities/vBody-fps", atof(arg.substr(8)));
615         else
616           fgSetDouble("/velocities/vBody-fps",
617                                atof(arg.substr(8)) * SG_METER_TO_FEET);
618     } else if ( arg.find( "--wBody=" ) == 0 ) {
619         fgSetString("/sim/startup/speed-set", "UVW");
620         if ( fgGetString("/sim/startup/units") == "feet" )
621           fgSetDouble("/velocities/wBody-fps", atof(arg.substr(8)));
622         else
623           fgSetDouble("/velocities/wBody-fps",
624                                atof(arg.substr(8)) * SG_METER_TO_FEET);
625     } else if ( arg.find( "--vNorth=" ) == 0 ) {
626         fgSetString("/sim/startup/speed-set", "NED");
627         if ( fgGetString("/sim/startup/units") == "feet" )
628           fgSetDouble("/velocities/speed-north-fps", atof(arg.substr(9)));
629         else
630           fgSetDouble("/velocities/speed-north-fps",
631                                atof(arg.substr(9)) * SG_METER_TO_FEET);
632     } else if ( arg.find( "--vEast=" ) == 0 ) {
633         fgSetString("/sim/startup/speed-set", "NED");
634         if ( fgGetString("/sim/startup/units") == "feet" )
635           fgSetDouble("/velocities/speed-east-fps", atof(arg.substr(8)));
636         else
637           fgSetDouble("/velocities/speed-east-fps",
638                       atof(arg.substr(8)) * SG_METER_TO_FEET);
639     } else if ( arg.find( "--vDown=" ) == 0 ) {
640         fgSetString("/sim/startup/speed-set", "NED");
641         if ( fgGetString("/sim/startup/units") == "feet" )
642           fgSetDouble("/velocities/speed-down-fps", atof(arg.substr(8)));
643         else
644           fgSetDouble("/velocities/speed-down-fps",
645                                atof(arg.substr(8)) * SG_METER_TO_FEET);
646     } else if ( arg.find( "--vc=" ) == 0) {
647         fgSetString("/sim/startup/speed-set", "knots");
648         fgSetDouble("/velocities/airspeed-kt", atof(arg.substr(5)));
649     } else if ( arg.find( "--mach=" ) == 0) {
650         fgSetString("/sim/startup/speed-set", "mach");
651         fgSetDouble("/velocities/mach", atof(arg.substr(7)));
652     } else if ( arg.find( "--heading=" ) == 0 ) {
653         fgSetDouble("/orientation/heading-deg", atof(arg.substr(10)));
654     } else if ( arg.find( "--roll=" ) == 0 ) {
655         fgSetDouble("/orientation/roll-deg", atof(arg.substr(7)));
656     } else if ( arg.find( "--pitch=" ) == 0 ) {
657         fgSetDouble("/orientation/pitch-deg", atof(arg.substr(8)));
658     } else if ( arg.find( "--fg-root=" ) == 0 ) {
659         globals->set_fg_root(arg.substr( 10 ));
660     } else if ( arg.find( "--fg-scenery=" ) == 0 ) {
661         globals->set_fg_scenery(arg.substr( 13 ));
662     } else if ( arg.find( "--fdm=" ) == 0 ) {
663         fgSetString("/sim/flight-model", arg.substr(6));
664     } else if ( arg.find( "--aircraft=" ) == 0 ) {
665         fgSetString("/sim/aircraft", arg.substr(11));
666     } else if ( arg.find( "--aircraft-dir=" ) == 0 ) {
667         fgSetString("/sim/aircraft-dir", arg.substr(15));
668     } else if ( arg.find( "--model-hz=" ) == 0 ) {
669         fgSetInt("/sim/model-hz", atoi(arg.substr(11)));
670     } else if ( arg.find( "--speed=" ) == 0 ) {
671         fgSetInt("/sim/speed-up", atoi(arg.substr(8)));
672     } else if ( arg.find( "--trim") == 0) {
673         fgSetBool("/sim/startup/trim", true);
674     } else if ( arg.find( "--notrim") == 0) {
675         fgSetBool("/sim/startup/trim", false);
676     } else if ( arg.find( "--on-ground") == 0) {
677         fgSetBool("/sim/startup/onground", true);
678     } else if ( arg.find( "--in-air") == 0) {
679         fgSetBool("/sim/startup/onground", false);
680     } else if ( arg == "--fog-disable" ) {
681         fgSetString("/sim/rendering/fog", "disabled");
682     } else if ( arg == "--fog-fastest" ) {
683         fgSetString("/sim/rendering/fog", "fastest");
684     } else if ( arg == "--fog-nicest" ) {
685         fgSetString("/sim/fog", "nicest");
686     } else if ( arg == "--disable-clouds" ) {
687         fgSetBool("/environment/clouds/status", false);
688     } else if ( arg == "--enable-clouds" ) {
689         fgSetBool("/environment/clouds/status", true);
690     } else if ( arg.find( "--clouds-asl=" ) == 0 ) {
691                                 // FIXME: check units
692         if ( fgGetString("/sim/startup/units") == "feet" )
693           fgSetDouble("/environment/clouds/altitude-ft",
694                                 atof(arg.substr(13)) * SG_FEET_TO_METER);
695         else
696           fgSetDouble("/environment/clouds/altitude-ft",
697                                 atof(arg.substr(13)));
698     } else if ( arg.find( "--fov=" ) == 0 ) {
699         parse_fov( arg.substr(6) );
700     } else if ( arg == "--disable-fullscreen" ) {
701         fgSetBool("/sim/startup/fullscreen", false);
702     } else if ( arg== "--enable-fullscreen") {
703         fgSetBool("/sim/startup/fullscreen", true);
704     } else if ( arg == "--shading-flat") {
705         fgSetBool("/sim/rendering/shading", false);
706     } else if ( arg == "--shading-smooth") {
707         fgSetBool("/sim/rendering/shading", true);
708     } else if ( arg == "--disable-skyblend") {
709         fgSetBool("/sim/rendering/skyblend", false);
710     } else if ( arg== "--enable-skyblend" ) {
711         fgSetBool("/sim/rendering/skyblend", true);
712     } else if ( arg == "--disable-textures" ) {
713         fgSetBool("/sim/rendering/textures", false);
714     } else if ( arg == "--enable-textures" ) {
715         fgSetBool("/sim/rendering/textures", true);
716     } else if ( arg == "--disable-wireframe" ) {
717         fgSetBool("/sim/rendering/wireframe", false);
718     } else if ( arg == "--enable-wireframe" ) {
719         fgSetBool("/sim/rendering/wireframe", true);
720     } else if ( arg.find( "--geometry=" ) == 0 ) {
721         bool geometry_ok = true;
722         int xsize = 0, ysize = 0;
723         string geometry = arg.substr( 11 );
724         string::size_type i = geometry.find('x');
725
726         if (i != string::npos) {
727             xsize = atoi(geometry.substr(0, i));
728             ysize = atoi(geometry.substr(i+1));
729         } else {
730             geometry_ok = false;
731         }
732
733         if ( xsize <= 0 || ysize <= 0 ) {
734             xsize = 640;
735             ysize = 480;
736             geometry_ok = false;
737         }
738
739         if ( !geometry_ok ) {
740             SG_LOG( SG_GENERAL, SG_ALERT, "Unknown geometry: " << geometry );
741             SG_LOG( SG_GENERAL, SG_ALERT,
742                     "Setting geometry to " << xsize << 'x' << ysize << '\n');
743         } else {
744           SG_LOG( SG_GENERAL, SG_INFO,
745                   "Setting geometry to " << xsize << 'x' << ysize << '\n');
746           fgSetInt("/sim/startup/xsize", xsize);
747           fgSetInt("/sim/startup/ysize", ysize);
748         }
749     } else if ( arg.find( "--bpp=" ) == 0 ) {
750         string bits_per_pix = arg.substr( 6 );
751         if ( bits_per_pix == "16" ) {
752             fgSetInt("/sim/rendering/bits-per-pixel", 16);
753         } else if ( bits_per_pix == "24" ) {
754             fgSetInt("/sim/rendering/bits-per-pixel", 24);
755         } else if ( bits_per_pix == "32" ) {
756             fgSetInt("/sim/rendering/bits-per-pixel", 32);
757         } else {
758           SG_LOG(SG_GENERAL, SG_ALERT, "Unsupported bpp " << bits_per_pix);
759         }
760     } else if ( arg == "--units-feet" ) {
761         fgSetString("/sim/startup/units", "feet");
762     } else if ( arg == "--units-meters" ) {
763         fgSetString("/sim/startup/units", "meters");
764     } else if ( arg.find( "--time-offset" ) == 0 ) {
765         fgSetInt("/sim/startup/time-offset",
766                            parse_time_offset( (arg.substr(14)) ));
767     } else if ( arg.find( "--time-match-real") == 0 ) {
768         fgSetString("/sim/startup/time-offset-type",
769                               "system-offset");
770     } else if ( arg.find( "--time-match-local") == 0 ) {
771         fgSetString("/sim/startup/time-offset-type",
772                               "latitude-offset");
773     } else if ( arg.find( "--start-date-sys=") == 0 ) {
774         fgSetInt("/sim/startup/time-offset",
775                            parse_date((arg.substr(17))));
776         fgSetString("/sim/startup/time-offset-type", "system");
777     } else if ( arg.find( "--start-date-lat=") == 0 ) {
778         fgSetInt("/sim/startup/time-offset",
779                            parse_date((arg.substr(17))));
780         fgSetString("/sim/startup/time-offset-type",
781                            "latitude");
782     } else if ( arg.find( "--start-date-gmt=") == 0 ) {
783         fgSetInt("/sim/startup/time-offset",
784                            parse_date((arg.substr(17))));
785         fgSetString("/sim/startup/time-offset-type", "gmt");
786     } else if ( arg == "--hud-tris" ) {
787         fgSetString("/sim/hud/frame-stat-type", "tris");
788     } else if ( arg == "--hud-culled" ) {
789         fgSetString("/sim/hud/frame-stat-type", "culled");
790     } else if ( arg.find( "--atlas=" ) == 0 ) {
791         parse_channel( "atlas", arg.substr(8) );
792     } else if ( arg.find( "--native=" ) == 0 ) {
793         parse_channel( "native", arg.substr(9) );
794     } else if ( arg.find( "--garmin=" ) == 0 ) {
795         parse_channel( "garmin", arg.substr(9) );
796     } else if ( arg.find( "--nmea=" ) == 0 ) {
797         parse_channel( "nmea", arg.substr(7) );
798     } else if ( arg.find( "--props=" ) == 0 ) {
799         parse_channel( "props", arg.substr(8) );
800     } else if ( arg.find( "--pve=" ) == 0 ) {
801         parse_channel( "pve", arg.substr(6) );
802     } else if ( arg.find( "--ray=" ) == 0 ) {
803         parse_channel( "ray", arg.substr(6) );
804     } else if ( arg.find( "--rul=" ) == 0 ) {
805         parse_channel( "rul", arg.substr(6) );
806     } else if ( arg.find( "--joyclient=" ) == 0 ) {
807         parse_channel( "joyclient", arg.substr(12) );
808 #ifdef FG_NETWORK_OLK
809     } else if ( arg == "--disable-network-olk" ) {
810         fgSetBool("/sim/networking/olk", false);
811     } else if ( arg== "--enable-network-olk") {
812         fgSetBool("/sim/networking/olk", true);
813     } else if ( arg == "--net-hud" ) {
814         fgSetBool("/sim/hud/net-display", true);
815         net_hud_display = 1;    // FIXME
816     } else if ( arg.find( "--net-id=") == 0 ) {
817         fgSetString("sim/networking/call-sign", arg.substr(9));
818 #endif
819     } else if ( arg.find( "--prop:" ) == 0 ) {
820         string assign = arg.substr(7);
821         unsigned int pos = assign.find('=');
822         if ( pos == arg.npos || pos == 0 ) {
823             SG_LOG( SG_GENERAL, SG_ALERT, "Bad property assignment: " << arg );
824             return FG_OPTIONS_ERROR;
825         }
826         string name = assign.substr(0, pos);
827         string value = assign.substr(pos + 1);
828         fgSetString(name.c_str(), value);
829         // SG_LOG(SG_GENERAL, SG_INFO, "Setting default value of property "
830         //        << name << " to \"" << value << '"');
831     // $$$ begin - added VS Renganathan, 14 Oct 2K
832     // for multi-window outside window imagery
833     } else if ( arg.find( "--view-offset=" ) == 0 ) {
834         string woffset = arg.substr( 14 );
835         double default_view_offset = 0.0;
836         if ( woffset == "LEFT" ) {
837                default_view_offset = SGD_PI * 0.25;
838         } else if ( woffset == "RIGHT" ) {
839             default_view_offset = SGD_PI * 1.75;
840         } else if ( woffset == "CENTER" ) {
841             default_view_offset = 0.00;
842         } else {
843             default_view_offset = atof( woffset.c_str() ) * SGD_DEGREES_TO_RADIANS;
844         }
845         FGViewerRPH *pilot_view =
846             (FGViewerRPH *)globals->get_viewmgr()->get_view( 0 );
847         pilot_view->set_view_offset( default_view_offset );
848         pilot_view->set_goal_view_offset( default_view_offset );
849         fgSetDouble("/sim/view/offset-deg", default_view_offset);
850     // $$$ end - added VS Renganathan, 14 Oct 2K
851     } else if ( arg.find( "--visibility=" ) == 0 ) {
852         fgSetDouble("/environment/visibility-m", atof(arg.substr(13)));
853     } else if ( arg.find( "--visibility-miles=" ) == 0 ) {
854         double visibility = atof(arg.substr(19)) * 5280.0 * SG_FEET_TO_METER;
855         fgSetDouble("/environment/visibility-m", visibility);
856     } else if ( arg.find( "--wind=" ) == 0 ) {
857         string val = arg.substr(7);
858         unsigned int pos = val.find('@');
859         if ( pos == string::npos ) {
860           SG_LOG( SG_GENERAL, SG_ALERT, "bad wind value " << val );
861           return FG_OPTIONS_ERROR;
862         }
863         double dir = atof(val.substr(0,pos).c_str());
864         double speed = atof(val.substr(pos+1).c_str());
865         SG_LOG(SG_GENERAL, SG_INFO, "WIND: " << dir << '@' << 
866                speed << " knots" << endl);
867                                 // convert to fps
868         speed *= SG_NM_TO_METER * SG_METER_TO_FEET * (1.0/3600);
869         dir += 180;
870         if (dir >= 360)
871           dir -= 360;
872         dir *= SGD_DEGREES_TO_RADIANS;
873         fgSetDouble("/environment/wind-north-fps",
874                                              speed * cos(dir));
875         fgSetDouble("/environment/wind-east-fps",
876                                              speed * sin(dir));
877     } else if ( arg.find( "--wp=" ) == 0 ) {
878         parse_wp( arg.substr( 5 ) );
879     } else if ( arg.find( "--flight-plan=") == 0) {
880         parse_flightplan ( arg.substr (14) );
881     } else if ( arg.find( "--config=" ) == 0 ) {
882         string file = arg.substr(9);
883         try {
884           readProperties(file, globals->get_props());
885         } catch (const sg_io_exception &e) {
886           string message = "Error loading config file: ";
887           message += e.getMessage();
888           message += "\n at ";
889           message += e.getLocation().asString();
890           SG_LOG(SG_INPUT, SG_ALERT, message);
891           exit(2);
892         }
893     } else {
894         SG_LOG( SG_GENERAL, SG_ALERT, "Unknown option '" << arg << "'" );
895         return FG_OPTIONS_ERROR;
896     }
897     
898     return FG_OPTIONS_OK;
899 }
900
901
902 // Scan the command line options for an fg_root definition and set
903 // just that.
904 string
905 fgScanForRoot (int argc, char **argv) 
906 {
907     int i = 1;
908
909     SG_LOG(SG_GENERAL, SG_INFO, "Scanning for root: command line");
910
911     while ( i < argc ) {
912         SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
913
914         string arg = argv[i];
915         if ( arg.find( "--fg-root=" ) == 0 ) {
916             return arg.substr( 10 );
917         }
918
919         i++;
920     }
921
922     return "";
923 }
924
925
926 // Scan the config file for an fg_root definition and set just that.
927 string
928 fgScanForRoot (const string& path)
929 {
930     sg_gzifstream in( path );
931     if ( !in.is_open() )
932       return "";
933
934     SG_LOG( SG_GENERAL, SG_INFO, "Scanning for root: " << path );
935
936     in >> skipcomment;
937 #ifndef __MWERKS__
938     while ( ! in.eof() ) {
939 #else
940     char c = '\0';
941     while ( in.get(c) && c != '\0' ) {
942         in.putback(c);
943 #endif
944         string line;
945
946 #if defined( macintosh )
947         getline( in, line, '\r' );
948 #else
949         getline( in, line, '\n' );
950 #endif
951
952         // catch extraneous (DOS) line ending character
953         if ( line[line.length() - 1] < 32 ) {
954             line = line.substr( 0, line.length()-1 );
955         }
956
957         if ( line.find( "--fg-root=" ) == 0 ) {
958             return line.substr( 10 );
959         }
960
961         in >> skipcomment;
962     }
963
964     return "";
965 }
966
967
968 // Parse the command line options
969 void
970 fgParseOptions (int argc, char **argv) {
971     int i = 1;
972     int result;
973
974     SG_LOG(SG_GENERAL, SG_INFO, "Processing command line arguments");
975
976     while ( i < argc ) {
977         SG_LOG( SG_GENERAL, SG_DEBUG, "argv[" << i << "] = " << argv[i] );
978
979         result = parse_option(argv[i]);
980         if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
981             fgUsage();
982             exit(-1);
983         }
984
985         i++;
986     }
987 }
988
989
990 // Parse config file options
991 void
992 fgParseOptions (const string& path) {
993     sg_gzifstream in( path );
994     if ( !in.is_open() ) {
995         return;
996     }
997
998     SG_LOG( SG_GENERAL, SG_INFO, "Processing config file: " << path );
999
1000     in >> skipcomment;
1001 #ifndef __MWERKS__
1002     while ( ! in.eof() ) {
1003 #else
1004     char c = '\0';
1005     while ( in.get(c) && c != '\0' ) {
1006         in.putback(c);
1007 #endif
1008         string line;
1009
1010 #if defined( macintosh )
1011         getline( in, line, '\r' );
1012 #else
1013         getline( in, line, '\n' );
1014 #endif
1015
1016         // catch extraneous (DOS) line ending character
1017         if ( line[line.length() - 1] < 32 ) {
1018             line = line.substr( 0, line.length()-1 );
1019         }
1020
1021         if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
1022             SG_LOG( SG_GENERAL, SG_ALERT, 
1023                     "Config file parse error: " << path << " '" 
1024                     << line << "'" );
1025             fgUsage();
1026             exit(-1);
1027         }
1028         in >> skipcomment;
1029     }
1030 }
1031
1032
1033 // Print usage message
1034 void 
1035 fgUsage ()
1036 {
1037     cout << "Usage: fgfs [ options ... ]" << endl;
1038     cout << endl;
1039
1040     cout << "General Options:" << endl;
1041     cout << "\t--help -h:  print usage" << endl;
1042     cout << "\t--fg-root=path:  specify the root path for all the data files"
1043          << endl;
1044     cout << "\t--fg-scenery=path:  specify the base path for all the scenery"
1045          << " data." << endl
1046          << "\t\tdefaults to $FG_ROOT/Scenery" << endl;
1047     cout << "\t--disable-game-mode:  disable full-screen game mode" << endl;
1048     cout << "\t--enable-game-mode:  enable full-screen game mode" << endl;
1049     cout << "\t--disable-splash-screen:  disable splash screen" << endl;
1050     cout << "\t--enable-splash-screen:  enable splash screen" << endl;
1051     cout << "\t--disable-intro-music:  disable introduction music" << endl;
1052     cout << "\t--enable-intro-music:  enable introduction music" << endl;
1053     cout << "\t--disable-mouse-pointer:  disable extra mouse pointer" << endl;
1054     cout << "\t--enable-mouse-pointer:  enable extra mouse pointer (i.e. for"
1055          << endl;
1056     cout << "\t\tfull screen voodoo/voodoo-II based cards.)" << endl;
1057     cout << "\t--disable-freeze:  start out in an running state" << endl;
1058     cout << "\t--enable-freeze:  start out in a frozen state" << endl;
1059     cout << "\t--control=mode:  primary control mode " 
1060          << "(joystick, keyboard, mouse)" << endl;
1061     cout << "\t--enable-auto-coordination:  enable auto coordination" << endl;
1062     cout << "\t--disable-auto-coordination:  disable auto coordination" << endl;
1063     cout << "\t--browser-app=/path/to/app:  specify location of your web browser" << endl;
1064     cout << "\t--prop:name=value:  set property <name> to <value>" << endl;
1065     cout << "\t--config=path:  load additional properties from path" << endl;
1066     cout << endl;
1067
1068     cout << "Features:" << endl;
1069     cout << "\t--disable-hud:  disable heads up display" << endl;
1070     cout << "\t--enable-hud:  enable heads up display" << endl;
1071     cout << "\t--disable-panel:  disable instrument panel" << endl;
1072     cout << "\t--enable-panel:  enable instrumetn panel" << endl;
1073     cout << "\t--disable-sound:  disable sound effects" << endl;
1074     cout << "\t--enable-sound:  enable sound effects" << endl;
1075     cout << "\t--disable-anti-alias-hud:  disable anti aliased hud" << endl;
1076     cout << "\t--enable-anti-alias-hud:  enable anti aliased hud" << endl;
1077     cout << endl;
1078  
1079     cout << "Flight Model:" << endl;
1080     cout << "\t--fdm=abcd:  selects the core flight model code." << endl;
1081     cout << "\t\tcan be one of jsb, larcsim, magic, external, balloon, or ada"
1082          << endl;
1083     cout << "\t--aircraft=abcd:  aircraft model to load" << endl;
1084     cout << "\t--model-hz=n:  run the FDM this rate (iterations per second)" 
1085          << endl;
1086     cout << "\t--speed=n:  run the FDM this much faster than real time" << endl;
1087     cout << "\t--notrim:  Do NOT attempt to trim the model when initializing JSBsim" << endl;
1088     cout << "\t--on-ground:  Start up at ground level (default)" << endl;
1089     cout << "\t--in-air:  Start up in air (implied by specifying an initial"
1090          << " altitude above ground level." << endl;
1091     cout << "\t--wind=DIR@SPEED: specify wind coming from DIR (degrees) at SPEED (knots)" << endl;
1092     cout << endl;
1093
1094     //(UIUC)
1095     cout <<"Aircraft model directory:" << endl;
1096     cout <<"\t--aircraft-dir=<path> path is relative to the path of the executable" << endl;
1097     cout << endl;
1098
1099     cout << "Initial Position and Orientation:" << endl;
1100     cout << "\t--airport-id=ABCD:  specify starting postion by airport id" 
1101          << endl;
1102     cout << "\t--offset-distance:  specify distance to threshhold"
1103          << " (NM)" << endl; 
1104     cout << "\t--offset-azimuth:  specify heading to threshhold (deg) " 
1105          << endl;    
1106     cout << "\t--lon=degrees:  starting longitude in degrees (west = -)" 
1107          << endl;
1108     cout << "\t--lat=degrees:  starting latitude in degrees (south = -)"
1109          << endl;
1110     cout << "\t--altitude=feet:  starting altitude in feet" << endl;
1111     cout << "\t\t(unless --units-meters specified" << endl;
1112     cout << "\t--heading=degrees:  heading (yaw) angle in degress (Psi)"
1113          << endl;
1114     cout << "\t--roll=degrees:  roll angle in degrees (Phi)" << endl;
1115     cout << "\t--pitch=degrees:  pitch angle in degrees (Theta)" << endl;
1116     cout << "\t--uBody=feet per second:  velocity along the body X axis"
1117          << endl;
1118     cout << "\t--vBody=feet per second:  velocity along the body Y axis"
1119          << endl;
1120     cout << "\t--wBody=feet per second:  velocity along the body Z axis"
1121          << endl;
1122     cout << "\t\t(unless --units-meters specified" << endl;
1123     cout << "\t--vc= initial airspeed in knots (--fdm=jsb only)" << endl;
1124     cout << "\t--mach= initial mach number (--fdm=jsb only)" << endl;
1125     cout << endl;
1126
1127     cout << "Rendering Options:" << endl;
1128     cout << "\t--fog-disable:  disable fog/haze" << endl;
1129     cout << "\t--fog-fastest:  enable fastest fog/haze" << endl;
1130     cout << "\t--fog-nicest:  enable nicest fog/haze" << endl;
1131     cout << "\t--enable-clouds:  enable demo cloud layer" << endl;
1132     cout << "\t--disable-clouds:  disable demo cloud layer" << endl;
1133     cout << "\t--clouds-asl=xxx:  specify altitude of cloud layer above sea level" << endl;
1134     cout << "\t--fov=xx.x:  specify initial field of view angle in degrees"
1135          << endl;
1136     cout << "\t--disable-fullscreen:  disable fullscreen mode" << endl;
1137     cout << "\t--enable-fullscreen:  enable fullscreen mode" << endl;
1138     cout << "\t--shading-flat:  enable flat shading" << endl;
1139     cout << "\t--shading-smooth:  enable smooth shading" << endl;
1140     cout << "\t--disable-skyblend:  disable sky blending" << endl;
1141     cout << "\t--enable-skyblend:  enable sky blending" << endl;
1142     cout << "\t--disable-textures:  disable textures" << endl;
1143     cout << "\t--enable-textures:  enable textures" << endl;
1144     cout << "\t--disable-wireframe:  disable wireframe drawing mode" << endl;
1145     cout << "\t--enable-wireframe:  enable wireframe drawing mode" << endl;
1146     cout << "\t--geometry=WWWxHHH:  window geometry: 640x480, 800x600, etc."
1147          << endl;
1148     cout << "\t--view-offset=xxx:  set the default forward view direction"
1149          << endl;
1150     cout << "\t\tas an offset from straight ahead.  Allowable values are"
1151          << endl;
1152     cout << "\t\tLEFT, RIGHT, CENTER, or a specific number of degrees" << endl;
1153     cout << "\t--visibility=xxx:  specify initial visibility in meters" << endl;
1154     cout << "\t--visibility-miles=xxx:  specify initial visibility in miles"
1155          << endl;
1156     cout << endl;
1157
1158     cout << "Scenery Options:" << endl;
1159     cout << "\t--tile-radius=n:  specify tile radius, must be 1 - 4" << endl;
1160     cout << endl;
1161
1162     cout << "Hud Options:" << endl;
1163     cout << "\t--units-feet:  Hud displays units in feet" << endl;
1164     cout << "\t--units-meters:  Hud displays units in meters" << endl;
1165     cout << "\t--hud-tris:  Hud displays number of triangles rendered" << endl;
1166     cout << "\t--hud-culled:  Hud displays percentage of triangles culled"
1167          << endl;
1168     cout << endl;
1169         
1170     cout << "Time Options:" << endl;
1171     cout << "\t--time-offset=[+-]hh:mm:ss: add this time offset" << endl;
1172     cout << "\t--time-match-real: Synchronize real-world and FlightGear" << endl
1173          << "\t\ttime. Can be used in combination with --time-offset." << endl;
1174     cout << "\t--time-match-local:Synchronize local real-world and " << endl
1175          << "\t\tFlightGear time" << endl;   
1176     cout << "\t--start-date-sys=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1177          << "\t\tdate/time. Uses your system time " << endl;
1178     cout << "\t--start-date-gmt=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1179          << "\t\tdate/time. Uses Greenwich Mean Time" << endl;
1180     cout << "\t--start-date-lat=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1181          << "\t\tdate/time. Uses Local Aircraft Time" << endl;
1182 #ifdef FG_NETWORK_OLK
1183     cout << endl;
1184
1185     cout << "Network Options:" << endl;
1186     cout << "\t--enable-network-olk:  enable Multipilot mode" << endl;
1187     cout << "\t--disable-network-olk:  disable Multipilot mode (default)" << endl;
1188     cout << "\t--net-hud:  Hud displays network info" << endl;
1189     cout << "\t--net-id=name:  specify your own callsign" << endl;
1190 #endif
1191
1192     cout << endl;
1193     cout << "Route/Way Point Options:" << endl;
1194     cout << "\t--wp=ID[@alt]:  specify a waypoint for the GC autopilot" << endl;
1195     cout << "\t\tYou can specify multiple waypoints (a route) with multiple"
1196          << endl;
1197     cout << "\t\tinstances of --wp=" << endl;
1198     cout << "\t--flight-plan=[file]: Read all waypoints from [file]" <<endl;
1199 }