mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Skip clipped groups that are outside the screen
This commit is contained in:
parent
4a7db945c0
commit
29731a111a
|
@ -248,6 +248,9 @@ void CMapLayers::OnRender()
|
|||
float y0 = (pGroup->m_ClipY - Points[1]) / (Points[3]-Points[1]);
|
||||
float x1 = ((pGroup->m_ClipX+pGroup->m_ClipW) - Points[0]) / (Points[2]-Points[0]);
|
||||
float y1 = ((pGroup->m_ClipY+pGroup->m_ClipH) - Points[1]) / (Points[3]-Points[1]);
|
||||
|
||||
if(x1 < 0.0f || x0 > 1.0f || y1 < 0.0f || y0 > 1.0f)
|
||||
continue;
|
||||
|
||||
Graphics()->ClipEnable((int)(x0*Graphics()->ScreenWidth()), (int)(y0*Graphics()->ScreenHeight()),
|
||||
(int)((x1-x0)*Graphics()->ScreenWidth()), (int)((y1-y0)*Graphics()->ScreenHeight()));
|
||||
|
|
Loading…
Reference in a new issue