diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-02-16 19:12:42 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-02-16 19:12:42 -0600 |
| commit | 6b5f6ddaa120beaf619e8efc6982c922fc7dc37d (patch) | |
| tree | 4b487d028eded527d60320b7408143d2c6e9e5ac /Source/Core/InputCommon/ControllerInterface | |
| parent | 2b4464f8ddf71d9d908ef5b6c9808cdec6480d57 (diff) | |
| parent | 6c4ee1753aa2b9e620138801b479365b0569317c (diff) | |
Merge pull request #82 from lioncash/vertical-alignment
Fix some vertical alignments
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
6 files changed, 56 insertions, 57 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h index b18113bc38..170e4ae9f2 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.h @@ -23,10 +23,11 @@ private: Key(IOHIDElementRef element, IOHIDDeviceRef device); ControlState GetState() const; private: - const IOHIDElementRef m_element; - const IOHIDDeviceRef m_device; - std::string m_name; + const IOHIDElementRef m_element; + const IOHIDDeviceRef m_device; + std::string m_name; }; + class Cursor : public Input { public: @@ -36,9 +37,10 @@ private: ControlState GetState() const; private: const float& m_axis; - const u8 m_index; - const bool m_positive; + const u8 m_index; + const bool m_positive; }; + class Button : public Input { public: @@ -66,11 +68,11 @@ private: float x, y; } m_cursor; - const IOHIDDeviceRef m_device; - const std::string m_device_name; - int m_index; - uint32_t m_windowid; - unsigned char m_mousebuttons[3]; + const IOHIDDeviceRef m_device; + const std::string m_device_name; + int m_index; + uint32_t m_windowid; + unsigned char m_mousebuttons[3]; }; } diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm index 9fb832c340..101971dab6 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm @@ -117,8 +117,8 @@ Keyboard::Key::Key(IOHIDElementRef element, IOHIDDeviceRef device) , m_device(device) { static const struct PrettyKeys { - const uint32_t code; - const char *const name; + const uint32_t code; + const char *const name; } named_keys[] = { { kHIDUsage_KeyboardA, "A" }, { kHIDUsage_KeyboardB, "B" }, diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index c4cdae71bc..23d247d704 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -319,29 +319,29 @@ bool Joystick::UpdateOutput() #ifdef USE_SDL_HAPTIC for (auto &i : m_state_out) { - if (i.changed) // if SetState was called on this output + if (i.changed) // if SetState was called on this output { - if (-1 == i.id) // effect isn't currently uploaded + if (-1 == i.id) // effect isn't currently uploaded { - if (i.effect.type) // if outputstate is >0 this would be true + if (i.effect.type) // if outputstate is >0 this would be true { - if ((i.id = SDL_HapticNewEffect(m_haptic, &i.effect)) > -1) // upload the effect + if ((i.id = SDL_HapticNewEffect(m_haptic, &i.effect)) > -1) // upload the effect { - SDL_HapticRunEffect(m_haptic, i.id, 1); // run the effect + SDL_HapticRunEffect(m_haptic, i.id, 1); // run the effect } } } - else // effect is already uploaded + else // effect is already uploaded { - if (i.effect.type) // if ouputstate >0 + if (i.effect.type) // if ouputstate >0 { SDL_HapticUpdateEffect(m_haptic, i.id, &i.effect); // update the effect } else { - SDL_HapticStopEffect(m_haptic, i.id); // else, stop and remove the effect + SDL_HapticStopEffect(m_haptic, i.id); // else, stop and remove the effect SDL_HapticDestroyEffect(m_haptic, i.id); - i.id = -1; // mark it as not uploaded + i.id = -1; // mark it as not uploaded } } diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp index 23cadd3ee6..4da005fa65 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp @@ -30,7 +30,7 @@ // Mouse axis control output is simply divided by this number. In practice, // that just means you can use a smaller "dead zone" if you bind axis controls // to a joystick. No real need to make this customizable. -#define MOUSE_AXIS_SENSITIVITY 8.0f +#define MOUSE_AXIS_SENSITIVITY 8.0f // The mouse axis controls use a weighted running average. Each frame, the new // value is the average of the old value and the amount of relative mouse @@ -38,7 +38,7 @@ // MOUSE_AXIS_SMOOTHING:1 compared to the new value. Increasing // MOUSE_AXIS_SMOOTHING makes the controls smoother, decreasing it makes them // more responsive. This might be useful as a user-customizable option. -#define MOUSE_AXIS_SMOOTHING 1.5f +#define MOUSE_AXIS_SMOOTHING 1.5f namespace ciface { @@ -48,9 +48,7 @@ namespace XInput2 // This function will add zero or more KeyboardMouse objects to devices. void Init(std::vector<Core::Device*>& devices, void* const hwnd) { - Display* dpy; - - dpy = XOpenDisplay(NULL); + Display* dpy = XOpenDisplay(NULL); // xi_opcode is important; it will be used to identify XInput events by // the polling loop in UpdateInput. @@ -68,9 +66,9 @@ void Init(std::vector<Core::Device*>& devices, void* const hwnd) // register all master devices with Dolphin - XIDeviceInfo* all_masters; - XIDeviceInfo* current_master; - int num_masters; + XIDeviceInfo* all_masters; + XIDeviceInfo* current_master; + int num_masters; all_masters = XIQueryDevice(dpy, XIAllMasterDevices, &num_masters); @@ -94,7 +92,6 @@ void Init(std::vector<Core::Device*>& devices, void* const hwnd) void KeyboardMouse::SelectEventsForDevice(Window window, XIEventMask *mask, int deviceid) { // Set the event mask for the master device. - mask->deviceid = deviceid; XISelectEvents(m_display, window, mask, 1); @@ -104,9 +101,9 @@ void KeyboardMouse::SelectEventsForDevice(Window window, XIEventMask *mask, int // devices) emit those. For keyboard devices, selecting slaves avoids // dealing with key focus. - XIDeviceInfo* all_slaves; - XIDeviceInfo* current_slave; - int num_slaves; + XIDeviceInfo* all_slaves; + XIDeviceInfo* current_slave; + int num_slaves; all_slaves = XIQueryDevice(m_display, XIAllDevices, &num_slaves); @@ -142,8 +139,8 @@ KeyboardMouse::KeyboardMouse(Window window, int opcode, int pointer, int keyboar name = std::string(pointer_device->name); XIFreeDeviceInfo(pointer_device); - XIEventMask mask; - unsigned char mask_buf[(XI_LASTEVENT + 7)/8]; + XIEventMask mask; + unsigned char mask_buf[(XI_LASTEVENT + 7)/8]; mask.mask_len = sizeof(mask_buf); mask.mask = mask_buf; diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h index b5bb8442a6..4357ee9b5a 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h @@ -44,10 +44,10 @@ private: ControlState GetState() const; private: - std::string m_keyname; - Display* const m_display; + std::string m_keyname; + Display* const m_display; const char* const m_keyboard; - const KeyCode m_keycode; + const KeyCode m_keycode; }; class Button : public Input @@ -73,9 +73,9 @@ private: private: const float& m_cursor; - const u8 m_index; - const bool m_positive; - std::string name; + const u8 m_index; + const bool m_positive; + std::string name; }; class Axis : public Input @@ -88,9 +88,9 @@ private: private: const float& m_axis; - const u8 m_index; - const bool m_positive; - std::string name; + const u8 m_index; + const bool m_positive; + std::string name; }; private: @@ -109,12 +109,12 @@ public: int GetId() const; private: - Window m_window; - Display* m_display; - State m_state; - int xi_opcode; - const int pointer_deviceid, keyboard_deviceid; - std::string name; + Window m_window; + Display* m_display; + State m_state; + int xi_opcode; + const int pointer_deviceid, keyboard_deviceid; + std::string name; }; } diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h b/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h index 6ccdf73a6a..ed2e3098b4 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h @@ -35,10 +35,10 @@ private: ControlState GetState() const; private: - std::string m_keyname; - Display* const m_display; + std::string m_keyname; + Display* const m_display; const char* const m_keyboard; - const KeyCode m_keycode; + const KeyCode m_keycode; }; class Button : public Input @@ -65,8 +65,8 @@ private: private: const float& m_cursor; - const u8 m_index; - const bool m_positive; + const u8 m_index; + const bool m_positive; }; public: @@ -81,9 +81,9 @@ public: int GetId() const; private: - Window m_window; + Window m_window; Display* m_display; - State m_state; + State m_state; }; } |
