fixed gameplay

This commit is contained in:
2025-12-20 15:17:35 +01:00
parent 9a3c1a0688
commit ad014e1de0
10 changed files with 176 additions and 25 deletions

View File

@ -221,11 +221,15 @@ void PlayingState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect l
bool exitPopup = ctx.showExitConfirmPopup && *ctx.showExitConfirmPopup;
bool countdown = (ctx.gameplayCountdownActive && *ctx.gameplayCountdownActive) ||
(ctx.menuPlayCountdownArmed && *ctx.menuPlayCountdownArmed);
bool challengeClearFx = ctx.challengeClearFxActive && *ctx.challengeClearFxActive;
const std::vector<int>* challengeClearOrder = ctx.challengeClearFxOrder;
double challengeClearElapsed = ctx.challengeClearFxElapsedMs ? *ctx.challengeClearFxElapsedMs : 0.0;
double challengeClearDuration = ctx.challengeClearFxDurationMs ? *ctx.challengeClearFxDurationMs : 0.0;
// Only blur if paused AND NOT in countdown (and not exit popup, though exit popup implies paused)
// Actually, exit popup should probably still blur/dim.
// But countdown should definitely NOT show the "PAUSED" overlay.
bool shouldBlur = paused && !countdown;
bool shouldBlur = paused && !countdown && !challengeClearFx;
if (shouldBlur && m_renderTarget) {
// Render game to texture
@ -260,8 +264,12 @@ void PlayingState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect l
1200.0f, // LOGICAL_W
1000.0f, // LOGICAL_H
logicalScale,
(float)winW,
(float)winH
(float)winW,
(float)winH,
challengeClearFx,
challengeClearOrder,
challengeClearElapsed,
challengeClearDuration
);
// Reset to screen
@ -351,7 +359,11 @@ void PlayingState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect l
1000.0f,
logicalScale,
(float)winW,
(float)winH
(float)winH,
challengeClearFx,
challengeClearOrder,
challengeClearElapsed,
challengeClearDuration
);
}
}

View File

@ -67,6 +67,11 @@ struct StateContext {
int* exitPopupSelectedButton = nullptr; // 0 = YES, 1 = NO (default)
bool* gameplayCountdownActive = nullptr; // True if start-of-game countdown is running
bool* menuPlayCountdownArmed = nullptr; // True if we are transitioning to play and countdown is pending
// Challenge clear FX (slow block-by-block explosion before next level)
bool* challengeClearFxActive = nullptr;
double* challengeClearFxElapsedMs = nullptr;
double* challengeClearFxDurationMs = nullptr;
std::vector<int>* challengeClearFxOrder = nullptr;
std::string* playerName = nullptr; // Shared player name buffer for highscores/options
bool* fullscreenFlag = nullptr; // Tracks current fullscreen state when available
std::function<void(bool)> applyFullscreen; // Allows states to request fullscreen changes