Remove linear sky again

This commit is contained in:
Magnus Norddahl 2016-08-06 21:04:45 +02:00
parent 9953d70eaa
commit 21390e91b8

View file

@ -880,30 +880,16 @@ static DWORD lastskycol_bgra[4];
static int skycolplace;
static int skycolplace_bgra;
CVAR(Bool, r_linearsky, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
// Get a column of sky when there is only one sky texture.
static const BYTE *R_GetOneSkyColumn (FTexture *fronttex, int x)
{
int tx;
if (r_linearsky)
{
angle_t xangle = (angle_t)((0.5 - x / (double)viewwidth) * FocalTangent * ANGLE_90);
angle_t column = (skyangle + xangle) ^ skyflip;
tx = (UMulScale16(column, frontcyl) + frontpos) >> FRACBITS;
}
else
{
angle_t column = (skyangle + xtoviewangle[x]) ^ skyflip;
tx = (UMulScale16(column, frontcyl) + frontpos) >> FRACBITS;
}
angle_t column = (skyangle + xtoviewangle[x]) ^ skyflip;
int tx = (UMulScale16(column, frontcyl) + frontpos) >> FRACBITS;
if (!r_swtruecolor)
return fronttex->GetColumn(tx, NULL);
else
{
return (const BYTE *)fronttex->GetColumnBgra(tx, NULL);
}
}
// Get a column of sky when there are two overlapping sky textures