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

Method IsVisibleInClipRegion

src/game/map/render_layer.cpp:203–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203bool CRenderLayer::IsVisibleInClipRegion(const std::optional<CClipRegion> &ClipRegion) const
204{
205 // always show unclipped regions
206 if(!ClipRegion.has_value())
207 return true;
208
209 float ScreenX0, ScreenY0, ScreenX1, ScreenY1;
210 Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1);
211 float Left = ClipRegion->m_X;
212 float Top = ClipRegion->m_Y;
213 float Right = ClipRegion->m_X + ClipRegion->m_Width;
214 float Bottom = ClipRegion->m_Y + ClipRegion->m_Height;
215
216 return Right >= ScreenX0 && Left <= ScreenX1 && Bottom >= ScreenY0 && Top <= ScreenY1;
217}
218
219/**************
220 * Group *

Callers

nothing calls this directly

Calls 2

GraphicsFunction · 0.85
GetScreenMethod · 0.80

Tested by

no test coverage detected