using std::cerr;
using std::vector;
-// Specify our current idle function state. This is used to run all
-// our initializations out of the idle callback so that we can get a
-// splash screen up and running right away.
-int idle_state = 0;
-
// The atexit() function handler should know when the graphical subsystem
// is initialized.
extern int _bootstrap_OSInit;
// compute simulated time (allowing for pause, warp, etc) and
// real elapsed time
double sim_dt, real_dt;
- TimeManager* timeMgr = (TimeManager*) globals->get_subsystem("time");
+ static TimeManager* timeMgr = (TimeManager*) globals->get_subsystem("time");
timeMgr->computeTimeDeltas(sim_dt, real_dt);
// update magvar model
// then on.
static void fgIdleFunction ( void ) {
+ // Specify our current idle function state. This is used to run all
+ // our initializations out of the idle callback so that we can get a
+ // splash screen up and running right away.
+ static int idle_state = 0;
+
static osg::ref_ptr<GeneralInitOperation> genOp;
if ( idle_state == 0 ) {
idle_state++;
fgSplashProgress("initializing scenery system");
} else if ( idle_state == 4 ) {
- idle_state++;
+ idle_state+=2;
// based on the requested presets, calculate the true starting
// lon, lat
fgInitPosition();
fgSplashProgress("loading aircraft");
- } else if ( idle_state == 5 ) {
- idle_state++;
-
- fgSplashProgress("initializing sky elements");
-
} else if ( idle_state == 6 ) {
idle_state++;
SGMagVar *magvar = new SGMagVar();
globals->set_mag( magvar );
-
// kludge to initialize mag compass
- // (should only be done for in-flight
- // startup)
+ // (should only be done for in-flight startup)
// update magvar model
globals->get_mag()->update( fgGetDouble("/position/longitude-deg")
* SGD_DEGREES_TO_RADIANS,
+// main.hxx -- top level sim routines
+//
+// Written by Curtis Olson, started May 1997.
+//
+// Copyright (C) 1997 - 2002 Curtis L. Olson - http://www.flightgear.org/~curt
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __FG_MAIN_HXX
#define __FG_MAIN_HXX 1
-void fgUpdateTimeDepCalcs();
-
int fgMainInit( int argc, char **argv );
-
-extern int idle_state;
-
extern std::string homedir;
extern std::string hostname;