RE: [Flightgear-devel] how to determine when flightgear hasfullyinitialized
From main.cxx: if ( idle_state == 1000 ) { // We've finished all our initialization steps, from now on we // run the main loop. fgRegisterIdleHandler(fgMainLoop); idle_state appears to be declared globally, so you should be able to test straight for that: bool checkinit() { if (idle_state == 1000) {return true;} else {return false;} } Though it would make a lot more sense to add a value to the property tree in the code snippet above so that you could use fgGetBool() on it. Giles Robertson -Original Message- From: Seamus Thomas Carroll [mailto:[EMAIL PROTECTED] Sent: 05 May 2004 06:15 To: [EMAIL PROTECTED] Subject: [Flightgear-devel] how to determine when flightgear hasfullyinitialized Hi, Is there a simple way to test in the code to see if flightgear has initialized such as a boolean? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] how to determine when flightgear hasfullyinitialized
Then just add this: fgsetbool(sim/initialised,true); at line 1436 of main.cxx so the function reads like this: if ( idle_state == 1000 ) { // We've finished all our initialization steps, from now on we // run the main loop. fgsetbool(sim/initialised,true); fgRegisterIdleHandler(fgMainLoop); } else { if ( fgGetBool(/sim/startup/splash-screen) ) { fgSplashUpdate(0.0, 1.0); } } I suppose I ought to have done a diff on this, but it seems so trivial. Giles Robertson -Original Message- From: Erik Hofman [mailto:[EMAIL PROTECTED] Sent: 05 May 2004 08:05 To: FlightGear developers discussions Subject: Re: [Flightgear-devel] how to determine when flightgear hasfullyinitialized Seamus Thomas Carroll wrote: Hi, Is there a simple way to test in the code to see if flightgear has initialized such as a boolean? Not that I know of, but it would be nice to have one. That would allow the sound (for example) to be quiet until the startup is completed. Erik ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] how to determine when flightgear hasfullyinitialized
Giles Robertson wrote: Then just add this: fgsetbool(sim/initialised,true); at line 1436 of main.cxx so the function reads like this: if ( idle_state == 1000 ) { // We've finished all our initialization steps, from now on we // run the main loop. fgsetbool(sim/initialised,true); That's not all, because it should work for a reset also. I've put an update in CVS. /sim/initialised should now indicate when we're ready to go. Erik ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] how to determine when flightgear hasfullyinitialized
Giles Robertson wrote: From main.cxx: if ( idle_state == 1000 ) { // We've finished all our initialization steps, from now on we // run the main loop. fgRegisterIdleHandler(fgMainLoop); idle_state appears to be declared globally, so you should be able to test straight for that: That's not sufficient, though. At this point, the FDM initialization still hasn't occurred; it needs to wait for the tile under the aircraft to load first, which can still be a few more seconds. The problem is deep, unfortunately. There just isn't a single boolean you can check to see if the sim is finished initializing; different subsystems come up at different times. This is especially true with some of the Nasal code, which has to set timers to wait until the initialization is (probably) finished. Andy ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel