cvar_t cl_nodelta = {0, "cl_nodelta", "0", "disables delta compression of non-player entities in QW network protocol"};
+cvar_t cl_csqc_generatemousemoveevents = {0, "cl_csqc_generatemousemoveevents", "1", "enables calls to CSQC_InputEvent with type 2, for compliance with EXT_CSQC spec"};
+
extern cvar_t v_flipped;
/*
Send the intended movement message to the server
================
*/
+extern qboolean CL_VM_InputEvent (int eventtype, int x, int y);
void CL_Input (void)
{
float mx, my;
// allow mice or other external controllers to add to the move
IN_Move ();
+ // send mouse move to csqc
+ if (cl.csqc_loaded && cl_csqc_generatemousemoveevents.integer)
+ {
+ if (cl.csqc_wantsmousemove)
+ {
+ // event type 3 is a DP_CSQC thing
+ static int oldwindowmouse[2];
+ if (oldwindowmouse[0] != in_windowmouse_x || oldwindowmouse[1] != in_windowmouse_y)
+ {
+ CL_VM_InputEvent(3, in_windowmouse_x * vid_conwidth.integer / vid.width, in_windowmouse_y * vid_conheight.integer / vid.height);
+ oldwindowmouse[0] = in_windowmouse_x;
+ oldwindowmouse[1] = in_windowmouse_y;
+ }
+ }
+ else
+ {
+ if (in_mouse_x || in_mouse_y)
+ CL_VM_InputEvent(2, in_mouse_x * vid_conwidth.integer / vid.width, in_mouse_y * vid_conheight.integer / vid.height);
+ }
+ }
+
// apply m_accelerate if it is on
if(m_accelerate.value > 1)
{
}
else
{
- /*
- f = log(averagespeed);
- mi = log(mi);
- ma = log(ma);
- */
f = averagespeed;
- mi = mi;
- ma = ma;
f = (f - mi) / (ma - mi) * (m_accelerate.value - 1) + 1;
}
// released at least once since the last jump
if (s->cmd.jump)
{
- if (s->onground && (s->cmd.canjump || !cl_movement_track_canjump.integer)) // FIXME remove this cvar again when canjump logic actually works, or maybe keep it for mods that allow "pogo-ing"
+ if (s->onground && (s->cmd.canjump || !cl_movement_track_canjump.integer))
{
s->velocity[2] += cl.movevars_jumpvelocity;
s->onground = false;
s.cmd = cl.movecmd[i];
if (i < CL_MAX_USERCMDS - 1)
s.cmd.canjump = cl.movecmd[i+1].canjump;
+
// if a move is more than 50ms, do it as two moves (matching qwsv)
//Con_Printf("%i ", s.cmd.msec);
if(s.cmd.frametime > 0.0005)
CL_ClientMovement_PlayerMove(&s);
cl.movecmd[i].canjump = s.cmd.canjump;
}
+ else
+ {
+ // we REALLY need this handling to happen, even if the move is not executed
+ if (!cl.movecmd[i].jump)
+ cl.movecmd[i].canjump = true;
+ }
}
//Con_Printf("\n");
CL_ClientMovement_UpdateStatus(&s);
cl.cmd.forwardmove = cl.cmd.sidemove = cl.cmd.upmove = cl.cmd.impulse = cl.cmd.buttons = 0;
cl.cmd.jump = (cl.cmd.buttons & 2) != 0;
+ cl.cmd.canjump = cl.movecmd[0].canjump;
cl.cmd.crouch = 0;
switch (cls.protocol)
{
Cvar_RegisterVariable(&cl_netimmediatebuttons);
Cvar_RegisterVariable(&cl_nodelta);
+
+ Cvar_RegisterVariable(&cl_csqc_generatemousemoveevents);
}