summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry/icon_buffer.cpp
diff options
context:
space:
mode:
authorAmy Lee Walton <amylee@mapbox.com>2016-08-11 09:49:36 -0700
committerGitHub <noreply@github.com>2016-08-11 09:49:36 -0700
commitb0cb8715ed74678b4d0f05829fa71a590e41b2f6 (patch)
treeaf1ee87674c0963328b3c3bbdc5685270d647896 /src/mbgl/geometry/icon_buffer.cpp
parent89190f8d891f7734a3db3267afb746cf83e872d5 (diff)
downloadqtlocation-mapboxgl-b0cb8715ed74678b4d0f05829fa71a590e41b2f6.tar.gz
CJK overflow - update to match gl-shader (#5908)
* update vertex array ushorts * update atlas size * testing latest cjk test-suite branch * update shader ref * update shaders * update icon buffer * shaders * updated tests * buffer fix * updated make tests * annotation expected updates * final push * final fonts * a_data1 removal * remove cjk-mixed test * hiring threshold for cjk-chinese * update to new test suite * Rename a_data2 to a_data in sdf and icon shaders * update test-suite sha
Diffstat (limited to 'src/mbgl/geometry/icon_buffer.cpp')
-rw-r--r--src/mbgl/geometry/icon_buffer.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mbgl/geometry/icon_buffer.cpp b/src/mbgl/geometry/icon_buffer.cpp
index 51a4aa69fd..2895ca5c3b 100644
--- a/src/mbgl/geometry/icon_buffer.cpp
+++ b/src/mbgl/geometry/icon_buffer.cpp
@@ -16,16 +16,18 @@ size_t IconVertexBuffer::add(int16_t x, int16_t y, float ox, float oy, int16_t t
shorts[2] /* offset */ = ::round(ox * 64); // use 1/64 pixels for placement
shorts[3] /* offset */ = ::round(oy * 64);
+ uint16_t *ushorts = static_cast<uint16_t *>(data);
+ // a_texture_pos
+ ushorts[4] /* tex */ = tx / 4;
+ ushorts[5] /* tex */ = ty / 4;
+
uint8_t *ubytes = static_cast<uint8_t *>(data);
- // a_data1
- ubytes[8] /* tex */ = tx / 4;
- ubytes[9] /* tex */ = ty / 4;
- ubytes[10] /* labelminzoom */ = labelminzoom * 10;
- ubytes[11] /* labelangle */ = labelangle;
-
- // a_data2
- ubytes[12] /* minzoom */ = minzoom * 10; // 1/10 zoom levels: z16 == 160.
- ubytes[13] /* maxzoom */ = ::fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160.
+ // a_data
+ ubytes[12] /* labelminzoom */ = labelminzoom * 10;
+ ubytes[13] /* labelangle */ = labelangle;
+
+ ubytes[14] /* minzoom */ = minzoom * 10; // 1/10 zoom levels: z16 == 160.
+ ubytes[15] /* maxzoom */ = ::fmin(maxzoom, 25) * 10; // 1/10 zoom levels: z16 == 160.
return idx;
}