]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - in_svgalib.c
Added a special key binding menu when compiling for BloodBath
[xonotic/darkplaces.git] / in_svgalib.c
index c84c6d65fc872715869933098f35456b8b15b13d..be416871ece82850a4f927e8fd98ae2eb67751e6 100644 (file)
@@ -63,16 +63,11 @@ static int  mx, my, uimx, uimy;
 static void IN_init_kb(void);
 static void IN_init_mouse(void);
 
-cvar_t m_filter = {CVAR_SAVE, "m_filter","0"};
-
 static void keyhandler(int scancode, int state)
 {
        int sc;
 
        sc = scancode & 0x7f;
-#if 0
-       Con_Printf("scancode=%x (%d%s)\n", scancode, sc, scancode&0x80?"+128":"");
-#endif
        Key_Event(scantokey[sc], state == KEY_EVENTPRESS);
 }
 
@@ -234,8 +229,6 @@ static void IN_init_mouse(void)
        char *mousedev;
        int mouserate = MOUSE_DEFAULTSAMPLERATE;
 
-       Cvar_RegisterVariable (&m_filter);
-
        mouse_buttons = 3;
 
        mtype = vga_getmousetype();
@@ -251,10 +244,6 @@ static void IN_init_mouse(void)
                mouserate = atoi(com_argv[COM_CheckParm("-mrate")+1]);
        }
 
-#if 0
-       printf("Mouse: dev=%s,type=%s,speed=%d\n",
-               mousedev, mice[mtype].name, mouserate);
-#endif
        if (mouse_init(mousedev, mtype, mouserate)) {
                Con_Printf("No mouse found\n");
                UseMouse = 0;
@@ -322,7 +311,6 @@ void IN_Commands(void)
 
 void IN_Move(usercmd_t *cmd)
 {
-       int mouselook = (in_mlook.state & 1) || freelook.integer;
        if (!UseMouse)
                return;
 
@@ -331,59 +319,16 @@ void IN_Move(usercmd_t *cmd)
                ;
 
        if (key_dest != key_game)
-       {
                ui_mouseupdaterelative(uimx, uimy);
-               uimx = uimy = 0;
-               return;
-       }
-       uimx = uimy = 0;
-
-       if (m_filter.integer)
-       {
-               mouse_x = (mx + old_mouse_x) * 0.5;
-               mouse_y = (my + old_mouse_y) * 0.5;
-       }
        else
-       {
-               mouse_x = mx;
-               mouse_y = my;
-       }
-       old_mouse_x = mx;
-       old_mouse_y = my;
-       /* Clear for next update */
-       mx = my = 0;
-
-       // LordHavoc: viewzoom affects mouse sensitivity for sniping
-       mouse_x *= sensitivity.value * cl.viewzoom;
-       mouse_y *= sensitivity.value * cl.viewzoom;
-
-       /* Add mouse X/Y movement to cmd */
-       if ( (in_strafe.state & 1) || (lookstrafe.integer && mouselook))
-               cmd->sidemove += m_side.value * mouse_x;
-       else
-               cl.viewangles[YAW] -= m_yaw.value * mouse_x;
-
-       if (mouselook)
-               V_StopPitchDrift();
-
-       // LordHavoc: changed limits on pitch from -70 to 80, to -90 to 90
-       if (mouselook && !(in_strafe.state & 1))
-       {
-               cl.viewangles[PITCH] += m_pitch.value * mouse_y;
-               if (cl.viewangles[PITCH] > 90)
-                       cl.viewangles[PITCH] = 90;
-               if (cl.viewangles[PITCH] < -90)
-                       cl.viewangles[PITCH] = -90;
-       }
-       else
-       {
-               if ((in_strafe.state & 1) && noclip_anglehack)
-                       cmd->upmove -= m_forward.value * mouse_y;
-               else
-                       cmd->forwardmove -= m_forward.value * mouse_y;
-       }
+               IN_Mouse(cmd, mx, my);
+       mx = 0;
+       my = 0;
+       uimx = 0;
+       uimy = 0;
 }
 
 void IN_HandlePause (qboolean pause)
 {
 }
+