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.
Thomas Geymayer [Tue, 15 Oct 2013 10:05:09 +0000 (12:05 +0200)]
Nasal: recursive method calling.
New functions naCallMethodCtx and naCallMethod to replace
NasalSystem::callMethod from FlightGear. This has just added an
unneeded level of indirection and fits better directly into Nasal.
naSetErrorHandler can be used to register an error handler/logging
function.
Thomas Geymayer [Mon, 14 Oct 2013 22:19:32 +0000 (00:19 +0200)]
Nasal: add naGCSave/naGCRelease for preventing objects being garbage collected.
These new functions are meant to replace the gcSave/gcRelease
methods of the NasalSystem class in FlightGear, as passing an
adapter to SimGear from FlightGear is quite a lot of useless work
just for being able to save objects.
James Turner [Sat, 5 Oct 2013 22:26:35 +0000 (23:26 +0100)]
Refactor HTTP content-encoding support.
Move content-encoding handler into its own file, which
simplifies the main code. As part of this, fix a bug where we
didn't flush the ZLIB buffers on response completion.
James Turner [Thu, 3 Oct 2013 16:40:17 +0000 (17:40 +0100)]
Extend built-in Nasal math.
- rename mod() to fmod() to prevent collisions with the
version in math.nas (which has different handling of negatives)
- implement pow, tan, acos and asin natively
- add round(x, [p]), which rounds away from 0.0, and takes an
option precision. I.e you can round(479, 50) and get '500'; useful
in many digital cockpit displays.
James Turner [Mon, 30 Sep 2013 11:11:29 +0000 (12:11 +0100)]
Expose active tiles via API, sync by SGBucket.
Provide an API to query which tiles are currently being synced. This
allows the higher levels (TileManager in FlightGear) to safely wait on
TerraSync before loading tiles.
Doing this exposed some bugs in scheduling tiles to sync by integer
lat/lon, related to round-towards-zero with -ve values (western /
souther hemispheres). To resolve these, and also reduce spurious
syncs, switch to an explicit API for requesting tiles by SGBucket.
This keeps TerraSync fully aligned with the TileManager queue, which
has many benefits for both high and low visibility situations.
James Turner [Sat, 28 Sep 2013 13:03:39 +0000 (14:03 +0100)]
HTTP: adjust request-connection assignment.
Prefer existing, idle connections to creating new connections,
even when below the max-connection limit. Gives much better re-use
and pipeline-ing, and hence reduced setup time/trips.
James Turner [Fri, 27 Sep 2013 19:28:43 +0000 (20:28 +0100)]
Reposition hook for terrasync.
When re-init-ing the sim, tell TerraSync what's going on (we don't want
to actually reset it, since that would disturb in-flight downloads).
Add an explicit method so it can reset its last lon/lat, and hence do
the initial sync at the new location correctly.
James Turner [Thu, 26 Sep 2013 11:11:48 +0000 (12:11 +0100)]
Allow TerraSync to be inited early.
Add explicit subsystem state tracking so we can safely init()
terrasync very early during startup, and hence overlap lengthy operations
(Shared Models sync and initial NavCache build)
James Turner [Wed, 25 Sep 2013 15:31:10 +0000 (16:31 +0100)]
Parallel sync of items.
When using built-in sync code, separate items into distinct slots.
Slots process items sequentially, but each slot works in parallel (using
a single shared HTTP engine). This allows tiles to be synced in parallel
with airports/shared models data, greatly increasing responsiveness
to get tiles synced on initial launch.
James Turner [Mon, 23 Sep 2013 17:20:16 +0000 (18:20 +0100)]
Rename WaitingTile to WaitingSyncItem.
We already synchronise other things besides tiles, and will soon want different
behaviour based on the type of item we're syncing (so we can synchronize some items in parallel). Rename the struct to be clearer, and add an enum encoding the type of item for future use.