Refactor CDebugHud::RenderHint

Replace magic numbers with constants.
This commit is contained in:
Robert Müller 2023-08-02 22:14:39 +02:00
parent 30d3d4f94c
commit 51e1f9d88f

View file

@ -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()