https://gitorious.org/fg/flightgear/merge_requests/1586
These are a few patches to prepare support for initializing Nasal earlier, and for providing support for
alternate/subset startup modes, e.g. a FGCanvas mode or a headless mode. We can now also display the Aircraft Center right after starting.
Mainly, these patches will: - move FGNasalSys out of the global SubsystemMgr into the FGGlobals class, along with getters - update fgMainLoop() to explicitly call the Nasal::update() method there - fix up all globals->get_subsystem("nasal") lookups to use globals->get_nasal() instead - move initialization of subsystem-specific APIs into each subsystem's bind() method - the interpreter is now instantiated at the beginning of the init routine - currently, it's right after fgcommands are added, as those are likely to be needed anyway - reset/re-init handling is augmented to directly access the instance or allocate a new one
For testing purposes, there some CLI flags added, these will probably disappear once $FG_ROOT/Nasal is fixed up:
--enable-scripted-init - passes control to a configurable boot script in $FG_ROOT/Boot --mode=filename - allows the boot file to be specified, defaults to default.boot
--enable-early-nasal-init - initializes Nasal earlier, to see which scripts still need to be fixed
We're hoping to re-implement bootstrapping in Nasal space using Philosopher's code, which would then be moved into $FG_ROOT/Boot/default.boot - once that works, we'll still have to fix up $FG_ROOT/Nasal to make subsystem dependencies more explicit there.
Once that is the case, the two --enable-... options can go, and we can easily implement additional startup modes by adding other *.boot files
Hopefully, this will also allow us to more easily do regression testing in an automated fashion-for example by adding a new "unit-test" startup mode that will run certain APIs to do a self-check.
Likewise, we could also use this to do headless benchmarking/profiling and debugging, possibly even right on the build server (minus all the visuals obviously).
Future changes will be mainly about:
- moving fgCreateSubsystems() into scripting space - extending the subsystemFactory accordingly - extending fgIdleFunction() to allow some of it to be scripted (e.g. splash screens)
Additional info at: http://wiki.flightgear.org/Initializing_Nasal_early