MCPcopy Create free account
hub / github.com/ddnet/ddnet / RenderDebugClip

Method RenderDebugClip

src/game/map/render_map.cpp:1405–1424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1403}
1404
1405void CRenderMap::RenderDebugClip(float ClipX, float ClipY, float ClipW, float ClipH, ColorRGBA Color, float Zoom, const char *pLabel)
1406{
1407 Graphics()->TextureClear();
1408 Graphics()->LinesBegin();
1409 Graphics()->SetColor(Color);
1410 IGraphics::CLineItem aLineItems[] = {
1411 IGraphics::CLineItem(ClipX, ClipY, ClipX, ClipY + ClipH),
1412 IGraphics::CLineItem(ClipX + ClipW, ClipY, ClipX + ClipW, ClipY + ClipH),
1413 IGraphics::CLineItem(ClipX, ClipY, ClipX + ClipW, ClipY),
1414 IGraphics::CLineItem(ClipX, ClipY + ClipH, ClipX + ClipW, ClipY + ClipH),
1415 };
1416 Graphics()->LinesDraw(aLineItems, std::size(aLineItems));
1417 Graphics()->LinesEnd();
1418
1419 TextRender()->TextColor(Color);
1420
1421 // clamp zoom and set line width, because otherwise the text can be partially clipped out
1422 TextRender()->Text(ClipX, ClipY, std::min(12.0f * Zoom, 20.0f), pLabel, ClipW);
1423 TextRender()->TextColor(TextRender()->DefaultTextColor());
1424}

Callers 4

DoRenderMethod · 0.80
RenderTileLayerMethod · 0.80
RenderQuadLayerMethod · 0.80
RenderMethod · 0.80

Calls 11

GraphicsFunction · 0.85
CLineItemClass · 0.85
TextRenderFunction · 0.85
TextureClearMethod · 0.80
LinesBeginMethod · 0.80
LinesDrawMethod · 0.80
LinesEndMethod · 0.80
TextColorMethod · 0.80
TextMethod · 0.80
DefaultTextColorMethod · 0.80
SetColorMethod · 0.45

Tested by

no test coverage detected