From f4f2690f52e06003a94f16eb60abe0f8d3776099 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 26 Jan 2005 22:11:07 +0000 Subject: [PATCH] fixed fov calculations so viewzoom isn't so weird anymore, this also fixes the 'double zoom' bug (viewzoom was being applied twice) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4970 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_backend.c | 6 +++--- gl_draw.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gl_backend.c b/gl_backend.c index 77269a94..0fa1f802 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -1473,8 +1473,8 @@ void SCR_DrawScreen (void) } // LordHavoc: viewzoom (zoom in for sniper rifles, etc) - r_refdef.fov_x = scr_fov.value * cl.viewzoom * r_refdef.fovscale_x; - r_refdef.fov_y = CalcFov (r_refdef.fov_x, r_refdef.width, r_refdef.height) * r_refdef.fovscale_y; + r_refdef.fov_x = scr_fov.value * r_refdef.fovscale_x; + r_refdef.fov_y = CalcFov (scr_fov.value, r_refdef.width, r_refdef.height) * r_refdef.fovscale_y; R_RenderView(); @@ -1487,7 +1487,7 @@ void SCR_DrawScreen (void) r_refdef.x = (vid.realwidth - r_refdef.width)/2; r_refdef.y = 0; r_refdef.fov_x = scr_zoomwindow_fov.value * r_refdef.fovscale_x; - r_refdef.fov_y = CalcFov(r_refdef.fov_x, r_refdef.width, r_refdef.height) * r_refdef.fovscale_y; + r_refdef.fov_y = CalcFov(scr_zoomwindow_fov.value, r_refdef.width, r_refdef.height) * r_refdef.fovscale_y; R_RenderView(); } diff --git a/gl_draw.c b/gl_draw.c index 378bf682..65c6a835 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -477,8 +477,8 @@ void R_DrawQueue(void) r_view_x = bound(0, r_refdef.x, vid.realwidth - r_refdef.width); r_view_y = bound(0, r_refdef.y, vid.realheight - r_refdef.height); r_view_z = 0; - r_view_fov_x = bound(1, r_refdef.fov_x, 170); - r_view_fov_y = bound(1, r_refdef.fov_y, 170); + r_view_fov_x = bound(0.1, r_refdef.fov_x, 170); + r_view_fov_y = bound(0.1, r_refdef.fov_y, 170); r_view_matrix = r_refdef.viewentitymatrix; GL_ColorMask(r_refdef.colormask[0], r_refdef.colormask[1], r_refdef.colormask[2], 1); @@ -502,7 +502,7 @@ void R_DrawQueue(void) { dq = (drawqueue_t *)(r_refdef.drawqueue + pos); color = dq->color; - + if(dq->flags == DRAWFLAG_ADDITIVE) GL_BlendFunc(GL_SRC_ALPHA, GL_ONE); else if(dq->flags == DRAWFLAG_MODULATE) @@ -593,7 +593,7 @@ void R_DrawQueue(void) // We have to convert the con coords into real coords int x , y, width, height; x = dq->x * ((float)vid.realwidth / vid.conwidth); - // OGL uses top to bottom + // OGL uses top to bottom y = dq->y * ((float) vid.realheight / vid.conheight); width = dq->scalex * ((float)vid.realwidth / vid.conwidth); height = dq->scaley * ((float)vid.realheight / vid.conheight); @@ -605,7 +605,7 @@ void R_DrawQueue(void) break; case DRAWQUEUE_RESETCLIP: GL_ScissorTest(false); - break; + break; } } -- 2.39.2