Revert r6496

git-svn-id: https://svn.eduke32.com/eduke32@6523 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-11-30 02:57:23 +00:00
parent 5de5dc9fcd
commit 90045e4ce3
1 changed files with 5 additions and 7 deletions

View File

@ -582,10 +582,10 @@ static float get_projhack_ratio(void)
{
if (glprojectionhacks)
{
// tangent of ((angle of 4 by 3) + (angle of 128 by 199)) / tangent of 90
static constexpr float const projhack_constant = 1.166015625f;
float const projhack = 65536.f / fviewingrange;
return projhack_constant > projhack ? projhack_constant : projhack;
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)
@ -625,10 +625,8 @@ static void resizeglcheck(void)
const int32_t ourxdimen = (windowxy2.x-windowxy1.x+1);
float ratio = get_projhack_ratio();
const int32_t fovcorrect = (int32_t)(ourxdimen*ratio - ourxdimen);
viewingrange = Blrintf(fviewingrange *= ratio);
float const halfydimen = fydimen * 0.5f;
ratio = 1.f/ratio;
globalhoriz = ((globalhoriz - halfydimen) * ratio) + halfydimen;
glox1 = (float)windowxy1.x; gloy1 = (float)windowxy1.y;
glox2 = (float)windowxy2.x; gloy2 = (float)windowxy2.y;