Merge remote-tracking branch 'origin/master' into vulkan2
This commit is contained in:
commit
dd4ef010ab
107 changed files with 1341 additions and 693 deletions
|
|
@ -154,7 +154,7 @@ public:
|
|||
|
||||
int DisplayWidth, DisplayHeight;
|
||||
|
||||
FFont *SmallFont, *SmallFont2, *BigFont, *BigUpper, *ConFont, *IntermissionFont, *NewConsoleFont, *CurrentConsoleFont;
|
||||
FFont *SmallFont, *SmallFont2, *BigFont, *BigUpper, *ConFont, *IntermissionFont, *NewConsoleFont, *NewSmallFont, *CurrentConsoleFont;
|
||||
|
||||
uint32_t Col2RGB8[65][256];
|
||||
uint32_t *Col2RGB8_LessPrecision[65];
|
||||
|
|
@ -548,13 +548,10 @@ CCMD(clean)
|
|||
|
||||
|
||||
void V_UpdateModeSize (int width, int height)
|
||||
{
|
||||
int cx1, cx2;
|
||||
V_CalcCleanFacs(320, 200, width, height, &CleanXfac, &CleanYfac, &cx1, &cx2);
|
||||
|
||||
CleanWidth = width / CleanXfac;
|
||||
CleanHeight = height / CleanYfac;
|
||||
assert(CleanWidth >= 320 && CleanHeight >= 200);
|
||||
{
|
||||
// This calculates the menu scale.
|
||||
// The optimal scale will always be to fit a virtual 640 pixel wide display onto the screen.
|
||||
// Exceptions are made for a few ranges where the available virtual width is > 480.
|
||||
|
||||
int w = screen->GetWidth();
|
||||
int factor;
|
||||
|
|
@ -563,7 +560,11 @@ void V_UpdateModeSize (int width, int height)
|
|||
else if (w >= 1600 && w < 1920) factor = 3;
|
||||
else factor = w / 640;
|
||||
|
||||
CleanXfac_1 = CleanYfac_1 = factor;
|
||||
CleanXfac = CleanYfac = factor;
|
||||
CleanWidth = width / CleanXfac;
|
||||
CleanHeight = height / CleanYfac;
|
||||
|
||||
CleanYfac_1 = CleanXfac_1 = MAX(1, int (CleanXfac * 0.7));
|
||||
CleanWidth_1 = width / CleanXfac_1;
|
||||
CleanHeight_1 = height / CleanYfac_1;
|
||||
|
||||
|
|
@ -590,52 +591,8 @@ void V_OutputResized (int width, int height)
|
|||
|
||||
void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int realheight, int *cleanx, int *cleany, int *_cx1, int *_cx2)
|
||||
{
|
||||
float ratio;
|
||||
int cwidth;
|
||||
int cheight;
|
||||
int cx1, cy1, cx2, cy2;
|
||||
|
||||
// For larger screems always use at least a 16:9 ratio for clean factor calculation, even if the actual ratio is narrower.
|
||||
if (realwidth > 1280 && (double)realwidth / realheight < 16./9)
|
||||
{
|
||||
realheight = realwidth * 9 / 16;
|
||||
}
|
||||
|
||||
ratio = ActiveRatio(realwidth, realheight);
|
||||
if (AspectTallerThanWide(ratio))
|
||||
{
|
||||
cwidth = realwidth;
|
||||
cheight = realheight * AspectMultiplier(ratio) / 48;
|
||||
}
|
||||
else
|
||||
{
|
||||
cwidth = realwidth * AspectMultiplier(ratio) / 48;
|
||||
cheight = realheight;
|
||||
}
|
||||
// Use whichever pair of cwidth/cheight or width/height that produces less difference
|
||||
// between CleanXfac and CleanYfac.
|
||||
cx1 = MAX(cwidth / designwidth, 1);
|
||||
cy1 = MAX(cheight / designheight, 1);
|
||||
cx2 = MAX(realwidth / designwidth, 1);
|
||||
cy2 = MAX(realheight / designheight, 1);
|
||||
if (abs(cx1 - cy1) <= abs(cx2 - cy2) || MAX(cx1, cx2) >= 4)
|
||||
{ // e.g. 640x360 looks better with this.
|
||||
*cleanx = cx1;
|
||||
*cleany = cy1;
|
||||
}
|
||||
else
|
||||
{ // e.g. 720x480 looks better with this.
|
||||
*cleanx = cx2;
|
||||
*cleany = cy2;
|
||||
}
|
||||
|
||||
if (*cleanx < *cleany)
|
||||
*cleany = *cleanx;
|
||||
else
|
||||
*cleanx = *cleany;
|
||||
|
||||
if (_cx1 != NULL) *_cx1 = cx1;
|
||||
if (_cx2 != NULL) *_cx2 = cx2;
|
||||
if (designheight < 240 && realheight >= 480) designheight = 240;
|
||||
*cleanx = *cleany = std::min(realwidth / designwidth, realheight / designheight);
|
||||
}
|
||||
|
||||
bool IVideo::SetResolution ()
|
||||
|
|
@ -960,6 +917,7 @@ DEFINE_GLOBAL(SmallFont2)
|
|||
DEFINE_GLOBAL(BigFont)
|
||||
DEFINE_GLOBAL(ConFont)
|
||||
DEFINE_GLOBAL(NewConsoleFont)
|
||||
DEFINE_GLOBAL(NewSmallFont)
|
||||
DEFINE_GLOBAL(IntermissionFont)
|
||||
DEFINE_GLOBAL(CleanXfac)
|
||||
DEFINE_GLOBAL(CleanYfac)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue