From: DeaDDooMER Date: Tue, 14 Feb 2023 13:57:06 +0000 (+0300) Subject: gl: apply r_resolution_scale without videomode reset X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=7d2efae7f1fb238efa42a1216b023f16db3eb381;p=d2df-sdl.git gl: apply r_resolution_scale without videomode reset --- diff --git a/src/game/renders/opengl/r_render.pas b/src/game/renders/opengl/r_render.pas index 791a29f..7ef7d7b 100644 --- a/src/game/renders/opengl/r_render.pas +++ b/src/game/renders/opengl/r_render.pas @@ -1064,11 +1064,20 @@ implementation end; procedure r_Render_Draw; - var p1, p2: TPlayer; time: LongWord; + var p1, p2: TPlayer; time: LongWord; pw, ph: Integer; begin if gExit = EXIT_QUIT then exit; + {$IFDEF ENABLE_SYSTEM} + (* hack: if r_pixel_scale changed, reset menu and other things *) + pw := Round(gWinSizeX / r_pixel_scale); + ph := Round(gWinSizeY / r_pixel_scale); + if (pw <> gScreenWidth) or (ph <> gScreenHeight) then + if assigned(sys_ScreenResize) then + sys_ScreenResize(gWinSizeX, gWinSizeY); + {$ENDIF} + INC(FPSCounter); time := GetTickCount64(); if time - FPSTime >= 1000 then