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

Method _drawDot

core/2d/DrawNode.cpp:1214–1227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1212}
1213
1214void DrawNode::_drawDot(const Vec2& pos, float radius, const Color4F& color)
1215{
1216 unsigned int vertex_count = 2 * 3;
1217 auto triangles = reinterpret_cast<V2F_C4B_T2F_Triangle*>(expandBufferAndGetPointer(_triangles, vertex_count));
1218 _trianglesDirty = true;
1219
1220 V2F_C4B_T2F a = {Vec2(pos.x - radius, pos.y - radius), color, Vec2(-1.0f, -1.0f)};
1221 V2F_C4B_T2F b = {Vec2(pos.x - radius, pos.y + radius), color, Vec2(-1.0f, 1.0f)};
1222 V2F_C4B_T2F c = {Vec2(pos.x + radius, pos.y + radius), color, Vec2(1.0f, 1.0f)};
1223 V2F_C4B_T2F d = {Vec2(pos.x + radius, pos.y - radius), color, Vec2(1.0f, -1.0f)};
1224
1225 triangles[0] = {a, b, c};
1226 triangles[1] = {a, c, d};
1227}
1228
1229void DrawNode::_drawCircle(const Vec2& center,
1230 float radius,

Callers

nothing calls this directly

Calls 2

Vec2Class · 0.70

Tested by

no test coverage detected