Skip to content

Commit

Permalink
Fixes #2456, controllermap's undo does not work correctly (by Bogdan …
Browse files Browse the repository at this point in the history
…Marinov)
  • Loading branch information
gabomdq committed Mar 24, 2014
1 parent 1f92c9d commit 22a7dd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/controllermap.c
Expand Up @@ -111,7 +111,7 @@ WatchJoystick(SDL_Joystick * joystick)
Uint8 alpha=200, alpha_step = -1;
Uint32 alpha_ticks;
char mapping[4096], temp[4096];
MappingStep *step;
MappingStep *step, *prev_step;
MappingStep steps[] = {
{342, 132, 0.0, MARKER_BUTTON, "x", -1, -1, -1, -1, ""},
{387, 167, 0.0, MARKER_BUTTON, "a", -1, -1, -1, -1, ""},
Expand Down Expand Up @@ -296,8 +296,8 @@ WatchJoystick(SDL_Joystick * joystick)
if (event.key.keysym.sym == SDLK_BACKSPACE || event.key.keysym.sym == SDLK_AC_BACK) {
/* Undo! */
if (s > 0) {
SDL_strlcpy(mapping, step->mapping, SDL_arraysize(step->mapping));
s--;
prev_step = &steps[--s];
SDL_strlcpy(mapping, prev_step->mapping, SDL_arraysize(prev_step->mapping));
next = SDL_TRUE;
}
break;
Expand Down

0 comments on commit 22a7dd0

Please sign in to comment.