M-27: D145 - ESC no longer hard-quits (it is the menu back key)

port/src/video.c, port/fast3d/gfx_sdl2.cpp, port/src/input.c: bare ESC was
wired to exit(0) in both event handlers. On the front-end / debrief / mission-
complete screens ESC is the natural "back / previous page" key, so a player
paging through the post-mission report with ESC quit the whole game -- a
clean exit(0), no crash log, looked like a crash. ESC now feeds the N64 B
button (back / cancel) through input.c alongside X/R/F; quitting is
window-close (X) or Alt+F4 only.

Verified: -level_09 boots crash-free, 8 frames rendered.
This commit is contained in:
James Dansereau committed 2026-08-30 15:05:12 -04:00
1 parent 70793eba4f
commit 36acf324fa
3 files changed
+12 -6

No files matched your search

+3 -3
View File
@@ -299,9 +299,9 @@ static void gfx_sdl_handle_events(void) {
if (event.key.keysym.sym == SDLK_RETURN && (event.key.keysym.mod & KMOD_ALT)) {
// alt-enter received, switch fullscreen state
set_fullscreen(!fullscreen_state, true);
} else if (event.key.keysym.sym == SDLK_ESCAPE) {
// GE's own menus use the keyboard; ESC on an empty event
// queue is our quit key (matches the Phase 1 demo loop).
} else if (event.key.keysym.sym == SDLK_F4 && (event.key.keysym.mod & KMOD_ALT)) {
// D145: Alt+F4 quits; bare ESC no longer does (it is the
// menu "back" key -- see port/src/video.c / input.c).
exit(0);
}
break;
+1 -1
View File
@@ -435,7 +435,7 @@ unsigned inputComputePad(int idx, signed char *stick_x, signed char *stick_y)
wheelPulse--;
}
if (keyDown(ks, SDL_SCANCODE_X) || keyDown(ks, SDL_SCANCODE_R) ||
keyDown(ks, SDL_SCANCODE_F))
keyDown(ks, SDL_SCANCODE_F) || keyDown(ks, SDL_SCANCODE_ESCAPE)) /* D145: ESC = B (back/cancel) */
button |= GE_CONT_B;
if (keyDown(ks, SDL_SCANCODE_Q))
button |= GE_CONT_L;
+8 -2
View File
@@ -197,8 +197,14 @@ void videoPumpEvents(void)
exit(0);
break;
case SDL_KEYDOWN:
if (ev.key.keysym.sym == SDLK_ESCAPE) {
sysLogPrintf(LOG_INFO, "video: ESC -> quit");
/* D145: bare ESC used to exit(0). On the front-end / debrief
* screens ESC is the natural "back" key, so a player pressing it
* to page back instead quit the whole game (looked like a crash --
* clean exit, no crash log). ESC now feeds the N64 B button
* (back / cancel) via input.c; quitting is window-close (the X) or
* Alt+F4 only. */
if ((ev.key.keysym.sym == SDLK_F4) && (ev.key.keysym.mod & KMOD_ALT)) {
sysLogPrintf(LOG_INFO, "video: Alt+F4 -> quit");
exit(0);
} else if (ev.key.keysym.sym == SDLK_F12 && !ev.key.repeat) {
screenshotReq = 1;