mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Merge pull request #21446 from hrydgard/final-bg-fix
Fix bug with background fadeouts when switching to other UI. Speedup fades.
This commit is contained in:
+12
-6
@@ -1623,7 +1623,7 @@ void MainScreen::DrawBackground(UIContext &dc) {
|
||||
return;
|
||||
}
|
||||
|
||||
constexpr float fadeTime = 0.5f; //
|
||||
constexpr float fadeTime = 0.25f;
|
||||
|
||||
double now = time_now_d();
|
||||
|
||||
@@ -1682,16 +1682,22 @@ void MainScreen::OnGameHighlight(UI::EventParams &e) {
|
||||
|
||||
Path path(e.s);
|
||||
|
||||
if (path == highlightedGamePath_) {
|
||||
if (path == highlightedGamePath_ && e.a == FF_GOTFOCUS) {
|
||||
// Already highlighted, nothing to do.
|
||||
return;
|
||||
}
|
||||
|
||||
// Trigger fadeouts on any active highlights.
|
||||
for (auto &iter : highlightedBackgrounds_) {
|
||||
if (iter.endTime < 0.0) {
|
||||
iter.endTime = time_now_d();
|
||||
if (e.a == FF_LOSTFOCUS) {
|
||||
// Lost focus, so we want to fade out the background.
|
||||
|
||||
// Trigger fadeouts on any active highlights.
|
||||
for (auto &iter : highlightedBackgrounds_) {
|
||||
if (iter.endTime < 0.0) {
|
||||
iter.endTime = time_now_d();
|
||||
}
|
||||
}
|
||||
highlightedGamePath_.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
highlightedGamePath_ = path;
|
||||
|
||||
Reference in New Issue
Block a user