29 #include "../idlib/precompiled.h"
172 {
"_moveUp",
UB_UP },
296 }
else if ( !keystate ) {
298 }
else if ( !
held ) {
335 void MouseState(
int *
x,
int *
y,
int *button,
bool *down );
357 void Key(
int keyNum,
bool down );
553 int forward, side, up;
583 float mx, my, strafeMx, strafeMy;
584 static int history[8][2];
585 static int historyCounter;
588 history[historyCounter&7][0] =
mouseDx;
589 history[historyCounter&7][1] =
mouseDy;
601 for ( i = 0 ; i < smooth ; i++ ) {
602 mx += history[ ( historyCounter - i + 8 ) & 7 ][0];
603 my += history[ ( historyCounter - i + 8 ) & 7 ][1];
618 for ( i = 0 ; i < smooth ; i++ ) {
619 strafeMx += history[ ( historyCounter - i + 8 ) & 7 ][0];
620 strafeMy += history[ ( historyCounter - i + 8 ) & 7 ][1];
628 Sys_DebugPrintf(
"idUsercmdGenLocal::MouseMove: Ignoring ridiculous mouse delta.\n" );
642 if ( !strafeMx && !strafeMy ) {
651 float len = sqrt( strafeMx * strafeMx + strafeMy * strafeMy );
653 strafeMx = strafeMx * 127 /
len;
654 strafeMy = strafeMy * 127 /
len;
707 for (i = 0 ; i <= 7 ; i++) {
748 memset( &
cmd, 0,
sizeof(
cmd ) );
800 for ( i = 0; i < 3; i++ ) {
824 if (
idStr::Icmp( cmdString, ucs->string ) == 0 ) {
906 common->
Error(
"idUsercmdGenLocal::TicCmd ticNumber > com_ticNumber" );
971 for( i = 0; i < numEvents; i++ ) {
990 value = abs( value );
991 while( value-- > 0 ) {
1022 for(
int i = 0;
i < numEvents;
i++ ) {
static idCVar in_toggleRun
buttonState_t toggled_zoom
GLsizei const GLfloat * value
int Sys_PollKeyboardInputEvents(void)
const int MAX_CHAT_BUFFER
float GetFloat(void) const
usercmd_t GetDirectUsercmd(void)
static idCVar m_strafeSmooth
buttonState_t toggled_run
volatile int com_ticNumber
void Sys_DebugPrintf(const char *fmt,...)
static idCVar in_alwaysRun
int buttonState[UB_MAX_BUTTONS]
buttonState_t toggled_crouch
int joystickAxis[MAX_JOYSTICK_AXIS]
static idCVar in_angleSpeedKey
int Icmp(const char *text) const
usercmd_t buffered[MAX_BUFFERED_USERCMD]
static idCVar in_toggleCrouch
const char * GetUserCommandName(int index)
static idCVar in_toggleZoom
static idCVar in_pitchSpeed
static bool IsActive(void)
void Sys_EndMouseInputEvents(void)
const int UCF_IMPULSE_SEQUENCE
static idCVar in_yawSpeed
void UsercmdInterrupt(void)
static float Fabs(float f)
void MouseState(int *x, int *y, int *button, bool *down)
int GetInteger(void) const
bool keyState[K_LAST_KEY]
void InhibitUsercmd(inhibit_t subsystem, bool inhibit)
static idCVar sensitivity
static idCVar in_freeLook
idUsercmdGen * usercmdGen
static idCVar m_showMouseRate
void Key(int keyNum, bool down)
short LittleShort(short l)
int CommandStringUsercmdData(const char *cmdString)
static signed char ClampChar(int i)
int Sys_ReturnKeyboardInputEvent(const int n, int &action, bool &state)
void Sys_EndKeyboardInputEvents(void)
bool operator==(const usercmd_t &rhs) const
const int MAX_BUFFERED_USERCMD
int Sys_ReturnMouseInputEvent(const int n, int &action, int &value)
virtual void Error(const char *fmt,...) id_attribute((format(printf
userCmdString_t userCmdStrings[]
const int NUM_USER_COMMANDS
usercmd_t TicCmd(int ticNumber)
static const float M_MS2SEC
int GetNumUserCommands(void)
static idCVar m_strafeScale
int Sys_PollMouseInputEvents(void)