From c746b486b7a8c3c584d45c979f1d93df22bb9884 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 16 Oct 2017 03:32:37 +0000 Subject: [PATCH] Polymost: New projection hack algorithm: Keep zoom equivalent to Classic when looking straight ahead. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6486 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/polymost.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 9c4db0906..03e33581e 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -522,8 +522,10 @@ static float get_projhack_ratio(void) { if (glprojectionhacks) { - float const mul = (gshang * gshang); - return 1.05f + mul * mul * mul * mul; + static constexpr float const projhack_zoom = 1.3f; + static constexpr float const maxcoshoriz = 0.540971179375801f; // 128/sqrt(128^2+199^2) = cos of an horiz diff of 199 + static constexpr float const factor = (projhack_zoom - 1.f) * (1.f / maxcoshoriz); + return 1.f + (factor * (1.f - Bfabsf(gchang))); } // No projection hacks (legacy or new-aspect)