[Flightgear-devel] Re: [RFC] nasal initialization group in joystick xml files
* Andy Ross -- Monday 06 June 2005 18:10: Alternatively, the whole subsystem API could get a post_init() method, which is called on all subsystems after the system initialization phase but before update() is called on any of them. Maybe this is an even cleaner solution... That's now implemented and sent to Erik. (Didn't read that posting again, and had forgotten that you suggested a name for this new method. So I found one myself: postinit() :-) If Erik accepts the (quite trivial) patch, I'll commit the rest myself, along with some other changes to the input/joystick system. m. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Re: [RFC] nasal initialization group in joystick xml files
* Andy Ross -- Monday 06 June 2005 16:41: Melchior FRANZ wrote: I'd like to suggest to add the possibility to add a nasal init block to joystick *.xml files: This sounds fine to me. Ok ... I think it might be cleaner, though, for the Nasal subsystem to provide for a callback or init script that can be set by a caller. I'm not sure I understand. To request a callback I have to have Nasal working already. Do you mean that Nasal would get initialized sooner (first?), and everyone who needs the property system set up had to register a callback function that would be called as soon as the other subsystems are done? BTW: we could use other callbacks, too: on re-init, and exit. Playing with the subsystem initialization order every time we want to nasalize some part of startup seems like it might get messy. True. I didn't like to have to re-order that. That's why I asked here. I want the joystick nasal thing, but I don't need it *now*. So, if you have something in the pipe, I can well wait. m. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Re: [RFC] nasal initialization group in joystick xml files
Melchior FRANZ wrote: Andy Ross wrote: I think it might be cleaner, though, for the Nasal subsystem to provide for a callback or init script that can be set by a caller. I'm not sure I understand. To request a callback I have to have Nasal working already. Yeah, that wasn't clear. I mean a C++ side callback. The interested subsystem could register itself with the NasalSys, and registered subsystems would get an nasal_init() callback after the Nasal subsystem was initialized. They could then be guaranteed a safe environment to execute their scripts. Alternatively, the whole subsystem API could get a post_init() method, which is called on all subsystems after the system initialization phase but before update() is called on any of them. Maybe this is an even cleaner solution... Andy ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Re: [RFC] nasal initialization group in joystick xml files
* Melchior FRANZ -- Sunday 05 June 2005 15:44: +globals-add_subsystem(input, new FGInput); +SGSubsystem *input = globals-get_subsystem(input); Of course, you'd make that SGSubsystem *input = new FGInput; globals-add_subsystem(input, input); ... to save a few cycles. :-) m. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d