Board index FlightGear Development Canvas

Use Nasal to Randomize Splash Screens

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Re: Use Nasal to Randomize Splash Screens

Postby Hooray » Sat Jul 12, 2014 6:30 am

Agreed, I just had a look at the code ($FG_SRC/Viewer/splash.cxx) - it seems fairly straightforward to re-implement the existing functionality using ~50-80 lines of Nasal/Canvas code.

Currently, that's simply not a priority though - so you may still want to file a feature request (issue tracker) so that we don't forget about this.
Obviously, the existing feature works "well enough", and touching working code isn't exactly popular :D

Technically, it would even be a good thing to pursue - the splash screen code is not exactly compact and it handles several corner cases already.
So this could be greatly simplified by supporting Nasal & Canvas. So I may revisit this depending on progress in the FGCanvas/Nasal-initialization department, and spare time obviously.

But for the time being, I'd like to provide hooks to make most FG subsystems optional and configurable/selectable via "boot" scripts.

That is something that will help us significantly with regression testing, including debugging & profiling, but also troubleshooting on the forum, because we can actually disable things entirely and ask people if a certain problem still persists. And we'll have a straightforward way to tell just how wasteful certain subsystems really are when it comes to CPU/RAM.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11966
Joined: Tue Mar 25, 2008 8:40 am

Re: Use Nasal to Randomize Splash Screens

Postby Hooray » Sat Jul 12, 2014 6:24 pm

ok, I just checked it again - it's actually trivial, we don't even have to touch the viewer/splash screen code at all: there's an existing option to disable the whole thing via --disable-splash-screen, which is currently defaulted to false - but we only need to edit options.cxx to default it to true, which will keep all the splash code disabled - so that we can directly use Nasal/Canvas to show a GUI dialog without decoration to render things, including randomly-selected splash screens. Amount of C++ changes: ~1 line - and then it's roughly 30 lines of Nasal code to come up with a scripted splash screen that will be loaded from $FG_ROOT/Boot/default.boot - and which could support the existing scheme, as well as a "random" selection scheme, but also a totally scripted Nasal/Canvas splash mode :D

Once this is in place, we can safely remove the hard-coded splash screen :!:
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11966
Joined: Tue Mar 25, 2008 8:40 am

Re: Use Nasal to Randomize Splash Screens

Postby Hooray » Sun Jun 07, 2015 5:08 pm

Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11966
Joined: Tue Mar 25, 2008 8:40 am

Previous

Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest