mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Refactor CDebugHud::RenderHint
Replace magic numbers with constants.
This commit is contained in:
parent
30d3d4f94c
commit
51e1f9d88f
|
@ -204,10 +204,15 @@ void CDebugHud::RenderHint()
|
||||||
if(!g_Config.m_Debug)
|
if(!g_Config.m_Debug)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float Width = 300 * Graphics()->ScreenAspect();
|
const float Height = 300.0f;
|
||||||
Graphics()->MapScreen(0, 0, Width, 300);
|
const float Width = Height * Graphics()->ScreenAspect();
|
||||||
TextRender()->TextColor(1, 1, 1, 1);
|
Graphics()->MapScreen(0.0f, 0.0f, Width, Height);
|
||||||
TextRender()->Text(5, 290, 5, Localize("Debug mode enabled. Press Ctrl+Shift+D to disable debug mode."), -1.0f);
|
|
||||||
|
const float FontSize = 5.0f;
|
||||||
|
const float Spacing = 5.0f;
|
||||||
|
|
||||||
|
TextRender()->TextColor(TextRender()->DefaultTextColor());
|
||||||
|
TextRender()->Text(Spacing, Height - FontSize - Spacing, FontSize, Localize("Debug mode enabled. Press Ctrl+Shift+D to disable debug mode."));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDebugHud::OnRender()
|
void CDebugHud::OnRender()
|
||||||
|
|
Loading…
Reference in a new issue