Merge branch 'master' into outdoors-style

Conflicts:
	bin/style.js
This commit is contained in:
Konstantin Käfer
2014-05-19 15:52:42 +02:00
58 changed files with 1096 additions and 1125 deletions

View File

@@ -20,6 +20,7 @@ Map::Map(View& view)
texturepool(),
style(),
glyphAtlas(1024, 1024),
spriteAtlas(512, 512),
painter(*this),
loop(uv_loop_new()) {
@@ -175,7 +176,16 @@ void Map::resize(uint16_t width, uint16_t height, float ratio) {
}
void Map::resize(uint16_t width, uint16_t height, float ratio, uint16_t fb_width, uint16_t fb_height) {
bool changed = false;
if (transform.resize(width, height, ratio, fb_width, fb_height)) {
changed = true;
}
if (spriteAtlas.resize(ratio)) {
changed = true;
}
if (changed) {
update();
}
}
@@ -393,6 +403,11 @@ void Map::prepare() {
style.sprite->load(kSpriteURL);
}
// Allow the sprite atlas to potentially pull new sprite images if needed.
if (style.sprite && style.sprite->isLoaded()) {
spriteAtlas.update(*style.sprite);
}
updateTiles();
updateClippingIDs();
@@ -464,6 +479,8 @@ void Map::render() {
if (transform.needsTransition()) {
update();
}
glFlush();
}
void Map::renderLayers(const std::vector<LayerDescription>& layers, RenderPass pass) {
@@ -520,9 +537,9 @@ void Map::renderLayer(const LayerDescription& layer_desc, RenderPass pass) {
if (pass == Opaque) return;
if (is_invisible(style.computed.lines, layer_desc)) return;
break;
case BucketType::Point:
case BucketType::Icon:
if (pass == Opaque) return;
if (is_invisible(style.computed.points, layer_desc)) return;
if (is_invisible(style.computed.icons, layer_desc)) return;
break;
case BucketType::Text:
if (pass == Opaque) return;