corregits bugs dels sub-bucles aplanats
- Demo ja no entra en pausa ni game over (redirigeix a instruccions) - Perdre el focus de la finestra només pausa durant el joc actiu (no en demo, game over ni pausa) - Demo gestionat amb save/restore de section->name per evitar transició del Director Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2944,6 +2944,15 @@ bool Game::isDeathShaking() {
|
||||
|
||||
// Ejecuta un frame del juego
|
||||
void Game::iterate() {
|
||||
// En modo demo, no hay pausa ni game over
|
||||
if (demo.enabled) {
|
||||
if (section->subsection == SUBSECTION_GAME_PAUSE || section->subsection == SUBSECTION_GAME_GAMEOVER) {
|
||||
section->name = SECTION_PROG_TITLE;
|
||||
section->subsection = SUBSECTION_TITLE_INSTRUCTIONS;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Sección juego en pausa
|
||||
if (section->subsection == SUBSECTION_GAME_PAUSE) {
|
||||
if (!pauseInitialized) {
|
||||
@@ -3001,7 +3010,10 @@ void Game::handleEvent(SDL_Event *event) {
|
||||
// SDL_EVENT_QUIT ya lo maneja Director
|
||||
|
||||
if (event->type == SDL_EVENT_WINDOW_FOCUS_LOST) {
|
||||
section->subsection = SUBSECTION_GAME_PAUSE;
|
||||
// Solo pausar durante el juego activo (no en demo, game over, ni ya en pausa)
|
||||
if (!demo.enabled && (section->subsection == SUBSECTION_GAME_PLAY_1P || section->subsection == SUBSECTION_GAME_PLAY_2P)) {
|
||||
section->subsection = SUBSECTION_GAME_PAUSE;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PAUSE
|
||||
|
||||
Reference in New Issue
Block a user