changeset 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 270a4c875e0a
children bf0f8e99eaf4
files nuklear_ui/blastem_nuklear.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
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;
 				}