| 1403 | } |
| 1404 | |
| 1405 | void 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 | } |
no test coverage detected