Keep values in floats longer for visplane drawing

This commit is contained in:
Randy Heit 2016-04-28 21:07:58 -05:00
commit 8f3921190f
3 changed files with 74 additions and 64 deletions

View file

@ -501,63 +501,61 @@ void R_SetupColormap(player_t *player)
void R_SetupFreelook()
{
{
double dy;
double dy;
if (camera != NULL)
if (camera != NULL)
{
dy = FocalLengthY * (-ViewPitch).Tan();
}
else
{
dy = 0;
}
CenterY = (viewheight / 2.0) + dy;
centery = xs_ToInt(CenterY);
globaluclip = -CenterY / InvZtoScale;
globaldclip = (viewheight - CenterY) / InvZtoScale;
//centeryfrac &= 0xffff0000;
int e, i;
i = 0;
e = viewheight;
float focus = float(FocalLengthY);
float den;
float cy = float(CenterY);
if (i < centery)
{
den = cy - i - 0.5f;
if (e <= centery)
{
dy = FocalLengthY * (-ViewPitch).Tan();
}
else
{
dy = 0;
}
CenterY = (viewheight / 2.0) + dy;
centery = xs_ToInt(CenterY);
globaluclip = -CenterY / InvZtoScale;
globaldclip = (viewheight - CenterY) / InvZtoScale;
//centeryfrac &= 0xffff0000;
int e, i;
i = 0;
e = viewheight;
float focus = float(FocalLengthY);
float den;
float cy = float(CenterY);
if (i < centery)
{
den = cy - i - 0.5f;
if (e <= centery)
{
do {
yslope[i] = FLOAT2FIXED(focus / den);
den -= 1;
} while (++i < e);
}
else
{
do {
yslope[i] = FLOAT2FIXED(focus / den);
den -= 1;
} while (++i < centery);
den = i - cy + 0.5f;
do {
yslope[i] = FLOAT2FIXED(focus / den);
den += 1;
} while (++i < e);
}
do {
yslope[i] = focus / den;
den -= 1;
} while (++i < e);
}
else
{
do {
yslope[i] = focus / den;
den -= 1;
} while (++i < centery);
den = i - cy + 0.5f;
do {
yslope[i] = FLOAT2FIXED(focus / den);
yslope[i] = focus / den;
den += 1;
} while (++i < e);
}
}
else
{
den = i - cy + 0.5f;
do {
yslope[i] = focus / den;
den += 1;
} while (++i < e);
}
}
//==========================================================================