Skip to content

Commit

Permalink
Start generating symbolInstanceArray automatically.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLoer committed Aug 18, 2018
1 parent 9ac6448 commit 4e34548
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/generate-struct-arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ const {
collisionCircleLayout,
collisionVertexAttributes,
placement,
symbolInstance,
glyphOffset,
lineVertex
} = require('../src/data/bucket/symbol_attributes');
Expand All @@ -162,6 +163,7 @@ createStructArrayType(`collision_box_layout`, collisionBoxLayout);
createStructArrayType(`collision_circle_layout`, collisionCircleLayout);
createStructArrayType(`collision_vertex`, collisionVertexAttributes);
createStructArrayType('placed_symbol', placement, true);
createStructArrayType('symbol_instance', symbolInstance, true);
createStructArrayType('glyph_offset', glyphOffset, true);
createStructArrayType('symbol_line_vertex', lineVertex, true);

Expand Down Expand Up @@ -233,4 +235,3 @@ export {
${[...arrayTypeEntries].join(',\n ')}
};
`);

16 changes: 16 additions & 0 deletions src/data/bucket/symbol_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,22 @@ export const placement = createLayout([
{ type: 'Uint8', name: 'hidden' }
]);

export const symbolInstance = createLayout([
{ type: 'Int16', name: 'anchorX' },
{ type: 'Int16', name: 'anchorY' },
{ type: 'Int16', name: 'horizontalPlacedTextSymbolIndex' },
{ type: 'Int16', name: 'verticalPlacedTextSymbolIndex' },
{ type: 'Uint16', name: 'key' },
{ type: 'Uint16', name: 'textBoxStartIndex' },
{ type: 'Uint16', name: 'textBoxEndIndex' },
{ type: 'Uint16', name: 'iconBoxStartIndex' },
{ type: 'Uint16', name: 'iconBoxEndIndex' },
{ type: 'Uint16', name: 'featureIndex' },
{ type: 'Uint16', name: 'numGlyphVertices' },
{ type: 'Uint16', name: 'numVerticalGlyphVertices' },
{ type: 'Uint16', name: 'numIconVertices' }
]);

export const glyphOffset = createLayout([
{ type: 'Float32', name: 'offsetX' }
]);
Expand Down

0 comments on commit 4e34548

Please sign in to comment.