mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Avoid while
loop for calculating console Y offset
This commit is contained in:
parent
bb650b85c4
commit
0da1743143
|
@ -1147,9 +1147,7 @@ void CGameConsole::OnRender()
|
|||
|
||||
const float XScale = Graphics()->ScreenWidth() / Screen.w;
|
||||
const float YScale = Graphics()->ScreenHeight() / Screen.h;
|
||||
float CalcOffsetY = 0;
|
||||
while(y - (CalcOffsetY + LineHeight) > RowHeight)
|
||||
CalcOffsetY += LineHeight;
|
||||
const float CalcOffsetY = LineHeight * std::floor((y - RowHeight) / LineHeight);
|
||||
const float ClipStartY = (y - CalcOffsetY) * YScale;
|
||||
Graphics()->ClipEnable(0, ClipStartY, Screen.w * XScale, y * YScale - ClipStartY);
|
||||
|
||||
|
|
Loading…
Reference in a new issue