diff options
author | Michael Pavone <pavone@retrodev.com> | 2020-11-24 23:15:25 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2020-11-24 23:15:25 -0800 |
commit | 88164945ae08f9f2a2649b0b796319e9aab099bc (patch) | |
tree | e890fceadabef1c531fa4971e28495c493ec9383 /nuklear_ui | |
parent | 597a65adca3f56e3d0df4b60d51ca3ebacb68fe5 (diff) |
Fix format of axis mapping strings for axes that map to a d-pad
Diffstat (limited to 'nuklear_ui')
-rw-r--r-- | nuklear_ui/blastem_nuklear.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nuklear_ui/blastem_nuklear.c b/nuklear_ui/blastem_nuklear.c index 242d6ef..bcaaaf0 100644 --- a/nuklear_ui/blastem_nuklear.c +++ b/nuklear_ui/blastem_nuklear.c @@ -1261,14 +1261,14 @@ static void view_controller_mappings(struct nk_context *context) )) { if (current_button <= SDL_CONTROLLER_BUTTON_B || axis_moved != button_a_axis) { start_mapping(); + if (current_button >= SDL_CONTROLLER_BUTTON_DPAD_UP) { + mapping_string[mapping_pos++] = axis_value >= 0 ? '+' : '-'; + } mapping_string[mapping_pos++] = 'a'; if (axis_moved > 9) { mapping_string[mapping_pos++] = '0' + axis_moved / 10; } mapping_string[mapping_pos++] = '0' + axis_moved % 10; - if (current_button >= SDL_CONTROLLER_BUTTON_DPAD_UP) { - mapping_string[mapping_pos++] = axis_value >= 0 ? '+' : '-'; - } last_axis = axis_moved; last_axis_value = axis_value; } |