Subversion Repositories eduke32

Rev

Rev 8486 | Rev 8549 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8486 Rev 8536
Line 69... Line 69...
69
static uint8_t CONTROL_DoubleClickSpeed;
69
static uint8_t CONTROL_DoubleClickSpeed;
70
70
71
int32_t CONTROL_ButtonFlags[CONTROL_NUM_FLAGS];
71
int32_t CONTROL_ButtonFlags[CONTROL_NUM_FLAGS];
72
consolekeybind_t CONTROL_KeyBinds[MAXBOUNDKEYS + MAXMOUSEBUTTONS];
72
consolekeybind_t CONTROL_KeyBinds[MAXBOUNDKEYS + MAXMOUSEBUTTONS];
73
bool CONTROL_BindsEnabled = 0;
73
bool CONTROL_BindsEnabled = 0;
74
bool CONTROL_SmoothMouse  = 0;
-
 
75
74
76
#define CONTROL_CheckRange(which) ((unsigned)which >= (unsigned)CONTROL_NUM_FLAGS)
75
#define CONTROL_CheckRange(which) ((unsigned)which >= (unsigned)CONTROL_NUM_FLAGS)
77
#define BIND(x, s, r, k) do { Xfree(x.cmdstr); x.cmdstr = s; x.repeat = r; x.key = k; } while (0)
76
#define BIND(x, s, r, k) do { Xfree(x.cmdstr); x.cmdstr = s; x.repeat = r; x.key = k; } while (0)
78
77
79
void CONTROL_ClearAllBinds(void)
78
void CONTROL_ClearAllBinds(void)
Line 109... Line 108...
109
    vec2_t input;
108
    vec2_t input;
110
    mouseReadPos(&input.x, &input.y);
109
    mouseReadPos(&input.x, &input.y);
111
110
112
    vec2f_t finput = { float(input.x), float(input.y) };
111
    vec2f_t finput = { float(input.x), float(input.y) };
113
112
114
    if (CONTROL_SmoothMouse)
-
 
115
    {
-
 
116
        static vec2_t last;
-
 
117
        finput = { float(input.x + last.x) * 0.5f, float(input.y + last.y) * 0.5f };
-
 
118
        last = input;
-
 
119
    }
-
 
120
-
 
121
    info->mousex = mulscale16(Blrintf(finput.x * 4.f * CONTROL_MouseSensitivity), CONTROL_MouseAxesScale[0]);
113
    info->mousex = mulscale16(Blrintf(finput.x * 4.f * CONTROL_MouseSensitivity), CONTROL_MouseAxesScale[0]);
122
    info->mousey = mulscale16(Blrintf(finput.y * 4.f * CONTROL_MouseSensitivity), CONTROL_MouseAxesScale[1]);
114
    info->mousey = mulscale16(Blrintf(finput.y * 4.f * CONTROL_MouseSensitivity), CONTROL_MouseAxesScale[1]);
123
}
115
}
124
116
125
static int32_t CONTROL_GetTime(void)
117
static int32_t CONTROL_GetTime(void)