comparison render_sdl.c @ 2239:b2f788f08a31

Fix bug in controller reordering implementation
author Michael Pavone <pavone@retrodev.com>
date Sat, 17 Sep 2022 23:08:24 -0700
parents f11f4399d64b
children eb45ad9d8a3f
comparison
equal deleted inserted replaced
2238:0a107b2d5837 2239:b2f788f08a31
796 } 796 }
797 SDL_Joystick *tmp_joy = joysticks[joystick]; 797 SDL_Joystick *tmp_joy = joysticks[joystick];
798 int tmp_index = joystick_sdl_index[joystick]; 798 int tmp_index = joystick_sdl_index[joystick];
799 joysticks[joystick] = joysticks[desired_index]; 799 joysticks[joystick] = joysticks[desired_index];
800 joystick_sdl_index[joystick] = joystick_sdl_index[desired_index]; 800 joystick_sdl_index[joystick] = joystick_sdl_index[desired_index];
801 joystick_index_locked[joystick] = joystick_sdl_index[desired_index]; 801 joystick_index_locked[joystick] = joystick_index_locked[desired_index];
802 joysticks[desired_index] = tmp_joy; 802 joysticks[desired_index] = tmp_joy;
803 joystick_sdl_index[desired_index] = tmp_index; 803 joystick_sdl_index[desired_index] = tmp_index;
804 joystick_index_locked[desired_index] = 1; 804 joystick_index_locked[desired_index] = 1;
805 //update bindings as the controllers being swapped may have different mappings 805 //update bindings as the controllers being swapped may have different mappings
806 handle_joy_added(desired_index); 806 handle_joy_added(desired_index);