mirror of https://github.com/encounter/SDL.git
Fixes #2456, controllermap's undo does not work correctly (by Bogdan Marinov)
This commit is contained in:
parent
1f92c9dcac
commit
22a7dd0be8
|
@ -111,7 +111,7 @@ WatchJoystick(SDL_Joystick * joystick)
|
||||||
Uint8 alpha=200, alpha_step = -1;
|
Uint8 alpha=200, alpha_step = -1;
|
||||||
Uint32 alpha_ticks;
|
Uint32 alpha_ticks;
|
||||||
char mapping[4096], temp[4096];
|
char mapping[4096], temp[4096];
|
||||||
MappingStep *step;
|
MappingStep *step, *prev_step;
|
||||||
MappingStep steps[] = {
|
MappingStep steps[] = {
|
||||||
{342, 132, 0.0, MARKER_BUTTON, "x", -1, -1, -1, -1, ""},
|
{342, 132, 0.0, MARKER_BUTTON, "x", -1, -1, -1, -1, ""},
|
||||||
{387, 167, 0.0, MARKER_BUTTON, "a", -1, -1, -1, -1, ""},
|
{387, 167, 0.0, MARKER_BUTTON, "a", -1, -1, -1, -1, ""},
|
||||||
|
@ -296,8 +296,8 @@ WatchJoystick(SDL_Joystick * joystick)
|
||||||
if (event.key.keysym.sym == SDLK_BACKSPACE || event.key.keysym.sym == SDLK_AC_BACK) {
|
if (event.key.keysym.sym == SDLK_BACKSPACE || event.key.keysym.sym == SDLK_AC_BACK) {
|
||||||
/* Undo! */
|
/* Undo! */
|
||||||
if (s > 0) {
|
if (s > 0) {
|
||||||
SDL_strlcpy(mapping, step->mapping, SDL_arraysize(step->mapping));
|
prev_step = &steps[--s];
|
||||||
s--;
|
SDL_strlcpy(mapping, prev_step->mapping, SDL_arraysize(prev_step->mapping));
|
||||||
next = SDL_TRUE;
|
next = SDL_TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue