From 8dc8a40871294eb4463f3447955b132ea74b0df1 Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 9 Jan 2012 13:29:32 +0000 Subject: [PATCH] fix issues with V_CalcRefdef in CSQC and stereo view git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11641 d7cf8633-e32d-0410-b094-e92efae38249 --- client.h | 1 + view.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client.h b/client.h index 711bb3dd..c7541f52 100644 --- a/client.h +++ b/client.h @@ -996,6 +996,7 @@ typedef struct client_state_s float bob2_smooth; float bobfall_speed; float bobfall_swing; + double calcrefdef_prevtime; // don't change view angle, full screen, etc int intermission; diff --git a/view.c b/view.c index 559ab97e..770f85f9 100644 --- a/view.c +++ b/view.c @@ -446,6 +446,7 @@ static void highpass3_limited(vec3_t value, vec_t fracx, vec_t limitx, vec_t fra * cl.oldongrounbd * cl.stairsmoothtime * cl.stairsmoothz + * cl.calcrefdef_prevtime * Extra input: * cl.movecmd[0].time * cl.movevars_stepheight @@ -490,6 +491,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa cl.lastongroundtime = cl.movecmd[0].time; } cl.oldonground = clonground; + cl.calcrefdef_prevtime = max(cl.calcrefdef_prevtime, cl.oldtime); VectorClear(gunorg); viewmodelmatrix_nobob = identitymatrix; @@ -548,7 +550,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa // apply the viewofs (even if chasecam is used) // Samual: Lets add smoothing for this too so that things like crouching are done with a transition. - viewheight = bound(0, (cl.time - cl.oldtime) / max(0.0001, cl_smoothviewheight.value), 1); + viewheight = bound(0, (cl.time - cl.calcrefdef_prevtime) / max(0.0001, cl_smoothviewheight.value), 1); viewheightavg = viewheightavg * (1 - viewheight) + clstatsviewheight * viewheight; vieworg[2] += viewheightavg; @@ -657,7 +659,7 @@ void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewa float cycle; vec_t frametime; - frametime = (cl.time - cl.oldtime) * cl.movevars_timescale; + frametime = (cl.time - cl.calcrefdef_prevtime) * cl.movevars_timescale; // 1. if we teleported, clear the frametime... the lowpass will recover the previous value then if(teleported) -- 2.39.2