rename timestamp name to avoid conflicts

This commit is contained in:
Konstantin Käfer
2014-07-01 05:20:03 -07:00
parent ce44d8255d
commit 409a6ec6f4
3 changed files with 7 additions and 7 deletions

View File

@@ -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;
};

View File

@@ -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++;
}

View File

@@ -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));