mfranz [Sat, 28 Jan 2006 10:40:47 +0000 (10:40 +0000)]
write to /sim/startup/xsize only if the size really changed; likewise for
ysize. This is useful for listeners, e.g. the one that will re-position the
FPS dialog.
mfranz [Sat, 28 Jan 2006 00:10:39 +0000 (00:10 +0000)]
Resizing is done when fg_os{,_sdl}.cxx says so, not in every single frame.
(This defeats the purpose of the resize callback and makes "listening" to
the xsize useless.)
ehofman [Tue, 24 Jan 2006 14:45:13 +0000 (14:45 +0000)]
Mathias Fröhlich:
Incorporating the shared ptr code:
- All scenegraph references from SimGear
- SGMaterial which already had a reference counter uses now that common
infrastructure.
- SGMatModel is now counted.
- SGSoundSample from SimGear
- And the corresponding change for the sound samples in flightgear which fixes
a latent crash if FGBeacon would evern be deleted.
ehofman [Sat, 21 Jan 2006 10:06:09 +0000 (10:06 +0000)]
Jim Wilson:
This patch fixes configure.ac so that when an alternate prefix location for simgear is specified, configure tests for the header file jpegfactory.hxx in that specific location only.
ehofman [Fri, 20 Jan 2006 17:19:01 +0000 (17:19 +0000)]
Integrate a large part of John Wojnaroski's 747 cockpit project.
Erik Hofman:
This patch contains an update to net_ctrls.hxx that adds an extra 100 bytes
(or an equivalent of 25 (u)int32_t types) of reserved space. This could be
used to make the protocol forward and backward compatibel within a certain
scope. Be sure to read the instructions at the begining of the header file
when addinf new variables.
daveluff [Fri, 13 Jan 2006 22:07:50 +0000 (22:07 +0000)]
Fix the crashes on mini-panel and panel-reload with the KLN89, by removing the multiple inheritance and using an empty shell instrument to forward draw commands from the panel to the complex gps subsystem.
curt [Mon, 9 Jan 2006 15:29:24 +0000 (15:29 +0000)]
Add an srand() function to nasal (hooked into sg_srandom_time()).
This helps avoid the problem of always getting the same random number
sequence every time you run a script.
curt [Mon, 9 Jan 2006 02:23:02 +0000 (02:23 +0000)]
Add a do_play_audio_message() function which is tied to the
"play-audio-function" command. This function can be called from internal
code, from nasal scripts, or from external scripts to play a single one-off
wav file. File/audio data is loaded and unloaded on the fly automatically.
curt [Mon, 9 Jan 2006 02:21:04 +0000 (02:21 +0000)]
Additional functionality added to the FlightGear sound fx manager.
Create a queue of one-off wav files. Calling layer can request the system
to play any wav file. The request is thrown at the end of a play queue.
The queue is serviced sequentially so that queued wav files will no longer
overlap. When a sample is finished playing. It is removed from the queue
and deleted from memory. The next remaining request in the queue is then
played.
ehofman [Fri, 6 Jan 2006 09:50:58 +0000 (09:50 +0000)]
Stuart Buchanan:
- Provide a Nasal interface to display simple text messages on the screen
like the ATC display. In fact, I copied the code from the ATCDisplay.cxx
and simply shifted it further down the screen.
curt [Mon, 2 Jan 2006 23:01:45 +0000 (23:01 +0000)]
- Add an "is-valid" property node so other modules can do a quick check if
anything in the nav tree is valid or not.
- Fix an order problem between caching data values and searching for a new
station that could cause odd and unexpected and hard to reproduce results.
curt [Wed, 28 Dec 2005 21:45:43 +0000 (21:45 +0000)]
More reorg and refactoring of the code.
Added a convenience function to estimate the time to intercept the selected
radial give the current heading and speed. This can be useful to a flight
directory to compute the point to switch from armed to coupled mode at just
the right time so the pilot can roll out onto the desired heading on the
desired radial.
Add a first whack at estimating a ground track heading error (difference
between aircraft heading and ground track directon.) This needs more work
and testing.
curt [Wed, 28 Dec 2005 16:53:19 +0000 (16:53 +0000)]
Step #1 of some code refactoring and cleanups. The nav radio code was
written very early in the project and has grown and evolved and been added
onto many times. It is long overdue for a code cleanup/reorg pass.
ehofman [Thu, 22 Dec 2005 10:25:07 +0000 (10:25 +0000)]
Put the user configuration file sequence into it's own function. This will slightly tidy up the code but more importantly will make it consistant across the program.
ehofman [Mon, 19 Dec 2005 13:03:19 +0000 (13:03 +0000)]
Olaf Flebbe:
The prototype of update_metar_properties does not match overridden func.
trafficmgr: iterators below begin() and after end().
tower.cxx : iterator incrementing beyond end().
mfranz [Fri, 16 Dec 2005 19:11:03 +0000 (19:11 +0000)]
add _setlistener() function, so that slow property polling loops can be
replaced with efficient listener callbacks. One use is the new FPS display.
This is reviewed and OK'ed by Andy, relatively trivial and separated from
the rest of Nasal, so problems are quite unlikely and confined to users of
this function.
The callback is executed whenever the property is written to -- even if
the value didn't change. The triggering Node is available via cmdarg().
mfranz [Wed, 14 Dec 2005 07:45:47 +0000 (07:45 +0000)]
don't check for subsequent indices (n), but for child positions; This way
it's also possible to enable/disable menu/item entries with higher numbers.
This can be useful for adding entries from other config files (aircraft
specific or local). I'd say aircraft files can use indices starting with
[100] and local files starting with [1000]. Such high number will never
collide with an entry in menubar.xml, even if entries are added/removed
there.
curt [Mon, 12 Dec 2005 22:22:28 +0000 (22:22 +0000)]
Mathias Fröhlich's code, Curt Olson's comments:
Display the ground intersection point on mouse click (if click not consumed
by the gui or the panel.) This should eventually get stuffed into the
property tree.
curt [Mon, 12 Dec 2005 21:15:20 +0000 (21:15 +0000)]
Mathias Fröhlich:
Computes the pick direction and starting point. This is code that translates
a screen coordinate into a vector in the FlightGear world (between the eye and
the on-screen coordinate.) Armed with this vector in FG world coordinates,
you could call a scenery intersection routine and lookup the lon/lat/elev of
the point in the world that was clicked on.
ehofman [Sun, 11 Dec 2005 13:37:06 +0000 (13:37 +0000)]
Vassilii Khachaturov:
* in some cases more specific sg exception types were used in place
of the more generic one, e.g., sg_io_exception instead of sg_exception
when the context of the error was an IO error
* in some cases, the error message was made more specific
* minor style fix for exception rethrowing --- using throw; whenever
a re-throw is made; sometimes optimizing away the exception symbol name
in the catch handler at all
* more specific catch handlers added in some places -- e.g.,
an sg_io_exception caught ahead of sg_exception
mfranz [Thu, 8 Dec 2005 15:03:08 +0000 (15:03 +0000)]
- fix typos
- fix indentation (there were 2, 3, 4, 7(!) space indents as well as tab
indents, all mixed together)
- no code changes, except one "if (foo) {}" changed to "if (!foo) return; ..."
mfranz [Tue, 6 Dec 2005 19:51:31 +0000 (19:51 +0000)]
removal of yet more stuff, left over from development; further simplification;
requires to remove some constness, though (we are adding listeners!);
If I continue like that, nothing will be left. :-)
mfranz [Tue, 6 Dec 2005 17:56:17 +0000 (17:56 +0000)]
allow disabling/enabling of menu entries via "enabled" property;
Unfortunately, we don't have an easy way to access the puObjects
only by knowing the respective XML property node, because the
menu structure was built by plib from string lists. That's why
we walk the puMenuBar tree and store {property node}->{puObject*}
pairs in a map. With this infrastructure in place we can now
easily enable/disable entries, but we can also make other changes
to menu buttons as we see need. The structure of puMenuBar is
described in the pui documentation, so it's less of a hack than
it looks. :-)