diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-03-24 22:53:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 22:53:16 +0100 |
commit | 5cad9147f9b1f96ba0fdc84f0a6112befdfdfc92 (patch) | |
tree | 753e808402c6b11a2080a98112708147db152015 /platform/iphone/os_iphone.cpp | |
parent | 60a9debb99ecb538ab91d76d80ab6f6c22cf4d5f (diff) | |
parent | 0d8f5660f66d9952072fa62b88f620f7ea839d51 (diff) |
Merge pull request #8133 from Hinsbart/joy_constants
Input: Refactor JOY_* constants.
Diffstat (limited to 'platform/iphone/os_iphone.cpp')
-rw-r--r-- | platform/iphone/os_iphone.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 57862131f9..752690762e 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -325,7 +325,7 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { InputEvent ev; ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; - ev.joy_motion.axis = JOY_ANALOG_0_X; + ev.joy_motion.axis = JOY_ANALOG_0; ev.joy_motion.axis_value = (p_x / (float)ACCEL_RANGE); ev.ID = ++last_event_id; last_accel.x = p_x; @@ -336,7 +336,7 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { InputEvent ev; ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; - ev.joy_motion.axis = JOY_ANALOG_0_Y; + ev.joy_motion.axis = JOY_ANALOG_1; ev.joy_motion.axis_value = (p_y / (float)ACCEL_RANGE); ev.ID = ++last_event_id; last_accel.y = p_y; @@ -347,7 +347,7 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { InputEvent ev; ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; - ev.joy_motion.axis = JOY_ANALOG_1_X; + ev.joy_motion.axis = JOY_ANALOG_2; ev.joy_motion.axis_value = ( (1.0 - p_z) / (float)ACCEL_RANGE); ev.ID = ++last_event_id; last_accel.z = p_z; |