Restucture dorotspr_handle_bit2().

This also fixes the OSD with aspects < 4/3. I broke that, too.

git-svn-id: https://svn.eduke32.com/eduke32@2927 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-08-19 12:55:45 +00:00
parent d83de40608
commit b07b540c0b
1 changed files with 54 additions and 66 deletions

View File

@ -6851,24 +6851,34 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da
int32_t cx1_plus_cx2, int32_t cy1_plus_cy2,
int32_t *ret_yxaspect, int32_t *ret_xyaspect)
{
int32_t x, sx, sy;
int32_t ouryxaspect = yxaspect, ourxyaspect = xyaspect;
if ((dastat&2) == 0)
{
if (!(dastat & 1024) && 4*ydim <= 3*xdim)
{
*ret_yxaspect = (12<<16)/10;
*ret_xyaspect = (1LL<<32)/ouryxaspect;
*ret_xyaspect = ((1<<16)*10)/12;
// *sxptr and *syptr and *z are left unchanged
return;
}
return;
}
else
{
// dastat&2: Auto window size scaling
const int32_t oxdim = xdim;
int32_t xdim = oxdim; // SHADOWS global
sx = *sxptr;
sy = *syptr;
int32_t x, sx=*sxptr, sy=*syptr;
int32_t ouryxaspect = yxaspect, ourxyaspect = xyaspect;
if (!(dastat & 1024) && 4*ydim <= 3*xdim)
{
xdim = (4*ydim)/3;
ouryxaspect = (12<<16)/10;
ourxyaspect = ((1<<16)*10)/12;
}
// nasty hacks go here
if (!(dastat&8))
@ -6876,20 +6886,8 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da
const int32_t cxs = cx1_plus_cx2+2;
int32_t sthelse;
const int32_t oxdim = xdim;
int32_t xdim = oxdim; // SHADOWS global
x = xdimenscale; //= scale(xdimen,yxaspect,320);
if (!(dastat & 1024) && 4*ydim <= 3*xdim)
{
xdim = (4*ydim)/3;
// ouryxaspect is divscale16(ydim*320, xdim*200)
ouryxaspect = (12<<16)/10;
ourxyaspect = (1LL<<32)/ouryxaspect;
}
sthelse = scale(sx-(320<<15), scale(xdimen, xdim, oxdim), 320);
{
@ -6913,17 +6911,6 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da
//If not clipping to startmosts, & auto-scaling on, as a
//hard-coded bonus, scale to full screen instead
const int32_t oxdim = xdim;
int32_t xdim = oxdim; // SHADOWS global
if (!(dastat & 1024) && 4*ydim <= 3*xdim)
{
xdim = (4*ydim)/3;
ouryxaspect = (12<<16)/10;
ourxyaspect = (1LL<<32)/ouryxaspect;
}
x = scale(xdim,ouryxaspect,320);
sx = (xdim<<15)+32768 + scale(sx-(320<<15),xdim,320);
sy = (ydim<<15)+32768 + mulscale16(sy-(200<<15),x);
@ -6940,6 +6927,7 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da
*ret_yxaspect = ouryxaspect;
*ret_xyaspect = ourxyaspect;
}
}