From 316afb6cfe14b34945d44a7f202c9f5a12293bd3 Mon Sep 17 00:00:00 2001 From: ceski <56656010+ceski-1@users.noreply.github.com> Date: Wed, 20 Mar 2024 03:43:10 -0700 Subject: [PATCH] Fix skies being shifted down a few pixels compared to Woof 12.0.2. Use old sky calculation for default FOV and reduce rounding error for custom FOV. --- src/r_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/r_main.c b/src/r_main.c index 67de85026..5c51cd5aa 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -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