diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-08-10 11:47:31 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-08-10 11:47:31 -0700 |
commit | 1a3e0863ccf251dc76944f11aab5abf9205c6a0d (patch) | |
tree | 97a98fd9993eebba6e6e48939449dea50621699d /src/mbgl/programs/line_program.hpp | |
parent | 5d641f4d6892ae22c9b96f77d92a5295f3ca28b3 (diff) | |
download | qtlocation-mapboxgl-1a3e0863ccf251dc76944f11aab5abf9205c6a0d.tar.gz |
[core] Use separate attribute component for line normalsupstream/cp-9676
Selective cherry pick of 822df3dd514ec3d05f876e6746cb8ba6348ac89d
Diffstat (limited to 'src/mbgl/programs/line_program.hpp')
-rw-r--r-- | src/mbgl/programs/line_program.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mbgl/programs/line_program.hpp b/src/mbgl/programs/line_program.hpp index b2e55a4f3b..0a56ae5dad 100644 --- a/src/mbgl/programs/line_program.hpp +++ b/src/mbgl/programs/line_program.hpp @@ -31,7 +31,7 @@ MBGL_DEFINE_UNIFORM_VECTOR(float, 2, u_gl_units_to_pixels); } // namespace uniforms struct LineLayoutAttributes : gl::Attributes< - attributes::a_pos, + attributes::a_pos_normal, attributes::a_data<uint8_t, 4>> {}; @@ -52,14 +52,16 @@ public: /* * @param p vertex position * @param e extrude normal - * @param t texture normal + * @param round whether the vertex uses a round line cap + * @param up whether the line normal points up or down * @param dir direction of the line cap (-1/0/1) */ - static LayoutVertex layoutVertex(Point<int16_t> p, Point<double> e, Point<bool> t, int8_t dir, int32_t linesofar = 0) { + static LayoutVertex layoutVertex(Point<int16_t> p, Point<double> e, bool round, bool up, int8_t dir, int32_t linesofar = 0) { return LayoutVertex { {{ - static_cast<int16_t>((p.x * 2) | t.x), - static_cast<int16_t>((p.y * 2) | t.y) + p.x, + p.y, + static_cast<int16_t>(attributes::packUint8Pair(round ? 1 : 0, up ? 1 : 0)) }}, {{ // add 128 to store a byte in an unsigned byte |