summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-07-01 05:20:03 -0700
committerKonstantin Käfer <mail@kkaefer.com>2014-07-01 05:20:03 -0700
commit409a6ec6f4c70a4fdb2d2cba46cebafa9ba6e144 (patch)
tree13d76812d750f483a6939ad8f53be90928beb702
parentce44d8255d88ff435d11f5a7d6a20e53610f5367 (diff)
downloadqtlocation-mapboxgl-409a6ec6f4c70a4fdb2d2cba46cebafa9ba6e144.tar.gz
rename timestamp name to avoid conflicts
-rw-r--r--include/llmr/renderer/frame_history.hpp4
-rw-r--r--src/renderer/frame_history.cpp2
-rw-r--r--src/renderer/painter_text.cpp8
3 files changed, 7 insertions, 7 deletions
diff --git a/include/llmr/renderer/frame_history.hpp b/include/llmr/renderer/frame_history.hpp
index 412fce92bb..35ef3cdf47 100644
--- a/include/llmr/renderer/frame_history.hpp
+++ b/include/llmr/renderer/frame_history.hpp
@@ -11,8 +11,8 @@
namespace llmr {
struct FrameSnapshot {
- explicit inline FrameSnapshot(timestamp timestamp, float z) : timestamp(timestamp), z(z) {}
- float timestamp;
+ explicit inline FrameSnapshot(timestamp t, float z) : t(t), z(z) {}
+ float t;
float z;
};
diff --git a/src/renderer/frame_history.cpp b/src/renderer/frame_history.cpp
index e73eaf6262..e0f40df86a 100644
--- a/src/renderer/frame_history.cpp
+++ b/src/renderer/frame_history.cpp
@@ -26,7 +26,7 @@ bool FrameHistory::needsAnimation(const timestamp duration) const {
const FrameSnapshot &pivot = history.back();
int i = -1;
- while ((int)history.size() > i + 1 && history[i + 1].timestamp + duration < pivot.timestamp) {
+ while ((int)history.size() > i + 1 && history[i + 1].t + duration < pivot.t) {
i++;
}
diff --git a/src/renderer/painter_text.cpp b/src/renderer/painter_text.cpp
index d8639ad9c1..d9db72d66b 100644
--- a/src/renderer/painter_text.cpp
+++ b/src/renderer/painter_text.cpp
@@ -54,11 +54,11 @@ void Painter::renderText(TextBucket& bucket, std::shared_ptr<StyleLayer> layer_d
std::deque<FrameSnapshot> &history = frameHistory.history;
// Remove frames until only one is outside the duration, or until there are only three
- while (history.size() > 3 && history[1].timestamp + duration < currentTime) {
+ while (history.size() > 3 && history[1].t + duration < currentTime) {
history.pop_front();
}
- if (history[1].timestamp + duration < currentTime) {
+ if (history[1].t + duration < currentTime) {
history[0].z = history[1].z;
}
@@ -73,7 +73,7 @@ void Painter::renderText(TextBucket& bucket, std::shared_ptr<StyleLayer> layer_d
// Calculate the speed of zooming, and how far it would zoom in terms of zoom levels in one duration
float zoomDiff = endingZ - history[1].z,
- timeDiff = lastFrame.timestamp - history[1].timestamp;
+ timeDiff = lastFrame.t - history[1].t;
float fadedist = zoomDiff / (timeDiff / duration);
#if defined(DEBUG)
@@ -82,7 +82,7 @@ void Painter::renderText(TextBucket& bucket, std::shared_ptr<StyleLayer> layer_d
// At end of a zoom when the zoom stops changing continue pretending to zoom at that speed
// bump is how much farther it would have been if it had continued zooming at the same rate
- float bump = (currentTime - lastFrame.timestamp) / duration * fadedist;
+ float bump = (currentTime - lastFrame.t) / duration * fadedist;
textShader->setFadeDist(fadedist * 10);
textShader->setMinFadeZoom(std::floor(lowZ * 10));