fixed counter timer when start playing game and exit game
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user