From c1c948e9a80b114b4846e5010e09f17fb6c5342b Mon Sep 17 00:00:00 2001 From: Eric Gable Date: Tue, 3 Mar 2015 20:04:11 -0800 Subject: [PATCH] Add KEY_FALL as SDL_TAB to call goto_state(&st_fall) to take penalty and continue. --- putt/st_all.c | 22 ++++++++++++++-------- share/config.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/putt/st_all.c b/putt/st_all.c index 30b224fa3..45d68605a 100644 --- a/putt/st_all.c +++ b/putt/st_all.c @@ -691,6 +691,8 @@ static int pause_keybd(int c, int d) { if (d && c == KEY_EXIT) return pause_action(PAUSE_CONTINUE); + if (d && c == KEY_FALL) + goto_state(&st_fall); return 1; } @@ -713,8 +715,10 @@ static int shared_keybd(int c, int d) { if (d) { - if (c == KEY_EXIT) - return goto_pause(&st_over); + if (c == KEY_EXIT) + return goto_pause(&st_over); + if (c == KEY_FALL) + goto_state(&st_fall); } return 1; } @@ -805,12 +809,14 @@ static int next_keybd(int c, int d) { if (d) { - if (c == KEY_POSE) - return goto_state(&st_poser); - if (c == KEY_EXIT) - return goto_pause(&st_over); - if ('0' <= c && c <= '9') - num = num * 10 + c - '0'; + if (c == KEY_POSE) + return goto_state(&st_poser); + if (c == KEY_EXIT) + return goto_pause(&st_over); + if (c == KEY_FALL) + goto_state(&st_fall); + if ('0' <= c && c <= '9') + num = num * 10 + c - '0'; } return 1; } diff --git a/share/config.h b/share/config.h index f6b07af1a..108fd7f7b 100644 --- a/share/config.h +++ b/share/config.h @@ -147,7 +147,7 @@ int config_screenshot(void); /* Names for some hard-coded keys. */ #define KEY_EXIT SDLK_ESCAPE - +#define KEY_FALL SDLK_TAB #define KEY_LOOKAROUND SDLK_F5 #define KEY_WIREFRAME SDLK_F6 #define KEY_RESOURCES SDLK_F7