James Turner [Wed, 15 Jan 2014 21:56:16 +0000 (21:56 +0000)]
Support a 'clear' operation on SGBinding.
Needed to bug-fix a problem with the menubar on Mac - post-3.0 I will
change the behaviour of SGBinding's destructor to avoid the property
copies in other use-cases.
Thomas Geymayer [Mon, 6 Jan 2014 11:10:39 +0000 (12:10 +0100)]
Socket: do not crash on writing to broken pipe.
Writing to a closed socket on all Unix/Linux systems raises
a SIGPIPE signal which immediately closes the program. Disabling
raising of SIGPIPE allows proper error handling by checking the
return values of send/sendto and getting the EPIPE in errno.
James Turner [Mon, 6 Jan 2014 08:26:42 +0000 (08:26 +0000)]
Crash fix: use cache to find materials.
Add a thread-safe cache of the currently valid materials, to avoid
the osgDB thread making repeated SGCondition evaluations in conflict
with the main thread.
James Turner [Fri, 3 Jan 2014 19:51:58 +0000 (19:51 +0000)]
Bugs 1207, 1301
Only apply the fix for time-zone offsetting on Windows, since Unix
is handling mktime differently. (Arguably we should also apply a
conversion for Unix systems, but the previous logic worked)
James Turner [Thu, 19 Dec 2013 17:20:06 +0000 (17:20 +0000)]
Bugfix: remove SGSky minimum distance check.
Without this, various sky rendering modes exhibit artefacts in low-
visibility conditions. The cost of always rendering the dome is
negligible. (And Rembrandt already had to work this way)
Rebecca Palmer [Tue, 17 Dec 2013 17:40:33 +0000 (17:40 +0000)]
Fix buffer overflow CVE-2012-2091 (thanks to Saikrishna Arcot)
https://bugs.launchpad.net/ubuntu/+source/simgear/+bug/1077624
(discussed in comments 65-78)
(This is already fixed in 2.12 but appears to have been forgotten in 2.99;
the other vulnerabilities described there are already fixed.)
James Turner [Tue, 10 Dec 2013 17:37:37 +0000 (17:37 +0000)]
Reset: alternate property copying strategy.
Search the tree for leaves / sub-trees with a particular attribute set.
This permits both sparse selection as well as selection by sub-tree.
(This is needed for PRESERVE attribute, and once new reset is switched
on, will enable 'normal' copyProperties to revert to ignoring
attributes completely)
James Turner [Fri, 6 Dec 2013 18:14:48 +0000 (18:14 +0000)]
Canvas: clear elements in shutdown()
- without this change, elements aren't un-ref-ed and hence destroyed
until the actual dtor runs, which is too late (other systems may be
destroyed already)
Thomas Geymayer [Sun, 1 Dec 2013 00:18:13 +0000 (01:18 +0100)]
cppbind: make ghost_type static to keep same pointer on reset.
Using a static naGhostType ensures that always the same
address is used for the same ghost and prevents ghost_types
from getting invalid (eg. on reset).
bcoconni [Sun, 24 Nov 2013 11:20:26 +0000 (12:20 +0100)]
Added more explicit error messages to the property lists parser.
More specifically, each time an error or a warning is issued the location of the corresponding XML tag (file name an line number) is reported.
bcoconni [Mon, 11 Nov 2013 18:06:44 +0000 (19:06 +0100)]
Removed the 'using::std' instructions from the headers as per James Turner request.
Also took this opportunity to add a check in XMLVisitor::savePosition() against a null pointer.
James Turner [Tue, 5 Nov 2013 05:17:22 +0000 (05:17 +0000)]
Reset: use ref-counting to own subsystems.
Change the subsystem-group and manager code to use shared-ptr references
to subsystems, instead of holding a raw pointer. Hence the manager becomes
the owning ref to most subsystems.
Thomas Geymayer [Thu, 7 Nov 2013 23:45:24 +0000 (00:45 +0100)]
track-to animation: 2dof rotation for slave object.
Slave objects can now rotate around two axis to always track the
target - even when it is outside the plane perpendicular to the
lock-axis of the root object. This allows for example animating
levers with non-parallel axis of rotation connected with a rod.
James Turner [Wed, 6 Nov 2013 23:11:46 +0000 (15:11 -0800)]
Tweak HTTP code to always sleep.
Check explicitly for the 'no channels' case and
sleep instead, to avoid busy-waiting. (This is a work-
around, the underlying issue still be be traced)
Thomas Geymayer [Sun, 3 Nov 2013 19:12:45 +0000 (20:12 +0100)]
Canvas: improved clipping and new property clip-frame.
- Update clipping rect if canvas view or texture size
changes.
- Add new property "clip-frame" to specify coordinate
frame for "clip" coordinates. Coordinates can be
global, relative to the parent or relative to the
element itself.
Thomas Geymayer [Sun, 27 Oct 2013 17:40:14 +0000 (18:40 +0100)]
io: refactor and improve HTTP modules.
- refactor code used multiple times spread over sg/fg into
one single location.
- allow aborting requests.
- Provide two common request types:
* FileRequest: Save response into file
* MemoryRequest: Keep resonse in memory (std::string)
- extend HTTP::Client interface:
* urlretrieve: Save url to file (shortcut for making a
FileRequest)
* urlload: Get respons into memory (shortcut for making
a MemoryRequest)
James Turner [Sat, 26 Oct 2013 20:03:00 +0000 (21:03 +0100)]
Fix handling of SGPath::rename
Windows handling of ::rename differs from POSIX when the new name
exists. Check for this case on Windows and remove the file manually.
(This allows a work-around in SVNDirectory to be removed)
James Turner [Mon, 21 Oct 2013 23:42:31 +0000 (00:42 +0100)]
Fix GPS activation on Windows.
Bug 1190, fix route-manager -> GPS activation on Windows
(and probably a couple of unrelated issues).
SGPropertyChangeCallback was missing a suitable copy-constructor,
leading to incorrect behaviour on compilers where the operation
is not elided. Such as MSVC.
James Turner [Mon, 21 Oct 2013 22:51:19 +0000 (23:51 +0100)]
Fix Dir warnings on Windows.
Test result of GetLastError so we don't log a warning in the
'nothing matched' case. Makes early startup logging much
more pleasant, especially when scanning aircraft dirs.
James Turner [Thu, 17 Oct 2013 19:13:36 +0000 (20:13 +0100)]
Avoid a divide-by-zero on malformed BTG files.
Encountered while testing v850 airports; some airports
generate materials with no tris, and hence no indices.
This causes a divide-by-zero when computing the index stride.
Detect this, and convert the BTG reader to throw exceptions
in error conditions, and to catch this and report the
appropriate result code.
James Turner [Thu, 3 Oct 2013 20:42:18 +0000 (21:42 +0100)]
Initial work on syncing non-scenery data.
This is some initial pieces to synchronise other pieces of base
data than scenery via the sync mechanism. An additional sync slot is
added to avoid scenery or other data blocking each other.