fixed counter timer when start playing game and exit game

This commit is contained in:
2025-11-23 10:02:02 +01:00
parent 5bf87f2c21
commit b33a90d5c5
5 changed files with 24 additions and 18 deletions

View File

@ -335,10 +335,22 @@ void MenuState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect logi
if (ctx.showExitConfirmPopup && *ctx.showExitConfirmPopup) {
int selection = ctx.exitPopupSelectedButton ? *ctx.exitPopupSelectedButton : 1;
// Switch to window coordinates for full-screen overlay
SDL_SetRenderViewport(renderer, nullptr);
SDL_SetRenderScale(renderer, 1.0f, 1.0f);
SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 150);
SDL_FRect overlay{contentOffsetX, contentOffsetY, LOGICAL_W, LOGICAL_H};
// Get actual window size
int actualWinW = 0, actualWinH = 0;
SDL_GetRenderOutputSize(renderer, &actualWinW, &actualWinH);
SDL_FRect overlay{0, 0, (float)actualWinW, (float)actualWinH};
SDL_RenderFillRect(renderer, &overlay);
// Restore viewport and scale for popup content
SDL_SetRenderViewport(renderer, &logicalVP);
SDL_SetRenderScale(renderer, logicalScale, logicalScale);
const float panelW = 640.0f;
const float panelH = 320.0f;