summaryrefslogtreecommitdiffstats
path: root/src/input_common/sdl
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-06-03 22:32:57 +0200
committerLioncash <mathew1800@gmail.com>2019-06-03 22:56:47 +0200
commitb9b23c98ff1747dc322b32eb4f10965e63e5e5cd (patch)
treedcaecbe9408c3f9b3e872a2b01d5b37347a81c8f /src/input_common/sdl
parentinput_common/sdl/sdl_impl: Mark variables const where applicable (diff)
downloadyuzu-b9b23c98ff1747dc322b32eb4f10965e63e5e5cd.tar
yuzu-b9b23c98ff1747dc322b32eb4f10965e63e5e5cd.tar.gz
yuzu-b9b23c98ff1747dc322b32eb4f10965e63e5e5cd.tar.bz2
yuzu-b9b23c98ff1747dc322b32eb4f10965e63e5e5cd.tar.lz
yuzu-b9b23c98ff1747dc322b32eb4f10965e63e5e5cd.tar.xz
yuzu-b9b23c98ff1747dc322b32eb4f10965e63e5e5cd.tar.zst
yuzu-b9b23c98ff1747dc322b32eb4f10965e63e5e5cd.zip
Diffstat (limited to 'src/input_common/sdl')
-rw-r--r--src/input_common/sdl/sdl_impl.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index ddb88cc38..e03f9b712 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -611,8 +611,8 @@ public:
SDLPoller::Start();
// Reset stored axes
- analog_xaxis = -1;
- analog_yaxis = -1;
+ analog_x_axis = -1;
+ analog_y_axis = -1;
analog_axes_joystick = -1;
}
@@ -625,24 +625,24 @@ public:
// An analog device needs two axes, so we need to store the axis for later and wait for
// a second SDL event. The axes also must be from the same joystick.
const int axis = event.jaxis.axis;
- if (analog_xaxis == -1) {
- analog_xaxis = axis;
+ if (analog_x_axis == -1) {
+ analog_x_axis = axis;
analog_axes_joystick = event.jaxis.which;
- } else if (analog_yaxis == -1 && analog_xaxis != axis &&
+ } else if (analog_y_axis == -1 && analog_x_axis != axis &&
analog_axes_joystick == event.jaxis.which) {
- analog_yaxis = axis;
+ analog_y_axis = axis;
}
}
Common::ParamPackage params;
- if (analog_xaxis != -1 && analog_yaxis != -1) {
+ if (analog_x_axis != -1 && analog_y_axis != -1) {
const auto joystick = state.GetSDLJoystickBySDLID(event.jaxis.which);
params.Set("engine", "sdl");
params.Set("port", joystick->GetPort());
params.Set("guid", joystick->GetGUID());
- params.Set("axis_x", analog_xaxis);
- params.Set("axis_y", analog_yaxis);
- analog_xaxis = -1;
- analog_yaxis = -1;
+ params.Set("axis_x", analog_x_axis);
+ params.Set("axis_y", analog_y_axis);
+ analog_x_axis = -1;
+ analog_y_axis = -1;
analog_axes_joystick = -1;
return params;
}
@@ -650,8 +650,8 @@ public:
}
private:
- int analog_xaxis = -1;
- int analog_yaxis = -1;
+ int analog_x_axis = -1;
+ int analog_y_axis = -1;
SDL_JoystickID analog_axes_joystick = -1;
};
} // namespace Polling