allow for delayed map notifications during animations

This commit is contained in:
Justin R. Miller
2014-07-15 18:48:01 -07:00
parent cdda9f12b5
commit 1f06f518b2
5 changed files with 15 additions and 7 deletions

View File

@@ -1,5 +1,7 @@
#include "glfw_view.hpp"
#include <llmr/util/time.hpp>
GLFWView::GLFWView(bool fullscreen) : fullscreen(fullscreen) {
#ifdef NVIDIA
glDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC)glfwGetProcAddress("glDiscardFramebufferEXT");
@@ -281,7 +283,7 @@ void show_color_debug_image(std::string name, const char *data, size_t logical_w
}
#endif
void notify_map_change(MapChange change) {
void notify_map_change(MapChange change, timestamp delay) {
// no-op
}

View File

@@ -1,4 +1,5 @@
#include "headless_view.hpp"
#include <llmr/util/time.hpp>
#include <llmr/util/timer.hpp>
#include <llmr/platform/platform.hpp>
@@ -6,7 +7,7 @@ namespace llmr {
namespace platform {
void notify_map_change(MapChange change) {
void notify_map_change(MapChange change, timestamp delay) {
// no-op
}

View File

@@ -1,6 +1,8 @@
#ifndef LLMR_PLATFORM_PLATFORM
#define LLMR_PLATFORM_PLATFORM
#include <llmr/util/time.hpp>
#include <memory>
#include <functional>
#include <string>
@@ -49,7 +51,7 @@ std::shared_ptr<Request> request_http(const std::string &url,
void cancel_request_http(const std::shared_ptr<Request> &req);
// Notifies a watcher of map changes.
void notify_map_change(MapChange key);
void notify_map_change(MapChange key, timestamp delay = 0);
// Shows an alpha image with the specified dimensions in a named window.
void show_debug_image(std::string name, const char *data, size_t width, size_t height);

View File

@@ -86,7 +86,8 @@ void Transform::_moveBy(const double dx, const double dy, const timestamp durati
platform::notify_map_change(duration ?
platform::MapChangeRegionDidChangeAnimated :
platform::MapChangeRegionDidChange);
platform::MapChangeRegionDidChange,
duration);
}
void Transform::setLonLat(const double lon, const double lat, const timestamp duration) {
@@ -310,7 +311,8 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl
platform::notify_map_change(duration ?
platform::MapChangeRegionDidChangeAnimated :
platform::MapChangeRegionDidChange);
platform::MapChangeRegionDidChange,
duration);
}
#pragma mark - Constraints
@@ -410,7 +412,8 @@ void Transform::_setAngle(double new_angle, const timestamp duration) {
platform::notify_map_change(duration ?
platform::MapChangeRegionDidChangeAnimated :
platform::MapChangeRegionDidChange);
platform::MapChangeRegionDidChange,
duration);
}
double Transform::getAngle() const {