From: divverent Date: Mon, 9 Jan 2012 13:29:32 +0000 (+0000) Subject: fix issues with V_CalcRefdef in CSQC and stereo view X-Git-Tag: xonotic-v0.6.0~73 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fa33875c687e5a77d5553849df1a0f80c8233c3c;p=xonotic%2Fdarkplaces.git 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 ::stable-branch::merge=a1a08700f6a730cfb11e0739e622b9ede9864b13 --- 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)