From: James Turner Date: Fri, 27 Sep 2013 19:28:43 +0000 (+0100) Subject: Reposition hook for terrasync. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=add14dd27c7f91c0b20358d5986c56d1231a5d09;p=simgear.git 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. --- diff --git a/simgear/scene/tsync/terrasync.cxx b/simgear/scene/tsync/terrasync.cxx index 677566a9..631ffe46 100644 --- a/simgear/scene/tsync/terrasync.cxx +++ b/simgear/scene/tsync/terrasync.cxx @@ -1041,3 +1041,7 @@ bool SGTerraSync::schedulePosition(int lat, int lon) return Ok; } +void SGTerraSync::reposition() +{ + last_lat = last_lon = NOWHERE; +} diff --git a/simgear/scene/tsync/terrasync.hxx b/simgear/scene/tsync/terrasync.hxx index 3e0db27d..35bfecc5 100644 --- a/simgear/scene/tsync/terrasync.hxx +++ b/simgear/scene/tsync/terrasync.hxx @@ -49,6 +49,11 @@ public: virtual void unbind(); virtual void update(double); + /// notify terrasync that the sim was repositioned, as opposed to + /// us travelling in a direction. Avoid last_lat / last_lon blocking + /// certain tiles when we reposition. + void reposition(); + bool isIdle(); bool schedulePosition(int lat, int lon);