Keep values in floats longer for visplane drawing
This commit is contained in:
parent
96228ca15f
commit
8f3921190f
3 changed files with 74 additions and 64 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue