mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 15:52:09 +00:00
Revert "Remove linear sky again"
This reverts commit 21390e91b8
.
- also set r_linearsky to "false" by default.
This commit is contained in:
parent
ddbdb55eca
commit
f9795a2533
1 changed files with 16 additions and 2 deletions
|
@ -859,16 +859,30 @@ static DWORD lastskycol_bgra[4];
|
||||||
static int skycolplace;
|
static int skycolplace;
|
||||||
static int skycolplace_bgra;
|
static int skycolplace_bgra;
|
||||||
|
|
||||||
|
CVAR(Bool, r_linearsky, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||||
|
|
||||||
// Get a column of sky when there is only one sky texture.
|
// Get a column of sky when there is only one sky texture.
|
||||||
static const BYTE *R_GetOneSkyColumn (FTexture *fronttex, int x)
|
static const BYTE *R_GetOneSkyColumn (FTexture *fronttex, int x)
|
||||||
{
|
{
|
||||||
angle_t column = (skyangle + xtoviewangle[x]) ^ skyflip;
|
int tx;
|
||||||
int tx = (UMulScale16(column, frontcyl) + frontpos) >> FRACBITS;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
if (!r_swtruecolor)
|
if (!r_swtruecolor)
|
||||||
return fronttex->GetColumn(tx, NULL);
|
return fronttex->GetColumn(tx, NULL);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return (const BYTE *)fronttex->GetColumnBgra(tx, NULL);
|
return (const BYTE *)fronttex->GetColumnBgra(tx, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a column of sky when there are two overlapping sky textures
|
// Get a column of sky when there are two overlapping sky textures
|
||||||
|
|
Loading…
Reference in a new issue