Mercurial > repos > blastem
diff nuklear_ui/blastem_nuklear.c @ 2022:380bc5d4a2cf
Fix format of axis mapping strings for axes that map to a d-pad
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 24 Nov 2020 23:15:25 -0800 |
parents | e42c45ff06d5 |
children | 237068a25523 |
line wrap: on
line diff
--- a/nuklear_ui/blastem_nuklear.c Tue Nov 24 20:23:38 2020 -0800 +++ b/nuklear_ui/blastem_nuklear.c Tue Nov 24 23:15:25 2020 -0800 @@ -1261,14 +1261,14 @@ )) { 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; }