Recalculate WIDESCREENDELTA before creation of hud widgets (#121)

This commit is contained in:
Roman Fomin 2021-02-01 03:19:48 +07:00 committed by GitHub
parent c874200f3f
commit b704f5f7a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -451,6 +451,9 @@ void HU_Start(void)
message_count = (message_timer * TICRATE) / 1000 + 1;
chat_count = (chat_msg_timer * TICRATE) / 1000 + 1;
// [crispy] re-calculate WIDESCREENDELTA
I_GetScreenDimensions();
// create the message widget
// messages to player in upper-left of screen
HUlib_initSText(&w_message, HU_MSGX, HU_MSGY, HU_MSGHEIGHT, hu_font,

View File

@ -1079,12 +1079,21 @@ void I_GetScreenDimensions(void)
SDL_DisplayMode mode;
int w = 16, h = 10;
int ah;
static boolean firsttime = true;
SCREENWIDTH = ORIGWIDTH;
SCREENHEIGHT = ORIGHEIGHT;
NONWIDEWIDTH = SCREENWIDTH;
if (firsttime)
{
useaspect = cfg_aspectratio;
if(M_CheckParm("-aspect"))
useaspect = true;
firsttime = false;
}
ah = useaspect ? (6 * SCREENHEIGHT / 5) : SCREENHEIGHT;
if (SDL_GetCurrentDisplayMode(video_display, &mode) == 0)
@ -1196,10 +1205,6 @@ static void I_InitGraphicsMode(void)
else if(M_CheckParm("-5"))
scalefactor = 5;
useaspect = cfg_aspectratio;
if(M_CheckParm("-aspect"))
useaspect = true;
I_GetWindowPosition(&v_x, &v_y, window_width, window_height);
// [FG] create rendering window