mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Be extra careful about never ever binding null textures when drawing backgrounds. See #11243
This commit is contained in:
1 parent
9be6b22dd8
commit
e51ea85615
1 file changed
+9
-6
+9
-6
@@ -1079,17 +1079,20 @@ bool MainScreen::DrawBackgroundFor(UIContext &dc, const std::string &gamePath, f
|
||||
return false;
|
||||
}
|
||||
|
||||
Draw::Texture *texture = nullptr;
|
||||
if (ginfo->pic1.texture) {
|
||||
dc.GetDrawContext()->BindTexture(0, ginfo->pic1.texture->GetTexture());
|
||||
texture = ginfo->pic1.texture->GetTexture();
|
||||
} else if (ginfo->pic0.texture) {
|
||||
dc.GetDrawContext()->BindTexture(0, ginfo->pic0.texture->GetTexture());
|
||||
texture = ginfo->pic0.texture->GetTexture();
|
||||
}
|
||||
|
||||
uint32_t color = whiteAlpha(ease(progress)) & 0xFFc0c0c0;
|
||||
dc.Draw()->DrawTexRect(dc.GetBounds(), 0,0,1,1, color);
|
||||
dc.Flush();
|
||||
dc.RebindTexture();
|
||||
|
||||
if (texture) {
|
||||
dc.GetDrawContext()->BindTexture(0, texture);
|
||||
dc.Draw()->DrawTexRect(dc.GetBounds(), 0, 0, 1, 1, color);
|
||||
dc.Flush();
|
||||
dc.RebindTexture();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user