Commit Graph

4173 Commits

Author SHA1 Message Date
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
James Turner
f205e918d9 sprintf -> snprintf in bucket code. 2013-09-30 12:07:57 +01:00
James Turner
42b0b9306b Make code quieter at log-level=DEBUG. 2013-09-28 14:45:30 +01:00
James Turner
483659c319 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.
2013-09-28 14:03:39 +01:00
James Turner
add14dd27c 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.
2013-09-27 20:28:43 +01:00
James Turner
61516a5e97 Terrasync: Expose transfer rate as a property. 2013-09-27 18:23:51 +01:00
James Turner
17418039e1 HTTP bugfix + enhancement.
Track 'waiting for response' state explicitly, so we don't
falsely report IDLE when waiting for a response.

Expose bytes-per-second download rate as metric.
2013-09-27 18:20:03 +01:00
James Turner
25cae61211 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)
2013-09-26 12:11:48 +01:00
James Turner
db98c7440e 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.
2013-09-25 16:31:10 +01:00
James Turner
3783ae2234 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.
2013-09-23 18:20:16 +01:00
James Turner
3e8732b230 Libsvn / APR dependency is removed.
Remove any use of libsubversion / API in Simgear, and always
compile the built-in SVN client code.
2013-09-23 18:05:37 +01:00
James Turner
b39bca9458 Fix no-svn build (Win64 only at present) 2013-09-20 09:18:43 +01:00
James Turner
d263334030 Attempting to fix import/export linkage on Windows.
Hopefully this tells the Expat headers not to do any clever
declspec(import) or export stuff, which we don't want since we only
use the symbols within SimGearCore, and don't export them.
2013-09-19 22:07:41 +01:00
James Turner
b2cea62189 Even more forcing of include file names.
(It's a good thing Windows doesn't ship Expat, since apparently
every other platform does)
2013-09-19 21:58:23 +01:00
James Turner
d6b886c69b Change got lost in the move/rename, not good. 2013-09-19 21:47:40 +01:00
James Turner
38fb9ea41e Intermediate static libs have issues.
Switch back to including the bundled expat sources directly in the
targets, since transitive linking of static libs is very awkward.
Makes static build happy again (let's see what else breaks)
2013-09-19 21:42:28 +01:00
James Turner
a922aaa68e Move bundled Expat to new home.
Renamed bundled Expat headers to avoid any
possibility of accidental including system headers when
using bundled Expat, or vice-versa. Should help with SVN
crashes reported by Thomas.
2013-09-19 20:12:32 +01:00
James Turner
4f2e36ca46 rand(), not random(), for Windows. 2013-09-19 08:57:34 +01:00
James Turner
f367627cac Fix HTTP unit test.
Also fix a signed/unsigned warning I caused.
2013-09-18 22:55:11 +01:00
James Turner
7a7fcf10ad Fix missing include for non-Mac 2013-09-18 22:13:04 +01:00
James Turner
b9bd2734eb Persistent SVN update cache.
Make the already present cache of updated URLs persistent, with a
definable lifetime, currently 24 hours. This ensures terrasync-ed
resources are checked less often (max once per day) instead of each
FGFS launch, which should greatly cut down requests to the backend.
2013-09-18 21:40:35 +01:00
James Turner
9c7bd4f5d5 HTTP Client improvements
- max connections limit, and parallel connections to a single host where possible.
  (Will permit updating terrain and Models / Airports / data in parallel)
- add LGPL headers
- give HTTP::Client a private impl class, to keep header simple.
2013-09-18 12:17:38 +01:00
James Turner
362d47f91f Kill legacy PPM support in screen-dump 2013-09-18 12:17:29 +01:00
James Turner
a18792c397 Printf format sanitising.
Refactored version for next, use a new helper in
simgear::strutils.
2013-09-15 13:30:12 +01:00
James Turner
0e2ddb2f16 Bah, tested on the wrong compiler, so missed a file. 2013-09-14 18:05:53 +01:00
James Turner
bcfadd6657 Prefix GCC version constant.
From: Markus Wanner <markus@bluegap.ch>
2013-09-14 17:29:59 +01:00
Thomas Geymayer
021cf1a2b4 Remove temporary file and add to .gitignore 2013-09-07 14:28:46 +02:00
James Turner
acf86be516 Rename MD5 code.
Linux crashes with this code seem to relate
to multiple instances of these symbols. Prefix
the SimGear versions to prove/disprove this.
2013-09-04 08:45:06 +01:00
James Turner
dd93eb88f2 Ensure sglog() singleton is threadsafe.
Slightly simplistic, but definitiely correct, method
for ensuring singleton creation is threadsafe. Can
be optimised if lock contention is ever an issue.
2013-09-04 08:45:06 +01:00
James Turner
e06f9e35b3 Tweak for 64-bit Linux linkage. 2013-09-04 08:45:06 +01:00
James Turner
c0424aba7e SG part of fix for TerraSync models.
Ensure we search the TerraSync models tree before the FG_ROOT one,
since the TerraSync one contains newer files and updates to the base
one.
2013-08-29 22:13:43 +01:00