Fixed selected level state

This commit is contained in:
2025-08-17 09:44:23 +02:00
parent 0e0519b0e9
commit bc3f69e9d6
3 changed files with 252 additions and 192 deletions

View File

@ -1096,7 +1096,8 @@ int main(int, char **)
// Draw blended backgrounds if needed
if (levelBackgroundTex || nextLevelBackgroundTex) {
SDL_FRect fullRect = { 0, 0, (float)logicalVP.w, (float)logicalVP.h };
// Use actual window pixel size so backgrounds always cover full screen
SDL_FRect fullRect = { 0, 0, (float)winW, (float)winH };
// if fade in progress
if (nextLevelBackgroundTex && levelFadeAlpha < 1.0f && levelBackgroundTex) {
// draw current with inverse alpha
@ -1123,10 +1124,10 @@ int main(int, char **)
} else if (state == AppState::Loading) {
// Use 3D starfield for loading screen (full screen)
starfield3D.draw(renderer);
} else if (state == AppState::Menu) {
} else if (state == AppState::Menu || state == AppState::LevelSelector) {
// Use static background for menu, stretched to window; no starfield on sides
if (backgroundTex) {
SDL_FRect fullRect = { 0, 0, (float)logicalVP.w, (float)logicalVP.h };
SDL_FRect fullRect = { 0, 0, (float)winW, (float)winH };
SDL_RenderTexture(renderer, backgroundTex, nullptr, &fullRect);
}
} else {