make bundle on mac os x and persist settings
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "../renderer/painter.hpp"
|
||||
#include "transform.hpp"
|
||||
#include <llmr/map/tile.hpp>
|
||||
#include "settings.hpp"
|
||||
|
||||
#include <forward_list>
|
||||
|
||||
@@ -12,10 +13,11 @@ namespace llmr {
|
||||
|
||||
class map {
|
||||
public:
|
||||
map();
|
||||
map(settings *settings);
|
||||
~map();
|
||||
|
||||
void setup();
|
||||
void loadSettings();
|
||||
void resize(uint32_t width, uint32_t height);
|
||||
|
||||
/* callback */
|
||||
@@ -34,6 +36,8 @@ public:
|
||||
// void setZoom(double zoom);
|
||||
// void setLonLatZoom(double lon, double lat, double zoom);
|
||||
|
||||
void toggleDebug();
|
||||
|
||||
private:
|
||||
bool findLoadedChildren(const tile_id& id, int32_t maxCoveringZoom, std::forward_list<tile_id>& retain);
|
||||
bool findLoadedParent(const tile_id& id, int32_t minCoveringZoom, std::forward_list<tile_id>& retain);
|
||||
@@ -41,7 +45,11 @@ private:
|
||||
tile::ptr addTile(const tile_id& id);
|
||||
tile::ptr hasTile(const tile_id& id);
|
||||
|
||||
|
||||
void update();
|
||||
|
||||
private:
|
||||
settings *settings;
|
||||
transform *transform;
|
||||
painter *painter;
|
||||
|
||||
|
||||
23
include/llmr/map/settings.hpp
Normal file
23
include/llmr/map/settings.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef LLMR_MAP_SETTINGS
|
||||
#define LLMR_MAP_SETTINGS
|
||||
|
||||
namespace llmr {
|
||||
|
||||
class settings {
|
||||
public:
|
||||
virtual void save() = 0;
|
||||
|
||||
public:
|
||||
// position
|
||||
double longitude = 0;
|
||||
double latitude = 0;
|
||||
double scale = 0;
|
||||
double angle = 0;
|
||||
|
||||
// debug
|
||||
bool debug = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -29,6 +29,8 @@ public:
|
||||
// Getters
|
||||
void matrixFor(float matrix[16], const vec3<int32_t>& id) const;
|
||||
int32_t getZoom() const;
|
||||
double getScale() const;
|
||||
double getAngle() const;
|
||||
void getLonLat(double& lon, double& lat) const;
|
||||
|
||||
|
||||
|
||||
19
include/llmr/util/string.hpp
Normal file
19
include/llmr/util/string.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef LLMR_UTIL_STRING
|
||||
#define LLMR_UTIL_STRING
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace llmr {
|
||||
namespace util {
|
||||
|
||||
template<typename... Args>
|
||||
inline std::string sprintf(const char *msg, Args... args) {
|
||||
char res[1024];
|
||||
int len = snprintf(res, sizeof(res), msg, args...);
|
||||
return std::string(res, len);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user