Fade from main menu to gameplay
This commit is contained in:
@ -123,8 +123,11 @@ void GameRenderer::renderPlayingState(
|
||||
float logicalScale,
|
||||
float winW,
|
||||
float winH,
|
||||
bool showExitConfirmPopup
|
||||
bool showExitConfirmPopup,
|
||||
int exitPopupSelectedButton,
|
||||
bool suppressPauseVisuals
|
||||
) {
|
||||
(void)exitPopupSelectedButton;
|
||||
if (!game || !pixelFont) return;
|
||||
|
||||
// Calculate actual content area (centered within the window)
|
||||
@ -236,8 +239,10 @@ void GameRenderer::renderPlayingState(
|
||||
}
|
||||
}
|
||||
|
||||
bool allowActivePieceRender = !game->isPaused() || suppressPauseVisuals;
|
||||
|
||||
// Draw ghost piece (where current piece will land)
|
||||
if (!game->isPaused()) {
|
||||
if (allowActivePieceRender) {
|
||||
Game::Piece ghostPiece = game->current();
|
||||
// Find landing position
|
||||
while (true) {
|
||||
@ -270,7 +275,7 @@ void GameRenderer::renderPlayingState(
|
||||
}
|
||||
|
||||
// Draw the falling piece
|
||||
if (!game->isPaused()) {
|
||||
if (allowActivePieceRender) {
|
||||
drawPiece(renderer, blocksTex, game->current(), gridX, gridY, finalBlockSize, false);
|
||||
}
|
||||
|
||||
@ -412,8 +417,8 @@ void GameRenderer::renderPlayingState(
|
||||
drawSmallPiece(renderer, blocksTex, static_cast<PieceType>(game->held().type), statsX + 60, statsY + statsH - 80, finalBlockSize * 0.6f);
|
||||
}
|
||||
|
||||
// Pause overlay
|
||||
if (game->isPaused() && !showExitConfirmPopup) {
|
||||
// Pause overlay (suppressed when requested, e.g., countdown)
|
||||
if (!suppressPauseVisuals && game->isPaused() && !showExitConfirmPopup) {
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 180);
|
||||
SDL_FRect pauseOverlay{0, 0, logicalW, logicalH};
|
||||
SDL_RenderFillRect(renderer, &pauseOverlay);
|
||||
|
||||
Reference in New Issue
Block a user