MCPcopy Create free account
hub / github.com/axmolengine/axmol / _drawTriangle

Method _drawTriangle

core/2d/DrawNode.cpp:1283–1306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1281
1282
1283void DrawNode::_drawTriangle(Vec2* vertices3,
1284 const Color4F& borderColor,
1285 const Color4F& fillColor,
1286 bool solid,
1287 float thickness)
1288{
1289 unsigned int vertex_count = 3;
1290
1291 if (thickness != 0.0f)
1292 {
1293 _drawPolygon(vertices3, vertex_count, fillColor, borderColor, true, thickness, true);
1294 }
1295 else
1296 {
1297 applyTransform(vertices3, vertices3, vertex_count);
1298
1299 auto triangles = reinterpret_cast<V2F_C4B_T2F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
1300 _trianglesDirty = true;
1301
1302 triangles[0] = {{vertices3[0], fillColor, Vec2::ZERO},
1303 {vertices3[1], fillColor, Vec2::ZERO},
1304 {vertices3[2], fillColor, Vec2::ZERO}};
1305 }
1306}
1307
1308void DrawNode::_drawAStar(const Vec2& center,
1309 float radiusI, // inner

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected