diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-29 14:51:07 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-11-08 08:09:28 -0800 |
commit | 36210fe4e9c68a52dedc90548d90e77cf39a2228 (patch) | |
tree | be6f8e5c84f98094a372fc7518a5384fd37563bc /src/mbgl/layout | |
parent | 687ee1e1c92275f65469412591ff262b46e7ccd9 (diff) | |
download | qtlocation-mapboxgl-36210fe4e9c68a52dedc90548d90e77cf39a2228.tar.gz |
[core] Make attribute binding more similar to uniform binding
Diffstat (limited to 'src/mbgl/layout')
-rw-r--r-- | src/mbgl/layout/symbol_layout.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index f1886e807e..3fa58e016f 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -462,14 +462,14 @@ void SymbolLayout::addSymbols(Buffer &buffer, const SymbolQuads &symbols, float uint8_t glyphAngle = std::round((symbol.glyphAngle / (M_PI * 2)) * 256); // coordinates (2 triangles) - buffer.vertices.emplace_back(anchorPoint.x, anchorPoint.y, tl.x, tl.y, tex.x, tex.y, minZoom, - maxZoom, placementZoom, glyphAngle); - buffer.vertices.emplace_back(anchorPoint.x, anchorPoint.y, tr.x, tr.y, tex.x + tex.w, tex.y, - minZoom, maxZoom, placementZoom, glyphAngle); - buffer.vertices.emplace_back(anchorPoint.x, anchorPoint.y, bl.x, bl.y, tex.x, tex.y + tex.h, - minZoom, maxZoom, placementZoom, glyphAngle); - buffer.vertices.emplace_back(anchorPoint.x, anchorPoint.y, br.x, br.y, tex.x + tex.w, tex.y + tex.h, - minZoom, maxZoom, placementZoom, glyphAngle); + buffer.vertices.emplace_back(SymbolAttributes::vertex(anchorPoint, tl, tex.x, tex.y, + minZoom, maxZoom, placementZoom, glyphAngle)); + buffer.vertices.emplace_back(SymbolAttributes::vertex(anchorPoint, tr, tex.x + tex.w, tex.y, + minZoom, maxZoom, placementZoom, glyphAngle)); + buffer.vertices.emplace_back(SymbolAttributes::vertex(anchorPoint, bl, tex.x, tex.y + tex.h, + minZoom, maxZoom, placementZoom, glyphAngle)); + buffer.vertices.emplace_back(SymbolAttributes::vertex(anchorPoint, br, tex.x + tex.w, tex.y + tex.h, + minZoom, maxZoom, placementZoom, glyphAngle)); // add the two triangles, referencing the four coordinates we just inserted. buffer.triangles.emplace_back(index + 0, index + 1, index + 2); @@ -507,14 +507,14 @@ void SymbolLayout::addToDebugBuffers(CollisionTile& collisionTile, SymbolBucket& const float maxZoom = util::clamp(zoom + util::log2(box.maxScale), util::MIN_ZOOM_F, util::MAX_ZOOM_F); const float placementZoom = util::clamp(zoom + util::log2(box.placementScale), util::MIN_ZOOM_F, util::MAX_ZOOM_F); - collisionBox.vertices.emplace_back(anchor.x, anchor.y, tl.x, tl.y, maxZoom, placementZoom); - collisionBox.vertices.emplace_back(anchor.x, anchor.y, tr.x, tr.y, maxZoom, placementZoom); - collisionBox.vertices.emplace_back(anchor.x, anchor.y, tr.x, tr.y, maxZoom, placementZoom); - collisionBox.vertices.emplace_back(anchor.x, anchor.y, br.x, br.y, maxZoom, placementZoom); - collisionBox.vertices.emplace_back(anchor.x, anchor.y, br.x, br.y, maxZoom, placementZoom); - collisionBox.vertices.emplace_back(anchor.x, anchor.y, bl.x, bl.y, maxZoom, placementZoom); - collisionBox.vertices.emplace_back(anchor.x, anchor.y, bl.x, bl.y, maxZoom, placementZoom); - collisionBox.vertices.emplace_back(anchor.x, anchor.y, tl.x, tl.y, maxZoom, placementZoom); + collisionBox.vertices.emplace_back(CollisionBoxAttributes::vertex(anchor, tl, maxZoom, placementZoom)); + collisionBox.vertices.emplace_back(CollisionBoxAttributes::vertex(anchor, tr, maxZoom, placementZoom)); + collisionBox.vertices.emplace_back(CollisionBoxAttributes::vertex(anchor, tr, maxZoom, placementZoom)); + collisionBox.vertices.emplace_back(CollisionBoxAttributes::vertex(anchor, br, maxZoom, placementZoom)); + collisionBox.vertices.emplace_back(CollisionBoxAttributes::vertex(anchor, br, maxZoom, placementZoom)); + collisionBox.vertices.emplace_back(CollisionBoxAttributes::vertex(anchor, bl, maxZoom, placementZoom)); + collisionBox.vertices.emplace_back(CollisionBoxAttributes::vertex(anchor, bl, maxZoom, placementZoom)); + collisionBox.vertices.emplace_back(CollisionBoxAttributes::vertex(anchor, tl, maxZoom, placementZoom)); } }; populateCollisionBox(symbolInstance.textCollisionFeature); |