summaryrefslogtreecommitdiff
path: root/src/engine/objects/ChainChomp.cpp
diff options
context:
space:
mode:
authorquarrel07 <178681861+quarrel07@users.noreply.github.com>2026-07-23 11:21:36 -0700
committerGitHub <noreply@github.com>2026-07-23 12:21:36 -0600
commit78a012ce06b8756870e18230c3957c00cc2a66da (patch)
tree358041ef692c8e014f3b232d4ac2ffb9d17e6cf0 /src/engine/objects/ChainChomp.cpp
parent4c24ae2bc2294c96a81d296a68b6d404f34358e7 (diff)
Fix the reset button doing nothing or looping the start screen when pressed repeatedly (#719)
* Make the reset button reliable from any screen Pressing reset repeatedly near app start could do nothing, fade the music with no reset, or bounce the press-start screen back to itself. Three defects in the old handler: - It ran from the ImGui widget, racing the menu state machine; a press landing mid-fade was re-advanced by the in-flight transition (the press-start loop). - It always wrote gGamestateNext = MAIN_MENU_FROM_QUIT; once the game was already in that state a repeat write is swallowed by the != guard in main.c, so nothing happened. - CM_ResetAudio ran unconditionally, so the music faded even when the reset was swallowed. The widget now only sets an atomic request flag; ApplyPendingReset (top of push_frame, on the game loop) performs the reset. It alternates between the two identical FROM_QUIT gamestates so every press trips the gamestate switch, and re-enters the menus through the intro's own transition protocol (FADE_MODE_LOGO -> setup_menus rebuild + fresh fade-in), which replaces any in-flight transition. Audio only fades when a reset actually executes. The dead gSkipIntro switch in the old handler (an unconditional override below it always won) is gone; behavior is unchanged: reset lands on the logo intro, or the start menu in debug mode. Play-verified: hammering reset during the splash screens restarts the logo every press; reset mid-fade after press-start no longer loops back; resets from the main menu and mid-race work as before. * Honor gSkipIntro when picking the post-reset screen Review feedback on #719: restore the gSkipIntro switch from the old handler instead of hard-coding the logo intro, keeping the debug-mode override on top (no else), matching the boot-time logic in main(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine/objects/ChainChomp.cpp')
0 files changed, 0 insertions, 0 deletions