From 409a6ec6f4c70a4fdb2d2cba46cebafa9ba6e144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 1 Jul 2014 05:20:03 -0700 Subject: rename timestamp name to avoid conflicts --- include/llmr/renderer/frame_history.hpp | 4 ++-- src/renderer/frame_history.cpp | 2 +- src/renderer/painter_text.cpp | 8 ++++---- 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 layer_d std::deque &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 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 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)); -- cgit v1.2.1