diff options
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
8 files changed, 36 insertions, 38 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp index 7f107812ec..b9f483da4d 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp @@ -17,12 +17,6 @@ namespace ciface namespace DInput { -//BOOL CALLBACK DIEnumEffectsCallback(LPCDIEFFECTINFO pdei, LPVOID pvRef) -//{ -// ((std::list<DIEFFECTINFO>*)pvRef)->push_back(*pdei); -// return DIENUM_CONTINUE; -//} - BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef) { ((std::list<DIDEVICEOBJECTINSTANCE>*)pvRef)->push_back(*lpddoi); diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp index 8b11bb181f..07e439e4eb 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp @@ -17,7 +17,7 @@ namespace ciface namespace DInput { -#define DATA_BUFFER_SIZE 32 +#define DATA_BUFFER_SIZE 32 //----------------------------------------------------------------------------- // Modified some MSDN code to get all the XInput device GUID.Data1 values in a vector, @@ -130,7 +130,7 @@ void InitJoystick(IDirectInput8* const idi8, std::vector<Core::Device*>& devices // this is used to number the joysticks // multiple joysticks with the same name shall get unique ids starting at 0 - std::map< std::basic_string<TCHAR>, int> name_counts; + std::map< std::basic_string<TCHAR>, int> name_counts; std::vector<DWORD> xinput_guids; GetXInputGUIDS( xinput_guids ); diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp index c79f4e3365..4b17574d7b 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp @@ -218,12 +218,12 @@ bool KeyboardMouse::UpdateOutput() { bool want_on = false; if (m_state_out[i]) - want_on = m_state_out[i] > GetTickCount() % 255 ; // light should flash when output is 0.5 + want_on = m_state_out[i] > GetTickCount() % 255 ; // light should flash when output is 0.5 // lights are set to their original state when output is zero if (want_on ^ m_current_state_out[i]) { - kbinputs.push_back(KInput(named_lights[i].code)); // press + kbinputs.push_back(KInput(named_lights[i].code)); // press kbinputs.push_back(KInput(named_lights[i].code, true)); // release m_current_state_out[i] ^= 1; diff --git a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp index 0c4f026a9e..ff96aabb4b 100644 --- a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp @@ -61,7 +61,7 @@ bool ForceFeedbackDevice::InitForceFeedback(const LPDIRECTINPUTDEVICE8 device, i memset(&eff, 0, sizeof(eff)); eff.dwSize = sizeof(DIEFFECT); eff.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS; - eff.dwDuration = INFINITE; // (4 * DI_SECONDS) + eff.dwDuration = INFINITE; // (4 * DI_SECONDS) eff.dwSamplePeriod = 0; eff.dwGain = DI_FFNOMINALMAX; eff.dwTriggerButton = DIEB_NOTRIGGER; @@ -175,7 +175,7 @@ void ForceFeedbackDevice::ForceConstant::SetState(const ControlState state) if (val != new_val) { val = new_val; - m_state.params = ¶ms; // tells UpdateOutput the state has changed + m_state.params = ¶ms; // tells UpdateOutput the state has changed // tells UpdateOutput to either start or stop the force m_state.size = new_val ? sizeof(params) : 0; @@ -190,7 +190,7 @@ void ForceFeedbackDevice::ForceRamp::SetState(const ControlState state) if (params.lStart != new_val) { params.lStart = params.lEnd = new_val; - m_state.params = ¶ms; // tells UpdateOutput the state has changed + m_state.params = ¶ms; // tells UpdateOutput the state has changed // tells UpdateOutput to either start or stop the force m_state.size = new_val ? sizeof(params) : 0; @@ -206,9 +206,9 @@ void ForceFeedbackDevice::ForcePeriodic::SetState(const ControlState state) if (val != new_val) { val = new_val; - //params.dwPeriod = 0;//DWORD(0.05 * DI_SECONDS); // zero is working fine for me + //params.dwPeriod = 0;//DWORD(0.05 * DI_SECONDS); // zero is working fine for me - m_state.params = ¶ms; // tells UpdateOutput the state has changed + m_state.params = ¶ms; // tells UpdateOutput the state has changed // tells UpdateOutput to either start or stop the force m_state.size = new_val ? sizeof(params) : 0; diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h index 72087f82a7..3ad20ad039 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h @@ -25,33 +25,36 @@ private: : m_element(element), m_device(device) {} ControlState GetState() const; private: - const IOHIDElementRef m_element; - const IOHIDDeviceRef m_device; + const IOHIDElementRef m_element; + const IOHIDDeviceRef m_device; }; class Axis : public Input { public: - enum direction { + enum direction + { positive = 0, negative }; std::string GetName() const; Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction dir); ControlState GetState() const; + private: - const IOHIDElementRef m_element; - const IOHIDDeviceRef m_device; - std::string m_name; - const direction m_direction; - float m_neutral; - float m_scale; + const IOHIDElementRef m_element; + const IOHIDDeviceRef m_device; + std::string m_name; + const direction m_direction; + float m_neutral; + float m_scale; }; class Hat : public Input { public: - enum direction { + enum direction + { up = 0, right, down, @@ -60,11 +63,12 @@ private: std::string GetName() const; Hat(IOHIDElementRef element, IOHIDDeviceRef device, direction dir); ControlState GetState() const; + private: - const IOHIDElementRef m_element; - const IOHIDDeviceRef m_device; - const char* m_name; - const direction m_direction; + const IOHIDElementRef m_element; + const IOHIDDeviceRef m_device; + const char* m_name; + const direction m_direction; }; public: @@ -78,9 +82,9 @@ public: int GetId() const; private: - const IOHIDDeviceRef m_device; - const std::string m_device_name; - const int m_index; + const IOHIDDeviceRef m_device; + const std::string m_device_name; + const int m_index; ForceFeedback::FFDeviceAdapterReference m_ff_device; }; diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index 23d247d704..074308305c 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -31,7 +31,7 @@ void Init( std::vector<Core::Device*>& devices ) { // this is used to number the joysticks // multiple joysticks with the same name shall get unique ids starting at 0 - std::map<std::string, int> name_counts; + std::map<std::string, int> name_counts; if (SDL_Init( SDL_INIT_FLAGS ) >= 0) { @@ -335,7 +335,7 @@ bool Joystick::UpdateOutput() { if (i.effect.type) // if ouputstate >0 { - SDL_HapticUpdateEffect(m_haptic, i.id, &i.effect); // update the effect + SDL_HapticUpdateEffect(m_haptic, i.id, &i.effect); // update the effect } else { diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h index 2d0c1c20ea..f9ed688932 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h @@ -16,9 +16,9 @@ #ifdef USE_SDL_HAPTIC #include <SDL_haptic.h> - #define SDL_INIT_FLAGS SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC + #define SDL_INIT_FLAGS SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC #else - #define SDL_INIT_FLAGS SDL_INIT_JOYSTICK + #define SDL_INIT_FLAGS SDL_INIT_JOYSTICK #endif namespace ciface diff --git a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp index 0aa639aae8..a5b382e1ff 100644 --- a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp @@ -121,7 +121,7 @@ Device::Device(const XINPUT_CAPABILITIES& caps, u8 index) // get supported triggers for (int i = 0; i != sizeof(named_triggers)/sizeof(*named_triggers); ++i) { - //BYTE val = (&caps.Gamepad.bLeftTrigger)[i]; // should be max value / MSDN lies + //BYTE val = (&caps.Gamepad.bLeftTrigger)[i]; // should be max value / MSDN lies if ((&caps.Gamepad.bLeftTrigger)[i]) AddInput(new Trigger(i, (&m_state_in.Gamepad.bLeftTrigger)[i], 255 )); } @@ -143,7 +143,7 @@ Device::Device(const XINPUT_CAPABILITIES& caps, u8 index) // get supported motors for (int i = 0; i != sizeof(named_motors)/sizeof(*named_motors); ++i) { - //WORD val = (&caps.Vibration.wLeftMotorSpeed)[i]; // should be max value / nope, more lies + //WORD val = (&caps.Vibration.wLeftMotorSpeed)[i]; // should be max value / nope, more lies if ((&caps.Vibration.wLeftMotorSpeed)[i]) AddOutput(new Motor(i, (&m_state_out.wLeftMotorSpeed)[i], 65535)); } |
