mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Ingame aspect ratio, a.k.a 5:4 ingame support while UI is normal resolution
This commit is contained in:
parent
38be4b5745
commit
ea2076a615
|
@ -151,6 +151,7 @@ MACRO_CONFIG_INT(UiCloseWindowAfterChangingSetting, ui_close_window_after_changi
|
|||
MACRO_CONFIG_INT(UiUnreadNews, ui_unread_news, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Whether there is unread news")
|
||||
|
||||
MACRO_CONFIG_INT(GfxNoclip, gfx_noclip, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Disable clipping")
|
||||
MACRO_CONFIG_INT(GfxIngameAspectRatio, gfx_ingame_aspect_ratio, 0, 0, 10000, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Ingame aspect ratio (normalized float by 1000)")
|
||||
|
||||
// dummy
|
||||
MACRO_CONFIG_STR(ClDummyName, dummy_name, 16, "", CFGFLAG_SAVE | CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Name of the dummy")
|
||||
|
|
|
@ -373,6 +373,9 @@ void CRenderTools::CalcScreenParams(float Aspect, float Zoom, float *pWidth, flo
|
|||
const float WMax = 1500;
|
||||
const float HMax = 1050;
|
||||
|
||||
if(g_Config.m_GfxIngameAspectRatio != 0)
|
||||
Aspect = g_Config.m_GfxIngameAspectRatio / 1000.0f;
|
||||
|
||||
const float f = std::sqrt(Amount) / std::sqrt(Aspect);
|
||||
*pWidth = f * Aspect;
|
||||
*pHeight = f;
|
||||
|
|
Loading…
Reference in a new issue