From bdfd8cda7da7f67b66e1406ac69034fd30bf3e34 Mon Sep 17 00:00:00 2001 From: kanthoney Date: Mon, 27 Jul 2015 17:15:17 +0100 Subject: [PATCH] Make scanner V work for different FOV when aspect ratio is less than 4:3 --- src/Core/HeadUpDisplay.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Core/HeadUpDisplay.m b/src/Core/HeadUpDisplay.m index 4e2c0229..be277695 100644 --- a/src/Core/HeadUpDisplay.m +++ b/src/Core/HeadUpDisplay.m @@ -4097,6 +4097,8 @@ static void drawScannerGrid(GLfloat x, GLfloat y, GLfloat z, NSSize siz, int v_d { OOSetOpenGLState(OPENGL_STATE_OVERLAY); + MyOpenGLView* gameView = [UNIVERSE gameView]; + GLfloat w1, h1; GLfloat ww = 0.5 * siz.width; GLfloat hh = 0.5 * siz.height; @@ -4190,7 +4192,12 @@ static void drawScannerGrid(GLfloat x, GLfloat y, GLfloat z, NSSize siz, int v_d } } - double tanfov = [[UNIVERSE gameView] fov:YES]; + double tanfov = [gameView fov:YES]; + GLfloat aspect = [gameView viewSize].width / [gameView viewSize].height; + if (aspect < 4.0/3.0) + { + tanfov *= 0.75 * aspect; + } double cosfov = 1.0/sqrt(1+tanfov*tanfov); double sinfov = tanfov * cosfov;