Fit hud scaling to 16:9 minimum. Ultrawide be damned.

This commit is contained in:
Mari the Deer 2022-05-08 18:43:42 +02:00
commit df9ac509bc
9 changed files with 9 additions and 35 deletions

View file

@ -2870,8 +2870,7 @@ Class SWWMStatusBar : BaseStatusBar
if ( !swwm_camhud && !(players[consoleplayer].Camera is 'PlayerPawn') )
camhidden = true;
else camhidden = false;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
margin = clamp(swwm_hudmargin,0,40);
hsb = max(hs+swwm_barscalerel,1.);

View file

@ -87,9 +87,7 @@ Class SWWMOneLiner : HUDMessageBase
override void Draw( int bottom, int visibility )
{
int margin = swwm_hudmargin;
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
if ( whichline == "" ) return; // don't draw empty strings
// split so it can fit
@ -189,9 +187,7 @@ Class SWWMAchievementNotification : HUDMessageBase
override void Draw( int bottom, int visibility )
{
double margin = swwm_hudmargin;
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
double fractic = SWWMStatusBar(statusbar)?SWWMStatusBar(statusbar).fractic:0;
double ftics = tics+fractic;
@ -275,9 +271,7 @@ Class SWWMWeaponTooltip : HUDMessageBase
override void Draw( int bottom, int visibility )
{
if ( tics <= 0 ) return;
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
double fractic = SWWMStatusBar(statusbar)?SWWMStatusBar(statusbar).fractic:0;
double ftics = tics+fractic;
@ -540,9 +534,7 @@ Class SWWMDirectMessage : HUDMessageBase
double fractic = SWWMStatusBar(statusbar)?SWWMStatusBar(statusbar).fractic:0;
if ( seqnum == 0 ) alph = (fadein+fractic)/15.;
else if ( seqnum == (seqcnt+1) ) alph = 1.-(fadeout+fractic)/30.;
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
origin = (int(ss.x-270)/2,swwm_hudmargin+70);
Screen.DrawTexture(MessageBox,false,origin.x,origin.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,alph);

View file

@ -134,7 +134,7 @@ Class SWWMCreditsMenu : GenericMenu
void UpdateSize()
{
hs = max(1.,min(floor(Screen.GetWidth()/640),floor(Screen.GetHeight()/266)));
hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
ss = (Screen.GetWidth(),Screen.GetHeight())/hs;
}

View file

@ -126,9 +126,7 @@ Class Hellblazer : SWWMWeapon
SWWMUtility.PrepareProjData(projdata,e.ViewPos,e.ViewAngle,e.ViewPitch,e.ViewRoll,players[consoleplayer].fov);
int cliptop = projdata.viewy, clipbottom = projdata.viewy+projdata.viewh,
clipleft = projdata.viewx, clipright = projdata.viewx+projdata.vieww;
double hs;
if ( swwm_hudscale ) hs = CleanXFac_1;
else hs = max(floor(Screen.GetWidth()/640.),1.);
double hs = max(min(floor(Screen.GetWidth()/640.),floor(Screen.GetHeight()/360.)),1.);
Vector2 ss = (Screen.GetWidth()/hs,Screen.GetHeight()/hs);
for ( int i=0; i<3; i++ )
{