Commit Graph

3953 Commits

Author SHA1 Message Date
James Turner
95f77ef81d Ooops, fix INSTALL rule.
We need the rule, just not the export, for now.
2013-10-23 14:18:39 +01:00
James Turner
c4e7d26b70 Comment out Cmake export experiments for now.
This is breaking CMake 2.6, so commenting out for the moment, until
I understand how to support this portably.
2013-10-22 13:42:59 +01:00
James Turner
ea49a1a07b 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.
2013-10-22 00:42:31 +01:00
James Turner
784223c67f 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.
2013-10-21 23:51:19 +01:00
James Turner
77aa2c9a9d Smoother download rate from HTTP
Crude filtering (low pass) of the download rate, over a 400msec
time window.
2013-10-21 23:08:55 +01:00
James Turner
48145fb234 Fail HTTP request with missing/illegal protocols.
Instead of throwing, run the failure handler for requests with
either a missing spec or something other than http:// (eg, https
or ftp)
2013-10-20 23:20:49 +01:00
James Turner
49730cadee Placement can contain multiple nodes.
- Allow placement to have multiple children added.
- Remove legacy position setting APIs, enforce use of SGGeod
2013-10-20 20:44:42 +01:00
Thomas Geymayer
0b197501e1 Add SGPropertyNode::setValueReadOnly.
Helper to set value of relative node and mark
read only. Use eg. for exposing configuration
and build values to the property tree.
2013-10-20 12:03:41 +02:00
James Turner
8b0c246a7b 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.
2013-10-17 20:13:50 +01:00
James Turner
9c4face1ae Fix float-int conversion bug caught by Clang 2013-10-17 20:13:49 +01:00
James Turner
952e2e6631 Fix unused-var warnings from Clang. 2013-10-17 20:13:49 +01:00
James Turner
4766910413 Terraysnc: don't block requests when inactive.
Add the same check for data files so we don't block when terrasync is
disabled.
2013-10-17 17:29:06 +01:00
James Turner
3c2f97a8d2 Re-order install(EXPORT ) lines.
Certain cmake builds/versions complain when a dependent target is
exported but dependencies are not. Export SimGearCore before
SimGearScene.
2013-10-17 17:12:02 +01:00
James Turner
f75730f165 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.
2013-10-17 16:39:29 +01:00
James Turner
b596e62a61 Remove some iostream debugging.
Accidentally committed this debug stuff, remove it.
2013-10-17 16:35:36 +01:00
James Turner
1349d48339 Export SimGear config to cmake.
Experimenting with this, should make FindSimGear module unecessary,
and avoid mis-matched SG/FG cmake settings in the future.
2013-10-17 16:10:18 +01:00
James Turner
d69ea5fda6 Kill off EMBEDDED_SIMGEAR 2013-10-17 16:09:39 +01:00
Thomas Geymayer
9b68062ba7 Add helper to get osg::Node path as string. 2013-10-17 13:28:54 +02:00
Thomas Geymayer
b217019723 Nasal: do not print invalid elements for error backtraces. 2013-10-16 23:33:06 +02:00
Thomas Geymayer
a37a254a68 Canvas: simplify code by using new nasal function conversion. 2013-10-15 17:46:42 +02:00
Thomas Geymayer
5258699f20 cppbind: convert Nasal functions to C++ boost::function. 2013-10-15 17:46:31 +02:00
Thomas Geymayer
483bebb003 cppbind: fix bad class hierarchy for bad_nasal_cast. 2013-10-15 16:38:38 +02:00
Thomas Geymayer
8ca8052a8d Nasal: use correct function pointer in naCall (with user data) 2013-10-15 14:21:45 +02:00
Thomas Geymayer
d68b1144b8 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.
2013-10-15 12:08:42 +02:00
Thomas Geymayer
42c39b6be3 Canvas: use new naGCSave/naGCRelease functions. 2013-10-15 00:49:13 +02:00
Thomas Geymayer
bb82b9d168 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.
2013-10-15 00:19:32 +02:00
Thomas Geymayer
b1f865d461 cppbind: add to_nasal_helper for enums. 2013-10-14 23:03:36 +02:00
Thomas Geymayer
8e75c6be50 HTTP: check url for scheme and report instead of failing with assert. 2013-10-13 12:06:17 +02:00
Thomas Geymayer
06a5f9188d Don't let exceptions escape from commands. 2013-10-13 12:00:52 +02:00
Thomas Geymayer
370a991208 cppbind: Catch exceptions before reaching C code. 2013-10-13 11:40:27 +02:00
Thomas Geymayer
6deb77dd4d Canvas: allow also C++ callable entities as event callbacks. 2013-10-12 00:29:37 +02:00
James Turner
9e3172cb04 Another attempt to make MSVC happy!
C89 requires variable declarations upfront.
2013-10-09 12:26:29 +02:00
James Turner
426c6b9a72 Linux needs <cstring> 2013-10-09 11:58:51 +02:00
James Turner
d148bdedcd Fix MSVC build, no C99 so no round().
(Doesn't use SGMisc<T>::round, since Nasal is pure C)
2013-10-09 11:52:54 +02:00
James Turner
23140e3bf7 Avoid a data copy decoding base64 data.
Use an out parameter to avoid a buffer alloc/copy/free cycle
when returning base64-decoded data.
2013-10-09 10:03:30 +02:00
James Turner
2f023803e7 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.
2013-10-09 10:03:28 +02:00
James Turner
d658b5fc38 Use std::string.append, avoid string copying.
Removes a hot-spot on the SVN update path.
2013-10-09 10:03:27 +02:00
James Turner
68cd84c330 Make base64 decode significantly faster.
Use a reverse lookup table instead of a call to string.find for
each input byte, much speedier.
2013-10-09 10:03:27 +02:00
James Turner
0bd82a43d3 Check for DAV status parse failures. 2013-10-09 10:03:26 +02:00
James Turner
7fdf42b699 Reset: Nasal additions to force GC, clear saved refs. 2013-10-09 09:59:50 +02:00
James Turner
aeb0e9aac3 Reset: event manager can be unbound. 2013-10-09 09:59:40 +02:00
James Turner
1099a3bdf0 Reset: model placement can drop OSG nodes. 2013-10-09 09:59:33 +02:00
James Turner
aa3458f69c Reset: model lib can drop static root. 2013-10-09 09:59:21 +02:00
Stanislaw Halik
0186cbb7b7 cmake: prevent Boost barfing out too many warns 2013-10-03 21:49:38 +01:00
Stanislaw Halik
fa36e94c4b fix static build with recent GNU binutils
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
2013-10-03 21:49:38 +01:00
James Turner
ad83e70cf5 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.
2013-10-03 17:40:17 +01:00
James Turner
4a0377c0a1 Rename WaitingSyncItem -> SyncItem.
More accurate name (we have these for items which are not waiting),
and also shorter.
2013-09-30 21:59:18 +01:00
James Turner
83a3241830 Fix a signed/unsigned compare warning 2013-09-30 16:44:04 +01:00
James Turner
f299b351e3 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.
2013-09-30 16:35:45 +01:00
James Turner
3880e4ef47 Say which ocean tile we generated. 2013-09-30 12:08:10 +01:00