From cdbea0be26067a5774778ba51a18df7aa661ce80 Mon Sep 17 00:00:00 2001
From: fickleheart <fickle@tinted.red>
Date: Tue, 14 Jan 2020 23:30:39 -0600
Subject: [PATCH] Revert "LMAO fisheye"

This reverts commit cd957d84f7332fc71ebd1924aaa2b533684cc07d.
---
 src/r_main.c | 29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/src/r_main.c b/src/r_main.c
index 6efc7d99bf..fbb3c70470 100644
--- a/src/r_main.c
+++ b/src/r_main.c
@@ -564,7 +564,7 @@ static struct {
 void R_CheckViewMorph(void)
 {
 	float zoomfactor, rollcos, rollsin;
-	float x1, y1, x2, y2, fisheyef;
+	float x1, y1, x2, y2;
 	fixed_t temp;
 	size_t end, vx, vy, pos, usedpos;
 	INT32 usedx, usedy, halfwidth = vid.width/2, halfheight = vid.height/2;
@@ -574,14 +574,14 @@ void R_CheckViewMorph(void)
 
 	// temp values
 	//angle_t rollangle = leveltime << (ANGLETOFINESHIFT);
-	fixed_t fisheye = FRACUNIT;
+	fixed_t fisheye = 0;
 
 	rollangle >>= ANGLETOFINESHIFT;
 	rollangle = (((rollangle+1)/2)*2) & FINEMASK; // Limit the distinct number of angles to reduce recalcs from angles changing a lot.
 
 	fisheye &= ~0xFF; // Same limiter logic for fisheye
 
-	if (rollangle == viewmorph.rollangle && fisheye == viewmorph.fisheye && viewmorph.scrmapsize == vid.width*vid.height)
+	if (rollangle == viewmorph.rollangle && fisheye == viewmorph.fisheye)
 		return; // No change
 
 	viewmorph.rollangle = rollangle;
@@ -614,13 +614,6 @@ void R_CheckViewMorph(void)
 	x1 = (vid.width*fabsf(rollcos) + vid.height*fabsf(rollsin)) / vid.width;
 	y1 = (vid.height*fabsf(rollcos) + vid.width*fabsf(rollsin)) / vid.height;
 
-	if (fisheye)
-	{
-		float dist = powf(2, (fisheyef = FIXED_TO_FLOAT(fisheye))/2);
-		x1 *= dist;
-		y1 *= dist;
-	}
-
 	temp = max(x1, y1)*FRACUNIT;
 	if (temp < FRACUNIT)
 		temp = FRACUNIT;
@@ -659,20 +652,8 @@ void R_CheckViewMorph(void)
 
 		for (vx = 0; vx < vid.width; vx++)
 		{
-			if (fisheye)
-			{
-				float dist = sqrtf(x2*x2 + y2*y2) * zoomfactor / sqrtf(halfwidth*halfwidth + halfheight*halfheight);
-				dist += (1 - sqrtf(1 - dist*dist)) / dist;
-				dist = powf(dist, fisheyef);
-				usedx = halfwidth+x2*dist;
-				usedy = halfheight+y2*dist;
-
-			}
-			else
-			{
-				usedx = halfwidth+x2;
-				usedy = halfheight+y2;
-			}
+			usedx = halfwidth+x2;
+			usedy = halfheight+y2;
 
 			if (usedx < 0) usedx = 0;
 			else if (usedx >= vid.width) usedx = vid.width-1;
-- 
GitLab