]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a serious issue with CSQC frametime being non-zero on both calls
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Jul 2013 06:42:11 +0000 (06:42 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Jul 2013 06:42:11 +0000 (06:42 +0000)
when using stereo rendering, it is now zero on the second eye so that
frametime does not lie

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11964 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
csprogs.c
render.h

index fd73d8d566a4e4b3c279d608108e278bd5543152..640cc090dea69db65a7092338545fea863402234 100644 (file)
@@ -2149,7 +2149,7 @@ static void SCR_DrawScreen (void)
                r_refdef.view.ortho_x = atan(r_refdef.view.frustum_x) * (360.0 / M_PI); // abused as angle by VM_CL_R_SetView
                r_refdef.view.ortho_y = atan(r_refdef.view.frustum_y) * (360.0 / M_PI); // abused as angle by VM_CL_R_SetView
 
-               if(!CL_VM_UpdateView())
+               if(!CL_VM_UpdateView(r_stereo_side ? 0.0 : max(0.0, cl.time - cl.oldtime)))
                        R_RenderView();
        }
 
index 9051caefe1ea2ace94e6b3cb5f2029c930e35221..36cecf839c7910678adc9b18fa1d176e00e7ea34 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -221,13 +221,13 @@ void CSQC_UpdateNetworkTimes(double newtime, double oldtime)
 }
 
 //[515]: set globals before calling R_UpdateView, WEIRD CRAP
-static void CSQC_SetGlobals (void)
+static void CSQC_SetGlobals (double frametime)
 {
        vec3_t pmove_org;
        prvm_prog_t *prog = CLVM_prog;
        CSQC_BEGIN
                PRVM_clientglobalfloat(time) = cl.time;
-               PRVM_clientglobalfloat(frametime) = max(0, cl.time - cl.oldtime);
+               PRVM_clientglobalfloat(frametime) = frametime;
                PRVM_clientglobalfloat(servercommandframe) = cls.servermovesequence;
                PRVM_clientglobalfloat(clientcommandframe) = cl.movecmd[0].sequence;
                VectorCopy(cl.viewangles, PRVM_clientglobalvector(input_angles));
@@ -460,7 +460,7 @@ qboolean CL_VM_InputEvent (int eventtype, int x, int y)
 
 extern r_refdef_view_t csqc_original_r_refdef_view;
 extern r_refdef_view_t csqc_main_r_refdef_view;
-qboolean CL_VM_UpdateView (void)
+qboolean CL_VM_UpdateView (double frametime)
 {
        prvm_prog_t *prog = CLVM_prog;
        vec3_t emptyvector;
@@ -478,7 +478,7 @@ qboolean CL_VM_UpdateView (void)
                //VectorCopy(cl.viewangles, oldangles);
                PRVM_clientglobalfloat(time) = cl.time;
                PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity];
-               CSQC_SetGlobals();
+               CSQC_SetGlobals(frametime);
                // clear renderable entity and light lists to prevent crashes if the
                // CSQC_UpdateView function does not call R_ClearScene as it should
                r_refdef.scene.numentities = 0;
index d30f1f41ef5736737c8da2a8d2de611264d20a99..090e92bc60bd3aa0df59f4160254008e5f9fd40f 100644 (file)
--- a/render.h
+++ b/render.h
@@ -607,7 +607,7 @@ void R_Model_Sprite_Draw(entity_render_t *ent);
 
 struct prvm_prog_s;
 void R_UpdateFog(void);
-qboolean CL_VM_UpdateView(void);
+qboolean CL_VM_UpdateView(double frametime);
 void SCR_DrawConsole(void);
 void R_Shadow_EditLights_DrawSelectedLightProperties(void);
 void R_DecalSystem_Reset(decalsystem_t *decalsystem);