Skip to content

Commit

Permalink
Fix skies being shifted down a few pixels compared to Woof 12.0.2.
Browse files Browse the repository at this point in the history
Use old sky calculation for default FOV and reduce rounding error for custom FOV.
  • Loading branch information
ceski-1 committed Mar 20, 2024
1 parent 8c2cb3b commit 316afb6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,14 @@ void R_ExecuteSetViewSize (void)
while (FixedMul(pspriteiscale, pspritescale) < FRACUNIT)
pspriteiscale++;

skyiscale = FixedDiv(160 << FRACBITS, focallength);
if (custom_fov == FOV_DEFAULT)
{
skyiscale = FixedDiv(SCREENWIDTH, viewwidth_nonwide);
}
else
{
skyiscale = tan(custom_fov * M_PI / 360.0) * SCREENWIDTH / viewwidth_nonwide * FRACUNIT;
}

for (i=0 ; i<viewwidth ; i++)
{
Expand Down

0 comments on commit 316afb6

Please sign in to comment.