cleanup + unused arguments

This commit is contained in:
Konstantin Käfer
2014-04-16 10:55:06 -04:00
parent 74cb7edb5b
commit 797f590cfb
11 changed files with 22 additions and 30 deletions

View File

@@ -64,15 +64,10 @@ public:
glfwSetWindowSizeCallback(window, resize);
glfwSetFramebufferSizeCallback(window, resize);
glfwSetScrollCallback(window, scroll);
glfwSetCharCallback(window, character);
glfwSetKeyCallback(window, key);
}
static void character(GLFWwindow *window, unsigned int codepoint) {
}
static void key(GLFWwindow *window, int key, int scancode, int action, int mods) {
static void key(GLFWwindow *window, int key, int /*scancode*/, int action, int mods) {
MapView *mapView = (MapView *)glfwGetWindowUserPointer(window);
if (action == GLFW_RELEASE) {
@@ -96,7 +91,7 @@ public:
}
}
static void scroll(GLFWwindow *window, double xoffset, double yoffset) {
static void scroll(GLFWwindow *window, double /*xoffset*/, double yoffset) {
MapView *mapView = (MapView *)glfwGetWindowUserPointer(window);
double delta = yoffset * 40;

View File

@@ -32,7 +32,7 @@ public:
bool update();
void prepare_render(bool is_baselayer = false);
void render(double animationTime, bool is_baselayer = false);
void render(double animationTime);
public:
bool enabled;
@@ -59,8 +59,8 @@ private:
const std::vector<uint32_t> zooms;
const std::string url;
const uint32_t tile_size;
const uint32_t min_zoom;
const uint32_t max_zoom;
const int32_t min_zoom;
const int32_t max_zoom;
std::forward_list<Tile> tiles;
std::forward_list<std::weak_ptr<TileData>> tile_data;

View File

@@ -38,17 +38,19 @@
namespace llmr {
namespace gl {
// Debug group markers, useful for debuggin on iOS
inline void start_group(const std::string &str) {
#if GL_EXT_debug_marker
inline void start_group(const std::string &str) {
glPushGroupMarkerEXT(0, str.c_str());
#endif
}
inline void end_group() {
#if GL_EXT_debug_marker
glPopGroupMarkerEXT();
#endif
}
#else
inline void start_group(const std::string &) {}
inline void end_group() {}
#endif
struct group {
inline group(const std::string &str) { start_group(str); }

View File

@@ -347,12 +347,9 @@ bool Map::render() {
// Then, render each source's tiles. TODO: handle more than one
// vector source.
is_baselayer = true;
for (auto &pair : sources) {
Source &source = *pair.second;
source.render(animationTime, is_baselayer);
is_baselayer = source.enabled ? false : (true && is_baselayer);
source.render(animationTime);
}
painter.renderMatte();

View File

@@ -47,7 +47,7 @@ void Source::prepare_render(bool is_baselayer) {
}
}
void Source::render(double animationTime, bool is_baselayer) {
void Source::render(double animationTime) {
if (!enabled) return;
for (const Tile& tile : tiles) {

View File

@@ -9,11 +9,9 @@
using namespace llmr;
const double MAXEXTENT = 20037508.34;
const double D2R = M_PI / 180.0;
const double R2D = 180.0 / M_PI;
const double M2PI = 2 * M_PI;
const double A = 6378137;
Transform::Transform() {

View File

@@ -288,7 +288,7 @@ void FilteredVectorTileLayer::iterator::operator++() {
// tags are packed varints. They should have an even length.
pbf tags_pbf = feature_pbf.message();
while (tags_pbf) {
uint32_t tag_key = tags_pbf.varint();
int32_t tag_key = tags_pbf.varint();
if (tags_pbf) {
uint32_t tag_val = tags_pbf.varint();
// Now check if the tag_key/tag_val pair is included

View File

@@ -24,7 +24,7 @@ bool FrameHistory::needsAnimation(const float duration) const {
const FrameSnapshot &pivot = history.back();
int i = -1;
while (history.size() > i + 1 &&
while ((int)history.size() > i + 1 &&
history[i + 1].time + duration < pivot.time) {
i++;
}
@@ -37,7 +37,7 @@ bool FrameHistory::needsAnimation(const float duration) const {
// Make sure that all subsequent snapshots have the same zoom as the last
// pivot element.
for (; history.size() > i; i++) {
for (; (int)history.size() > i; i++) {
if (history[i].z != pivot.z) {
return true;
}

View File

@@ -390,7 +390,7 @@ void Painter::renderFill(FillBucket& bucket, const std::string& layer_name, cons
}
}
void Painter::renderLine(LineBucket& bucket, const std::string& layer_name, const Tile::ID& id) {
void Painter::renderLine(LineBucket& bucket, const std::string& layer_name, const Tile::ID& /*id*/) {
// Abort early.
if (pass == Opaque) return;
if (bucket.empty()) return;
@@ -472,7 +472,7 @@ void Painter::renderLine(LineBucket& bucket, const std::string& layer_name, cons
}
}
void Painter::renderPoint(PointBucket& bucket, const std::string& layer_name, const Tile::ID& id) {
void Painter::renderPoint(PointBucket& bucket, const std::string& layer_name, const Tile::ID& /*id&*/) {
// Abort early.
if (!bucket.hasPoints()) return;
if (pass == Opaque) return;
@@ -516,7 +516,7 @@ void Painter::renderPoint(PointBucket& bucket, const std::string& layer_name, co
bucket.drawPoints(*pointShader);
}
void Painter::renderText(TextBucket& bucket, const std::string& layer_name, const Tile::ID& id) {
void Painter::renderText(TextBucket& bucket, const std::string& layer_name, const Tile::ID& /*id*/) {
// Abort early.
if (pass == Opaque) return;
if (bucket.empty()) return;

View File

@@ -3,7 +3,7 @@
using namespace llmr;
RasterBucket::RasterBucket(const BucketDescription &bucket_desc) {
RasterBucket::RasterBucket(const BucketDescription &) {
}
void RasterBucket::render(Painter &, const std::string &, const Tile::ID &) {

View File

@@ -88,7 +88,7 @@ void getSegmentGlyphs(std::back_insert_iterator<GlyphInstances> glyphs,
vec2<float> newAnchor = anchor;
if (line.size() <= segment) {
if ((int)line.size() <= segment) {
return;
}
vec2<float> end = line[segment];
@@ -130,7 +130,7 @@ void getSegmentGlyphs(std::back_insert_iterator<GlyphInstances> glyphs,
// skip duplicate nodes
while (newAnchor == end) {
segment += direction;
if (line.size() <= segment) {
if ((int)line.size() <= segment) {
anchor.scale = scale;
return;
}