Fix menu breaking if resolution is under 640x400.

This commit is contained in:
Mari the Deer 2022-04-15 18:32:34 +02:00
commit 7bf38fecfe
2 changed files with 6 additions and 4 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r31 \cu(Fri 15 Apr 18:30:29 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r31 \cu(2022-04-15 18:30:29)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r32 \cu(Fri 15 Apr 18:32:34 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r32 \cu(2022-04-15 18:32:34)\c-";

View file

@ -163,8 +163,10 @@ Class DemolitionistMenu : GenericMenu
mSmallFont = Font.GetFont('TewiFont');
mTinyFont = Font.GetFont('MiniwiFont');
// note that we can assume 640x400 will always be the smallest resolution allowed by gzdoom, but we still need to handle widescreen
hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/266.)),1.);
ss = (Screen.GetWidth(),Screen.GetHeight())/hs;
double sw = max(Screen.GetWidth(),640);
double sh = max(Screen.GetHeight(),400);
hs = max(min(floor(sw/640.),floor(sh/266.)),1.);
ss = (sw,sh)/hs;
ws.x = 640.;
double th = 640*(ss.y/ss.x);
ws.y = round(th);