Remove global g_xres and x_yres

Instead query g_VideoMode where needed. As both g_xres and g_yres aren't
global anymore remove static from UpdateRenderer. While at it use more
desicriptive names: GetXRes -> GetWindowWidth, GetYRes ->
GetWindowHeight.

This reduces the amount of variables tracking width and height by one
each.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2026-07-07 19:03:08 +02:00
parent b588b62304
commit 99bbc24265
17 changed files with 50 additions and 63 deletions
+1 -1
View File
@@ -461,7 +461,7 @@ IGUIObject* CGUI::FindObjectUnderMouse()
CSize2D CGUI::GetWindowSize() const
{
return CSize2D{static_cast<float>(g_xres) / g_VideoMode.GetScale(), static_cast<float>(g_yres) / g_VideoMode.GetScale() };
return CSize2D{static_cast<float>(g_VideoMode.GetWindowWidth()) / g_VideoMode.GetScale(), static_cast<float>(g_VideoMode.GetWindowHeight()) / g_VideoMode.GetScale() };
}
void CGUI::SendFocusMessage(EGUIMessageType msgType)