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

Function DrawPolygon

core/physics/PhysicsWorld.cpp:264–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264static void DrawPolygon(int count,
265 const cpVect* verts,
266 cpFloat /*r*/,
267 cpSpaceDebugColor outline,
268 cpSpaceDebugColor fill,
269 cpDataPointer data)
270{
271 const Color4F fillColor(fill.r, fill.g, fill.b, fill.a);
272 const Color4F outlineColor(outline.r, outline.g, outline.b, outline.a);
273 DrawNode* drawNode = static_cast<DrawNode*>(data);
274 int num = count;
275 Vec2* seg = new Vec2[num];
276 for (int i = 0; i < num; ++i)
277 seg[i] = PhysicsHelper::cpv2vec2(verts[i]);
278
279 drawNode->drawPolygon(seg, num, fillColor, _debugDrawThickness, outlineColor);
280
281 delete[] seg;
282}
283
284static void DrawDot(cpFloat /*size*/, cpVect pos, cpSpaceDebugColor color, cpDataPointer data)
285{

Callers

nothing calls this directly

Calls 1

drawPolygonMethod · 0.45

Tested by

no test coverage detected