]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
reworked most of q3bsp q3 shader loading, now supports more shader effects (the first...
[xonotic/darkplaces.git] / cl_input.c
index 78513ec43b36abe8b21ca23318e2ed390f16af42..cff67be27fa6e2e5e3e0c81ee7c4f2dbcd12b907 100644 (file)
@@ -304,9 +304,9 @@ void CL_AdjustAngles (void)
        float   up, down;
 
        if (in_speed.state & 1)
-               speed = host_realframetime * cl_anglespeedkey.value;
+               speed = cl.realframetime * cl_anglespeedkey.value;
        else
-               speed = host_realframetime;
+               speed = cl.realframetime;
 
        if (!(in_strafe.state & 1))
        {
@@ -510,8 +510,6 @@ void CL_UpdatePrydonCursor(void)
        Matrix4x4_Transform(&r_refdef.viewentitymatrix, temp, cl.cmd.cursor_end);
        // trace from view origin to the cursor
        cl.cmd.cursor_fraction = CL_SelectTraceLine(cl.cmd.cursor_start, cl.cmd.cursor_end, cl.cmd.cursor_impact, cl.cmd.cursor_normal, &cl.cmd.cursor_entitynumber, (chase_active.integer || cl.intermission) ? &cl.entities[cl.playerentity].render : NULL, false);
-       // makes sparks where cursor is
-       //CL_SparkShower(cl.cmd.cursor_impact, cl.cmd.cursor_normal, 5, 0);
 }
 
 void CL_ClientMovement_InputQW(qw_usercmd_t *cmd)
@@ -848,16 +846,19 @@ void CL_ClientMovement_Replay(void)
                                                VectorSet(currentorigin2, currentorigin[0], currentorigin[1], currentorigin[2] + movevars_stepheight);
                                                VectorSet(neworigin2, neworigin[0], neworigin[1], currentorigin[2] + movevars_stepheight);
                                                trace2 = CL_TraceBox(currentorigin2, playermins, playermaxs, neworigin2, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP, true);
-                                               // then move down from there
-                                               VectorCopy(trace2.endpos, currentorigin2);
-                                               VectorSet(neworigin2, trace2.endpos[0], trace2.endpos[1], currentorigin[2]);
-                                               trace3 = CL_TraceBox(currentorigin2, playermins, playermaxs, neworigin2, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP, true);
-                                               //Con_Printf("%f %f %f %f : %f %f %f %f : %f %f %f %f\n", trace.fraction, trace.endpos[0], trace.endpos[1], trace.endpos[2], trace2.fraction, trace2.endpos[0], trace2.endpos[1], trace2.endpos[2], trace3.fraction, trace3.endpos[0], trace3.endpos[1], trace3.endpos[2]);
-                                               // accept the new trace if it made some progress
-                                               if (fabs(trace3.endpos[0] - trace.endpos[0]) >= 0.03125 || fabs(trace3.endpos[1] - trace.endpos[1]) >= 0.03125)
+                                               if (!trace2.startsolid)
                                                {
-                                                       trace = trace2;
-                                                       VectorCopy(trace3.endpos, trace.endpos);
+                                                       // then move down from there
+                                                       VectorCopy(trace2.endpos, currentorigin2);
+                                                       VectorSet(neworigin2, trace2.endpos[0], trace2.endpos[1], currentorigin[2]);
+                                                       trace3 = CL_TraceBox(currentorigin2, playermins, playermaxs, neworigin2, true, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP, true);
+                                                       //Con_Printf("%f %f %f %f : %f %f %f %f : %f %f %f %f\n", trace.fraction, trace.endpos[0], trace.endpos[1], trace.endpos[2], trace2.fraction, trace2.endpos[0], trace2.endpos[1], trace2.endpos[2], trace3.fraction, trace3.endpos[0], trace3.endpos[1], trace3.endpos[2]);
+                                                       // accept the new trace if it made some progress
+                                                       if (fabs(trace3.endpos[0] - trace.endpos[0]) >= 0.03125 || fabs(trace3.endpos[1] - trace.endpos[1]) >= 0.03125)
+                                                       {
+                                                               trace = trace2;
+                                                               VectorCopy(trace3.endpos, trace.endpos);
+                                                       }
                                                }
                                        }
                                        if (trace.fraction == 1)
@@ -1194,8 +1195,8 @@ void CL_SendMove(void)
                                MSG_WriteByte (&buf, impulse);
                                // PRYDON_CLIENTCURSOR
                                // 30 bytes
-                               MSG_WriteShort (&buf, cl.cmd.cursor_screen[0] * 32767.0f);
-                               MSG_WriteShort (&buf, cl.cmd.cursor_screen[1] * 32767.0f);
+                               MSG_WriteShort (&buf, (short)(cl.cmd.cursor_screen[0] * 32767.0f));
+                               MSG_WriteShort (&buf, (short)(cl.cmd.cursor_screen[1] * 32767.0f));
                                MSG_WriteFloat (&buf, cl.cmd.cursor_start[0]);
                                MSG_WriteFloat (&buf, cl.cmd.cursor_start[1]);
                                MSG_WriteFloat (&buf, cl.cmd.cursor_start[2]);