//----------------------------------------------------------------------------- // Purpose: ApplyMouse -- applies mouse deltas to CUserCmd // Input : viewangles - // *cmd - // mouse_x - // mouse_y - //----------------------------------------------------------------------------- void CASWInput::ApplyMouse( int nSlot, QAngle& viewangles, CUserCmd *cmd, float mouse_x, float mouse_y ) { int current_posx, current_posy; GetMousePos(current_posx, current_posy); if ( ASWInput()->ControllerModeActive() ) return; if ( asw_controls.GetBool() && !MarineControllingTurret() ) { TurnTowardMouse( viewangles, cmd ); // Re-center the mouse. // force the mouse to the center, so there's room to move ResetMouse(); SetMousePos( current_posx, current_posy ); // asw - swarm wants it unmoved (have to reset to stop buttons locking) } else { if ( MarineControllingTurret() ) { // accelerate up the mouse intertia static float mouse_x_accumulated = 0; static float mouse_y_accumulated = 0; // decay it mouse_x_accumulated *= 0.95f; mouse_y_accumulated *= 0.95f; mouse_x_accumulated += mouse_x * 0.04f; mouse_y_accumulated += mouse_y * 0.04f; // clamp it mouse_x_accumulated = clamp(mouse_x_accumulated, -500.0f,500.0f); mouse_y_accumulated = clamp(mouse_y_accumulated, -500.0f,500.0f); // move with our inertia style mouse_x = mouse_x_accumulated; mouse_y = mouse_y_accumulated; } if ( ( !ASWGameRules() || ASWGameRules()->GetMarineDeathCamInterp() <= 0.0f ) && ( !C_ASW_Marine::GetLocalMarine() || !C_ASW_Marine::GetLocalMarine()->IsUsingComputerOrButtonPanel() ) ) CInput::ApplyMouse( nSlot, viewangles, cmd, mouse_x, mouse_y ); // force the mouse to the center, so there's room to move ResetMouse(); } }
//----------------------------------------------------------------------------- // Purpose: ApplyMouse -- applies mouse deltas to CUserCmd // Input : viewangles - // *cmd - // mouse_x - // mouse_y - //----------------------------------------------------------------------------- void CASWInput::ApplyMouse( int nSlot, QAngle& viewangles, CUserCmd *cmd, float mouse_x, float mouse_y ) { int current_posx, current_posy; GetMousePos(current_posx, current_posy); if ( ASWInput()->ControllerModeActive() ) return; //by price if (MarineDidPrice() || !asw_controls.GetBool()) { TurnTowardMouse( viewangles, cmd ); // force the mouse to the center, so there's room to move ResetMouse(); SetMousePos( current_posx, current_posy ); // asw - swarm wants it unmoved (have to reset to stop buttons locking) } CInput::ApplyMouse( nSlot, viewangles, cmd, mouse_x, mouse_y ); // force the mouse to the center, so there's room to move ResetMouse(); }