- Add 17:10 aspect ratio, for 1024x600 screens.

SVN r3482 (trunk)
This commit is contained in:
Randy Heit 2012-03-25 02:57:28 +00:00
commit 23e88c88c9
6 changed files with 51 additions and 24 deletions

View file

@ -1635,16 +1635,25 @@ CUSTOM_CVAR (Int, vid_aspect, 0, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
// 0: 4:3
// 1: 16:9
// 2: 16:10
// 3: 17:10
// 4: 5:4
int CheckRatio (int width, int height, int *trueratio)
{
int fakeratio = -1;
int ratio;
if ((vid_aspect >=1) && (vid_aspect <=4))
if ((vid_aspect >= 1) && (vid_aspect <= 5))
{
// [SP] User wants to force aspect ratio; let them.
fakeratio = vid_aspect == 3? 0: int(vid_aspect);
fakeratio = int(vid_aspect);
if (fakeratio == 3)
{
fakeratio = 0;
}
else if (fakeratio == 5)
{
fakeratio = 3;
}
}
if (vid_nowidescreen)
{
@ -1662,6 +1671,11 @@ int CheckRatio (int width, int height, int *trueratio)
{
ratio = 1;
}
// Consider 17:10 as well.
else if (abs (height * 17/10 - width) < 10)
{
ratio = 3;
}
// 16:10 has more variance in the pixel dimensions. Grr.
else if (abs (height * 16/10 - width) < 60)
{
@ -1680,7 +1694,7 @@ int CheckRatio (int width, int height, int *trueratio)
{
ratio = 4;
}
// Assume anything else is 4:3.
// Assume anything else is 4:3. (Which is probably wrong these days...)
else
{
ratio = 0;
@ -1693,16 +1707,21 @@ int CheckRatio (int width, int height, int *trueratio)
return (fakeratio >= 0) ? fakeratio : ratio;
}
// First column: Base width (unused)
// First column: Base width
// Second column: Base height (used for wall visibility multiplier)
// Third column: Psprite offset (needed for "tallscreen" modes)
// Fourth column: Width or height multiplier
// For widescreen aspect ratio x:y ...
// base_width = 240 * x / y
// multiplier = 320 / base_width
// base_height = 200 * multiplier
const int BaseRatioSizes[5][4] =
{
{ 960, 600, 0, 48 }, // 4:3 320, 200, multiplied by three
{ 1280, 450, 0, 48*3/4 }, // 16:9 426.6667, 150, multiplied by three
{ 1152, 500, 0, 48*5/6 }, // 16:10 386, 166.6667, multiplied by three
{ 960, 600, 0, 48 },
{ 1224, 471, 0, 48*40/51 }, // 17:10 408, 156.8627, multiplied by three
{ 960, 640, (int)(6.5*FRACUNIT), 48*15/16 } // 5:4 320, 213.3333, multiplied by three
};