From 755adb0c46e0bb0dba1bb876fe155e962d9ca016 Mon Sep 17 00:00:00 2001 From: Hanicef Date: Sat, 30 Mar 2024 17:58:27 +0100 Subject: [PATCH 1/3] Fix vertical aim being off when using lack of perspective --- src/hardware/hw_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index f533082f7..d764e2bb1 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5221,7 +5221,7 @@ static void HWR_SetTransformAiming(FTransform *trans, player_t *player, boolean if (cv_glshearing.value == 1 || (cv_glshearing.value == 2 && R_IsViewpointThirdPerson(player, skybox))) { fixed_t fixedaiming = AIMINGTODY(aimingangle); - trans->viewaiming = FIXED_TO_FLOAT(fixedaiming); + trans->viewaiming = FIXED_TO_FLOAT(fixedaiming) * (vid.width / vid.height) / (BASEVIDWIDTH / BASEVIDHEIGHT); trans->shearing = true; gl_aimingangle = 0; } From de74137cae75de891194be808936893b82bd9a1e Mon Sep 17 00:00:00 2001 From: Hanicef Date: Sat, 30 Mar 2024 21:10:09 +0100 Subject: [PATCH 2/3] Use float for calculating aspect ratio --- src/hardware/hw_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d764e2bb1..0771708eb 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5221,7 +5221,7 @@ static void HWR_SetTransformAiming(FTransform *trans, player_t *player, boolean if (cv_glshearing.value == 1 || (cv_glshearing.value == 2 && R_IsViewpointThirdPerson(player, skybox))) { fixed_t fixedaiming = AIMINGTODY(aimingangle); - trans->viewaiming = FIXED_TO_FLOAT(fixedaiming) * (vid.width / vid.height) / (BASEVIDWIDTH / BASEVIDHEIGHT); + trans->viewaiming = FIXED_TO_FLOAT(fixedaiming) * ((float)vid.width / vid.height) / ((float)BASEVIDWIDTH / BASEVIDHEIGHT); trans->shearing = true; gl_aimingangle = 0; } From f8650a17a0f5b6d31dbb462457378a2e96477d64 Mon Sep 17 00:00:00 2001 From: Hanicef Date: Sun, 28 Apr 2024 16:21:48 +0200 Subject: [PATCH 3/3] Fix aim in splitscreen --- src/hardware/hw_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 0771708eb..376639878 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5222,6 +5222,8 @@ static void HWR_SetTransformAiming(FTransform *trans, player_t *player, boolean { fixed_t fixedaiming = AIMINGTODY(aimingangle); trans->viewaiming = FIXED_TO_FLOAT(fixedaiming) * ((float)vid.width / vid.height) / ((float)BASEVIDWIDTH / BASEVIDHEIGHT); + if (splitscreen) + trans->viewaiming *= 2.125; // splitscreen adjusts fov with 0.8, so compensate (but only halfway, since splitscreen means only half the screen is used) trans->shearing = true; gl_aimingangle = 0; }