From eb5c98cd07fd338f53a147e8138dab8871d97bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 2 Aug 2025 23:02:36 +0200 Subject: [PATCH] Don't use PIC0 as background if PIC1 is missing (actually this time). Remove dark background. --- UI/GameInfoCache.h | 4 +--- UI/GameScreen.cpp | 3 --- UI/MainScreen.cpp | 2 +- UI/MiscScreens.cpp | 4 ++-- UI/SavedataScreen.cpp | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/UI/GameInfoCache.h b/UI/GameInfoCache.h index 1fee1ce144..76f7738a5c 100644 --- a/UI/GameInfoCache.h +++ b/UI/GameInfoCache.h @@ -121,11 +121,9 @@ public: pendingFlags &= ~flags; } - GameInfoTex *GetBGPic() { + GameInfoTex *GetPIC1() { if (pic1.texture) return &pic1; - if (pic0.texture) - return &pic0; return nullptr; } diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index a40abdfe99..31c6ea3018 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -528,9 +528,6 @@ ScreenRenderFlags GameScreen::render(ScreenRenderMode mode) { } if (draw) { - // draw a dark rectangle behind the image. - dc.FillRect(UI::Drawable(0x80000000), bounds); - dc.Flush(); dc.GetDrawContext()->BindTexture(0, info->pic0.texture); diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 950123ae4b..69055644d3 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -1461,7 +1461,7 @@ bool MainScreen::DrawBackgroundFor(UIContext &dc, const Path &gamePath, float pr return false; } - auto pic = ginfo->GetBGPic(); + auto pic = ginfo->GetPIC1(); Draw::Texture *texture = pic ? pic->texture : nullptr; uint32_t color = whiteAlpha(ease(progress)) & 0xFFc0c0c0; diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 8e489904ea..b2f1f87383 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -273,7 +273,7 @@ private: static void DrawTex(UIContext &dc, std::shared_ptr &ginfo, float amount) { if (!ginfo || amount <= 0.0f) return; - GameInfoTex *pic = ginfo->GetBGPic(); + GameInfoTex *pic = ginfo->GetPIC1(); if (!pic) return; @@ -491,7 +491,7 @@ void DrawGameBackground(UIContext &dc, const Path &gamePath, float x, float y, f ginfo = g_gameInfoCache->GetInfo(dc.GetDrawContext(), gamePath, GameInfoFlags::PIC1); } - GameInfoTex *pic = (ginfo && ginfo->Ready(GameInfoFlags::PIC1)) ? ginfo->GetBGPic() : nullptr; + GameInfoTex *pic = (ginfo && ginfo->Ready(GameInfoFlags::PIC1)) ? ginfo->GetPIC1() : nullptr; if (pic) { dc.GetDrawContext()->BindTexture(0, pic->texture); uint32_t color = whiteAlpha(ease((time_now_d() - pic->timeLoaded) * 3)) & 0xFFc0c0c0; diff --git a/UI/SavedataScreen.cpp b/UI/SavedataScreen.cpp index 87f082a829..63cc707703 100644 --- a/UI/SavedataScreen.cpp +++ b/UI/SavedataScreen.cpp @@ -748,7 +748,7 @@ void GameIconView::Draw(UIContext &dc) { // Fade icon with the backgrounds. double loadTime = info->icon.timeLoaded; - auto pic = info->GetBGPic(); + auto pic = info->GetPIC1(); if (pic) { loadTime = std::max(loadTime, pic->timeLoaded); }