From add14dd27c7f91c0b20358d5986c56d1231a5d09 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 27 Sep 2013 20:28:43 +0100 Subject: [PATCH] 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. --- simgear/scene/tsync/terrasync.cxx | 4 ++++ simgear/scene/tsync/terrasync.hxx | 5 +++++ 2 files changed, 9 insertions(+) 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); -- 2.39.5