- Fixed: Clean scaling at 720x480 looked borked.

SVN r602 (trunk)
This commit is contained in:
Randy Heit 2007-12-18 02:15:32 +00:00
parent c087e4d411
commit 4c8bf4552a
2 changed files with 28 additions and 3 deletions

View File

@ -1,7 +1,10 @@
December 17, 2007 December 17, 2007
- Fixed: Clean scaling at 720x480 looked borked.
- New: When using the D3D9 framebuffer, palette blending is now applied only - New: When using the D3D9 framebuffer, palette blending is now applied only
to the 3D area of the screen. This means the console and (the primary to the 3D area of the screen. This means the console and (the primary
rectangular area of) the status bar are no longer blended. rectangular area of) the status bar are no longer blended. Maybe somedays
when I'm feeling adventurous, I'll exclude all the 2D graphics from the
blending.
December 17, 2007 (Changes by Graf Zahl) December 17, 2007 (Changes by Graf Zahl)
- Fixed: When a skybox viewpoint is destroyed it should clear all - Fixed: When a skybox viewpoint is destroyed it should clear all

View File

@ -772,6 +772,11 @@ void DFrameBuffer::SetVSync (bool vsync)
{ {
} }
CCMD(clean)
{
Printf ("CleanXfac: %d\nCleanYfac: %d\n", CleanXfac, CleanYfac);
}
// //
// V_SetResolution // V_SetResolution
// //
@ -792,6 +797,7 @@ bool V_DoModeSetup (int width, int height, int bits)
int ratio; int ratio;
int cwidth; int cwidth;
int cheight; int cheight;
int cx1, cy1, cx2, cy2;
ratio = CheckRatio (width, height); ratio = CheckRatio (width, height);
if (ratio & 4) if (ratio & 4)
@ -804,8 +810,22 @@ bool V_DoModeSetup (int width, int height, int bits)
cwidth = width * BaseRatioSizes[ratio][3] / 48; cwidth = width * BaseRatioSizes[ratio][3] / 48;
cheight = height; cheight = height;
} }
CleanXfac = MAX (cwidth / 320, 1); // Use whichever pair of cwidth/cheight or width/height that produces less difference
CleanYfac = MAX (cheight / 200, 1); // between CleanXfac and CleanYfac.
cx1 = MAX(cwidth / 320, 1);
cy1 = MAX(cheight / 200, 1);
cx2 = MAX(width / 320, 1);
cy2 = MAX(height / 200, 1);
if (abs(cx1 - cy1) <= abs(cx2 - cy2))
{ // e.g. 640x360 looks better with this.
CleanXfac = cx1;
CleanYfac = cy1;
}
else
{ // e.g. 720x480 looks better with this.
CleanXfac = cx2;
CleanYfac = cy2;
}
} }
if (CleanXfac > 1 && CleanYfac > 1 && CleanXfac != CleanYfac) if (CleanXfac > 1 && CleanYfac > 1 && CleanXfac != CleanYfac)
@ -818,6 +838,8 @@ bool V_DoModeSetup (int width, int height, int bits)
CleanWidth = width / CleanXfac; CleanWidth = width / CleanXfac;
CleanHeight = height / CleanYfac; CleanHeight = height / CleanYfac;
assert(CleanWidth >= 320);
assert(CleanHeight >= 200);
DisplayWidth = width; DisplayWidth = width;
DisplayHeight = height; DisplayHeight = height;