From 88164945ae08f9f2a2649b0b796319e9aab099bc Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 24 Nov 2020 23:15:25 -0800 Subject: Fix format of axis mapping strings for axes that map to a d-pad --- nuklear_ui/blastem_nuklear.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'nuklear_ui/blastem_nuklear.c') 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; } -- cgit v1.2.3