]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
Fix drawline and sound builtin parameters
[xonotic/darkplaces.git] / cl_input.c
index 7779cae3d6e348242fcbed08ea4a548ea076c6ca..8ccd3477dc24cc14c307d4243c624270ceeb3b66 100644 (file)
@@ -398,11 +398,15 @@ cvar_t cl_nopred = {CVAR_CLIENT | CVAR_SAVE, "cl_nopred", "0", "(QWSV only) disa
 cvar_t in_pitch_min = {CVAR_CLIENT, "in_pitch_min", "-90", "how far you can aim upward (quake used -70)"};
 cvar_t in_pitch_max = {CVAR_CLIENT, "in_pitch_max", "90", "how far you can aim downward (quake used 80)"};
 
-cvar_t m_filter = {CVAR_CLIENT | CVAR_SAVE, "m_filter","0", "smoothes mouse movement, less responsive but smoother aiming"};
-cvar_t m_accelerate = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate","1", "mouse acceleration factor (try 2)"};
-cvar_t m_accelerate_minspeed = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_minspeed","5000", "below this speed, no acceleration is done"};
-cvar_t m_accelerate_maxspeed = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_maxspeed","10000", "above this speed, full acceleration is done"};
-cvar_t m_accelerate_filter = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_filter","0.1", "mouse acceleration factor filtering"};
+cvar_t m_filter = {CVAR_CLIENT | CVAR_SAVE, "m_filter","0", "smoothes mouse movement, less responsive but smoother aiming"}; 
+cvar_t m_accelerate = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate","1", "linear mouse acceleration factor (set to 1 to disable the linear acceleration and use only the power acceleration; set to 0 to disable all acceleration)"};
+cvar_t m_accelerate_minspeed = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_minspeed","5000", "below this speed in px/s, no acceleration is done, with a linear slope between (applied only on linear acceleration)"};
+cvar_t m_accelerate_maxspeed = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_maxspeed","10000", "above this speed in px/s, full acceleration is done, with a linear slope between (applied only on linear acceleration)"};
+cvar_t m_accelerate_filter = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_filter","0", "linear mouse acceleration factor filtering lowpass constant in seconds (set to 0 for no filtering)"};
+cvar_t m_accelerate_power_offset = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_power_offset","0", "below this speed in px/ms, no power acceleration is done"};
+cvar_t m_accelerate_power = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_power","2", "acceleration power (must be above 1 to be useful)"};
+cvar_t m_accelerate_power_senscap = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_power_senscap", "0", "maximum acceleration factor generated by power acceleration; use 0 for unbounded"};
+cvar_t m_accelerate_power_strength = {CVAR_CLIENT | CVAR_SAVE, "m_accelerate_power_strength", "0", "strength of the power mouse acceleration effect"};
 
 cvar_t cl_netfps = {CVAR_CLIENT | CVAR_SAVE, "cl_netfps","72", "how many input packets to send to server each second"};
 cvar_t cl_netrepeatinput = {CVAR_CLIENT | CVAR_SAVE, "cl_netrepeatinput", "1", "how many packets in a row can be lost without movement issues when using cl_movement (technically how many input messages to repeat in each packet that have not yet been acknowledged by the server), only affects DP7 and later servers (Quake uses 0, QuakeWorld uses 2, and just for comparison Quake3 uses 1)"};
@@ -540,38 +544,88 @@ void CL_Input (void)
                }
        }
 
-       // apply m_accelerate if it is on
-       if(m_accelerate.value > 1)
+       // apply m_accelerate if it is on
+       if(m_accelerate.value > 0)
        {
+               float mouse_deltadist = sqrtf(in_mouse_x * in_mouse_x + in_mouse_y * in_mouse_y);
+               float speed = mouse_deltadist / cl.realframetime;
                static float averagespeed = 0;
-               float speed, f, mi, ma;
-
-               speed = sqrt(in_mouse_x * in_mouse_x + in_mouse_y * in_mouse_y) / cl.realframetime;
+               float f, mi, ma;
                if(m_accelerate_filter.value > 0)
-                       f = bound(0, cl.realframetime / m_accelerate_filter.value, 1);
+                       f = bound(0, cl.realframetime / m_accelerate_filter.value, 1);
                else
-                       f = 1;
+                       f = 1;
                averagespeed = speed * f + averagespeed * (1 - f);
 
-               mi = max(1, m_accelerate_minspeed.value);
-               ma = max(m_accelerate_minspeed.value + 1, m_accelerate_maxspeed.value);
-
-               if(averagespeed <= mi)
-               {
-                       f = 1;
-               }
-               else if(averagespeed >= ma)
+               // Note: this check is technically unnecessary, as everything in here cancels out if it is zero.
+               if (m_accelerate.value != 1.0f)
                {
-                       f = m_accelerate.value;
+                       // First do linear slope acceleration which was ripped "in
+                       // spirit" from many classic mouse driver implementations.
+                       // If m_accelerate.value == 1, this code does nothing at all.
+
+                       mi = max(1, m_accelerate_minspeed.value);
+                       ma = max(m_accelerate_minspeed.value + 1, m_accelerate_maxspeed.value);
+
+                       if(averagespeed <= mi)
+                       {
+                               f = 1;
+                       }
+                       else if(averagespeed >= ma)
+                       {
+                               f = m_accelerate.value;
+                       }
+                       else
+                       {
+                               f = averagespeed;
+                               f = (f - mi) / (ma - mi) * (m_accelerate.value - 1) + 1;
+                       }
+                       in_mouse_x *= f;
+                       in_mouse_y *= f;
                }
-               else
+
+               // Note: this check is technically unnecessary, as everything in here cancels out if it is zero.
+               if (m_accelerate_power_strength.value != 0.0f)
                {
-                       f = averagespeed;
-                       f = (f - mi) / (ma - mi) * (m_accelerate.value - 1) + 1;
-               }
+                       // Then do Quake Live-style power acceleration.
+                       // Note that this behavior REPLACES the usual
+                       // sensitivity, so we apply it but then dividie by
+                       // sensitivity.value so that the later multiplication
+                       // restores it again.
+                       float accelsens = 1.0f;
+                       float adjusted_speed_pxms = (averagespeed * 0.001f - m_accelerate_power_offset.value) * m_accelerate_power_strength.value;
+                       float inv_sensitivity = 1.0f / sensitivity.value;
+                       if (adjusted_speed_pxms > 0)
+                       {
+                               if (m_accelerate_power.value > 1.0f)
+                               {
+                                       // TODO: How does this interact with sensitivity changes? Is this intended?
+                                       // Currently: more sensitivity = less acceleration at same pixel speed.
+                                       accelsens += expf((m_accelerate_power.value - 1.0f) * logf(adjusted_speed_pxms)) * inv_sensitivity;
+                               }
+                               else
+                               {
+                                       // The limit of the then-branch for m_accelerate_power -> 1.
+                                       accelsens += inv_sensitivity;
+                                       // Note: QL had just accelsens = 1.0f.
+                                       // This is mathematically wrong though.
+                               }
+                       }
+                       else
+                       {
+                               // The limit of the then-branch for adjusted_speed -> 0.
+                               // accelsens += 0.0f;
+                       }
+                       if (m_accelerate_power_senscap.value > 0.0f && accelsens > m_accelerate_power_senscap.value * inv_sensitivity)
+                       {
+                               // TODO: How does this interact with sensitivity changes? Is this intended?
+                               // Currently: senscap is in absolute sensitivity units, so if senscap < sensitivity, it overrides.
+                               accelsens = m_accelerate_power_senscap.value * inv_sensitivity;
+                       }
 
-               in_mouse_x *= f;
-               in_mouse_y *= f;
+                       in_mouse_x *= accelsens;
+                       in_mouse_y *= accelsens;
+               }
        }
 
        // apply m_filter if it is on
@@ -1416,7 +1470,7 @@ static void CL_ClientMovement_PlayerMove(cl_clientmovement_state_t *s)
                CL_ClientMovement_Physics_Walk(s);
 }
 
-extern cvar_t slowmo;
+extern cvar_t host_timescale;
 void CL_UpdateMoveVars(void)
 {
        if (cls.protocol == PROTOCOL_QUAKEWORLD)
@@ -1463,8 +1517,8 @@ void CL_UpdateMoveVars(void)
        else
        {
                cl.moveflags = 0;
-               cl.movevars_ticrate = (cls.demoplayback ? 1.0f : slowmo.value) / bound(1.0f, cl_netfps.value, 1000.0f);
-               cl.movevars_timescale = (cls.demoplayback ? 1.0f : slowmo.value);
+               cl.movevars_ticrate = (cls.demoplayback ? 1.0f : host_timescale.value) / bound(1.0f, cl_netfps.value, 1000.0f);
+               cl.movevars_timescale = (cls.demoplayback ? 1.0f : host_timescale.value);
                cl.movevars_gravity = sv_gravity.value;
                cl.movevars_stopspeed = cl_movement_stopspeed.value;
                cl.movevars_maxspeed = cl_movement_maxspeed.value;
@@ -1712,7 +1766,7 @@ void CL_SendMove(void)
                return;
 
        // we don't que moves during a lag spike (potential network timeout)
-       quemove = realtime - cl.last_received_message < cl_movement_nettimeout.value;
+       quemove = host.realtime - cl.last_received_message < cl_movement_nettimeout.value;
 
        // we build up cl.cmd and then decide whether to send or not
        // we store this into cl.movecmd[0] for prediction each frame even if we
@@ -1816,7 +1870,7 @@ void CL_SendMove(void)
                cl.movecmd[0] = cl.cmd;
 
        // don't predict more than 200fps
-       if (realtime >= cl.lastpackettime + 0.005)
+       if (host.realtime >= cl.lastpackettime + 0.005)
                cl.movement_replay = true; // redo the prediction
 
        // now decide whether to actually send this move
@@ -1838,7 +1892,7 @@ void CL_SendMove(void)
        // even if it violates the rate limit!
        important = (cl.cmd.impulse || (cl_netimmediatebuttons.integer && cl.cmd.buttons != cl.movecmd[1].buttons));
        // don't send too often (cl_netfps)
-       if (!important && realtime < cl.lastpackettime + packettime)
+       if (!important && host.realtime < cl.lastpackettime + packettime)
                return;
        // don't choke the connection with packets (obey rate limit)
        // it is important that this check be last, because it adds a new
@@ -1850,9 +1904,9 @@ void CL_SendMove(void)
        // try to round off the lastpackettime to a multiple of the packet interval
        // (this causes it to emit packets at a steady beat)
        if (packettime > 0)
-               cl.lastpackettime = floor(realtime / packettime) * packettime;
+               cl.lastpackettime = floor(host.realtime / packettime) * packettime;
        else
-               cl.lastpackettime = realtime;
+               cl.lastpackettime = host.realtime;
 
        buf.maxsize = sizeof(data);
        buf.cursize = 0;
@@ -2098,7 +2152,7 @@ void CL_SendMove(void)
                Con_Print("CL_SendMove: lost server connection\n");
                CL_Disconnect();
                SV_LockThreadMutex();
-               Host_ShutdownServer();
+               SV_Shutdown();
                SV_UnlockThreadMutex();
        }
 }
@@ -2110,75 +2164,75 @@ CL_InitInput
 */
 void CL_InitInput (void)
 {
-       Cmd_AddCommand(&cmd_client, "+moveup",IN_UpDown, "swim upward");
-       Cmd_AddCommand(&cmd_client, "-moveup",IN_UpUp, "stop swimming upward");
-       Cmd_AddCommand(&cmd_client, "+movedown",IN_DownDown, "swim downward");
-       Cmd_AddCommand(&cmd_client, "-movedown",IN_DownUp, "stop swimming downward");
-       Cmd_AddCommand(&cmd_client, "+left",IN_LeftDown, "turn left");
-       Cmd_AddCommand(&cmd_client, "-left",IN_LeftUp, "stop turning left");
-       Cmd_AddCommand(&cmd_client, "+right",IN_RightDown, "turn right");
-       Cmd_AddCommand(&cmd_client, "-right",IN_RightUp, "stop turning right");
-       Cmd_AddCommand(&cmd_client, "+forward",IN_ForwardDown, "move forward");
-       Cmd_AddCommand(&cmd_client, "-forward",IN_ForwardUp, "stop moving forward");
-       Cmd_AddCommand(&cmd_client, "+back",IN_BackDown, "move backward");
-       Cmd_AddCommand(&cmd_client, "-back",IN_BackUp, "stop moving backward");
-       Cmd_AddCommand(&cmd_client, "+lookup", IN_LookupDown, "look upward");
-       Cmd_AddCommand(&cmd_client, "-lookup", IN_LookupUp, "stop looking upward");
-       Cmd_AddCommand(&cmd_client, "+lookdown", IN_LookdownDown, "look downward");
-       Cmd_AddCommand(&cmd_client, "-lookdown", IN_LookdownUp, "stop looking downward");
-       Cmd_AddCommand(&cmd_client, "+strafe", IN_StrafeDown, "activate strafing mode (move instead of turn)");
-       Cmd_AddCommand(&cmd_client, "-strafe", IN_StrafeUp, "deactivate strafing mode");
-       Cmd_AddCommand(&cmd_client, "+moveleft", IN_MoveleftDown, "strafe left");
-       Cmd_AddCommand(&cmd_client, "-moveleft", IN_MoveleftUp, "stop strafing left");
-       Cmd_AddCommand(&cmd_client, "+moveright", IN_MoverightDown, "strafe right");
-       Cmd_AddCommand(&cmd_client, "-moveright", IN_MoverightUp, "stop strafing right");
-       Cmd_AddCommand(&cmd_client, "+speed", IN_SpeedDown, "activate run mode (faster movement and turning)");
-       Cmd_AddCommand(&cmd_client, "-speed", IN_SpeedUp, "deactivate run mode");
-       Cmd_AddCommand(&cmd_client, "+attack", IN_AttackDown, "begin firing");
-       Cmd_AddCommand(&cmd_client, "-attack", IN_AttackUp, "stop firing");
-       Cmd_AddCommand(&cmd_client, "+jump", IN_JumpDown, "jump");
-       Cmd_AddCommand(&cmd_client, "-jump", IN_JumpUp, "end jump (so you can jump again)");
-       Cmd_AddCommand(&cmd_client, "impulse", IN_Impulse, "send an impulse number to server (select weapon, use item, etc)");
-       Cmd_AddCommand(&cmd_client, "+klook", IN_KLookDown, "activate keyboard looking mode, do not recenter view");
-       Cmd_AddCommand(&cmd_client, "-klook", IN_KLookUp, "deactivate keyboard looking mode");
-       Cmd_AddCommand(&cmd_client, "+mlook", IN_MLookDown, "activate mouse looking mode, do not recenter view");
-       Cmd_AddCommand(&cmd_client, "-mlook", IN_MLookUp, "deactivate mouse looking mode");
+       Cmd_AddCommand(CMD_CLIENT, "+moveup",IN_UpDown, "swim upward");
+       Cmd_AddCommand(CMD_CLIENT, "-moveup",IN_UpUp, "stop swimming upward");
+       Cmd_AddCommand(CMD_CLIENT, "+movedown",IN_DownDown, "swim downward");
+       Cmd_AddCommand(CMD_CLIENT, "-movedown",IN_DownUp, "stop swimming downward");
+       Cmd_AddCommand(CMD_CLIENT, "+left",IN_LeftDown, "turn left");
+       Cmd_AddCommand(CMD_CLIENT, "-left",IN_LeftUp, "stop turning left");
+       Cmd_AddCommand(CMD_CLIENT, "+right",IN_RightDown, "turn right");
+       Cmd_AddCommand(CMD_CLIENT, "-right",IN_RightUp, "stop turning right");
+       Cmd_AddCommand(CMD_CLIENT, "+forward",IN_ForwardDown, "move forward");
+       Cmd_AddCommand(CMD_CLIENT, "-forward",IN_ForwardUp, "stop moving forward");
+       Cmd_AddCommand(CMD_CLIENT, "+back",IN_BackDown, "move backward");
+       Cmd_AddCommand(CMD_CLIENT, "-back",IN_BackUp, "stop moving backward");
+       Cmd_AddCommand(CMD_CLIENT, "+lookup", IN_LookupDown, "look upward");
+       Cmd_AddCommand(CMD_CLIENT, "-lookup", IN_LookupUp, "stop looking upward");
+       Cmd_AddCommand(CMD_CLIENT, "+lookdown", IN_LookdownDown, "look downward");
+       Cmd_AddCommand(CMD_CLIENT, "-lookdown", IN_LookdownUp, "stop looking downward");
+       Cmd_AddCommand(CMD_CLIENT, "+strafe", IN_StrafeDown, "activate strafing mode (move instead of turn)");
+       Cmd_AddCommand(CMD_CLIENT, "-strafe", IN_StrafeUp, "deactivate strafing mode");
+       Cmd_AddCommand(CMD_CLIENT, "+moveleft", IN_MoveleftDown, "strafe left");
+       Cmd_AddCommand(CMD_CLIENT, "-moveleft", IN_MoveleftUp, "stop strafing left");
+       Cmd_AddCommand(CMD_CLIENT, "+moveright", IN_MoverightDown, "strafe right");
+       Cmd_AddCommand(CMD_CLIENT, "-moveright", IN_MoverightUp, "stop strafing right");
+       Cmd_AddCommand(CMD_CLIENT, "+speed", IN_SpeedDown, "activate run mode (faster movement and turning)");
+       Cmd_AddCommand(CMD_CLIENT, "-speed", IN_SpeedUp, "deactivate run mode");
+       Cmd_AddCommand(CMD_CLIENT, "+attack", IN_AttackDown, "begin firing");
+       Cmd_AddCommand(CMD_CLIENT, "-attack", IN_AttackUp, "stop firing");
+       Cmd_AddCommand(CMD_CLIENT, "+jump", IN_JumpDown, "jump");
+       Cmd_AddCommand(CMD_CLIENT, "-jump", IN_JumpUp, "end jump (so you can jump again)");
+       Cmd_AddCommand(CMD_CLIENT, "impulse", IN_Impulse, "send an impulse number to server (select weapon, use item, etc)");
+       Cmd_AddCommand(CMD_CLIENT, "+klook", IN_KLookDown, "activate keyboard looking mode, do not recenter view");
+       Cmd_AddCommand(CMD_CLIENT, "-klook", IN_KLookUp, "deactivate keyboard looking mode");
+       Cmd_AddCommand(CMD_CLIENT, "+mlook", IN_MLookDown, "activate mouse looking mode, do not recenter view");
+       Cmd_AddCommand(CMD_CLIENT, "-mlook", IN_MLookUp, "deactivate mouse looking mode");
 
        // LadyHavoc: added lots of buttons
-       Cmd_AddCommand(&cmd_client, "+use", IN_UseDown, "use something (may be used by some mods)");
-       Cmd_AddCommand(&cmd_client, "-use", IN_UseUp, "stop using something");
-       Cmd_AddCommand(&cmd_client, "+button3", IN_Button3Down, "activate button3 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button3", IN_Button3Up, "deactivate button3");
-       Cmd_AddCommand(&cmd_client, "+button4", IN_Button4Down, "activate button4 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button4", IN_Button4Up, "deactivate button4");
-       Cmd_AddCommand(&cmd_client, "+button5", IN_Button5Down, "activate button5 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button5", IN_Button5Up, "deactivate button5");
-       Cmd_AddCommand(&cmd_client, "+button6", IN_Button6Down, "activate button6 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button6", IN_Button6Up, "deactivate button6");
-       Cmd_AddCommand(&cmd_client, "+button7", IN_Button7Down, "activate button7 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button7", IN_Button7Up, "deactivate button7");
-       Cmd_AddCommand(&cmd_client, "+button8", IN_Button8Down, "activate button8 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button8", IN_Button8Up, "deactivate button8");
-       Cmd_AddCommand(&cmd_client, "+button9", IN_Button9Down, "activate button9 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button9", IN_Button9Up, "deactivate button9");
-       Cmd_AddCommand(&cmd_client, "+button10", IN_Button10Down, "activate button10 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button10", IN_Button10Up, "deactivate button10");
-       Cmd_AddCommand(&cmd_client, "+button11", IN_Button11Down, "activate button11 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button11", IN_Button11Up, "deactivate button11");
-       Cmd_AddCommand(&cmd_client, "+button12", IN_Button12Down, "activate button12 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button12", IN_Button12Up, "deactivate button12");
-       Cmd_AddCommand(&cmd_client, "+button13", IN_Button13Down, "activate button13 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button13", IN_Button13Up, "deactivate button13");
-       Cmd_AddCommand(&cmd_client, "+button14", IN_Button14Down, "activate button14 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button14", IN_Button14Up, "deactivate button14");
-       Cmd_AddCommand(&cmd_client, "+button15", IN_Button15Down, "activate button15 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button15", IN_Button15Up, "deactivate button15");
-       Cmd_AddCommand(&cmd_client, "+button16", IN_Button16Down, "activate button16 (behavior depends on mod)");
-       Cmd_AddCommand(&cmd_client, "-button16", IN_Button16Up, "deactivate button16");
+       Cmd_AddCommand(CMD_CLIENT, "+use", IN_UseDown, "use something (may be used by some mods)");
+       Cmd_AddCommand(CMD_CLIENT, "-use", IN_UseUp, "stop using something");
+       Cmd_AddCommand(CMD_CLIENT, "+button3", IN_Button3Down, "activate button3 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button3", IN_Button3Up, "deactivate button3");
+       Cmd_AddCommand(CMD_CLIENT, "+button4", IN_Button4Down, "activate button4 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button4", IN_Button4Up, "deactivate button4");
+       Cmd_AddCommand(CMD_CLIENT, "+button5", IN_Button5Down, "activate button5 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button5", IN_Button5Up, "deactivate button5");
+       Cmd_AddCommand(CMD_CLIENT, "+button6", IN_Button6Down, "activate button6 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button6", IN_Button6Up, "deactivate button6");
+       Cmd_AddCommand(CMD_CLIENT, "+button7", IN_Button7Down, "activate button7 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button7", IN_Button7Up, "deactivate button7");
+       Cmd_AddCommand(CMD_CLIENT, "+button8", IN_Button8Down, "activate button8 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button8", IN_Button8Up, "deactivate button8");
+       Cmd_AddCommand(CMD_CLIENT, "+button9", IN_Button9Down, "activate button9 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button9", IN_Button9Up, "deactivate button9");
+       Cmd_AddCommand(CMD_CLIENT, "+button10", IN_Button10Down, "activate button10 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button10", IN_Button10Up, "deactivate button10");
+       Cmd_AddCommand(CMD_CLIENT, "+button11", IN_Button11Down, "activate button11 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button11", IN_Button11Up, "deactivate button11");
+       Cmd_AddCommand(CMD_CLIENT, "+button12", IN_Button12Down, "activate button12 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button12", IN_Button12Up, "deactivate button12");
+       Cmd_AddCommand(CMD_CLIENT, "+button13", IN_Button13Down, "activate button13 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button13", IN_Button13Up, "deactivate button13");
+       Cmd_AddCommand(CMD_CLIENT, "+button14", IN_Button14Down, "activate button14 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button14", IN_Button14Up, "deactivate button14");
+       Cmd_AddCommand(CMD_CLIENT, "+button15", IN_Button15Down, "activate button15 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button15", IN_Button15Up, "deactivate button15");
+       Cmd_AddCommand(CMD_CLIENT, "+button16", IN_Button16Down, "activate button16 (behavior depends on mod)");
+       Cmd_AddCommand(CMD_CLIENT, "-button16", IN_Button16Up, "deactivate button16");
 
        // LadyHavoc: added bestweapon command
-       Cmd_AddCommand(&cmd_client, "bestweapon", IN_BestWeapon_f, "send an impulse number to server to select the first usable weapon out of several (example: 8 7 6 5 4 3 2 1)");
-       Cmd_AddCommand(&cmd_client, "register_bestweapon", IN_BestWeapon_Register_f, "(for QC usage only) change weapon parameters to be used by bestweapon; stuffcmd this in ClientConnect");
+       Cmd_AddCommand(CMD_CLIENT, "bestweapon", IN_BestWeapon_f, "send an impulse number to server to select the first usable weapon out of several (example: 8 7 6 5 4 3 2 1)");
+       Cmd_AddCommand(CMD_CLIENT, "register_bestweapon", IN_BestWeapon_Register_f, "(for QC usage only) change weapon parameters to be used by bestweapon; stuffcmd this in ClientConnect");
 
        Cvar_RegisterVariable(&cl_movecliptokeyboard);
        Cvar_RegisterVariable(&cl_movement);
@@ -2209,6 +2263,10 @@ void CL_InitInput (void)
        Cvar_RegisterVariable(&m_accelerate_minspeed);
        Cvar_RegisterVariable(&m_accelerate_maxspeed);
        Cvar_RegisterVariable(&m_accelerate_filter);
+       Cvar_RegisterVariable(&m_accelerate_power);
+       Cvar_RegisterVariable(&m_accelerate_power_offset);
+       Cvar_RegisterVariable(&m_accelerate_power_senscap);
+       Cvar_RegisterVariable(&m_accelerate_power_strength);
 
        Cvar_RegisterVariable(&cl_netfps);
        Cvar_RegisterVariable(&cl_netrepeatinput);