From 1814fa560221d1576ce090d6519c3ad79a4eebd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 14 Dec 2020 00:38:02 +0100 Subject: [PATCH] Fix background idle animation on iOS when task switching --- UI/MiscScreens.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 16ad329f64..c9fa81db85 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -126,7 +126,15 @@ void DrawBackground(UIContext &dc, float alpha) { ui_draw2d.DrawImageStretch(img, dc.GetBounds(), bgColor); } +#if PPSSPP_PLATFORM(IOS) + // iOS uses an old screenshot when restoring the task, so to avoid an ugly + // jitter we accumulate time instead. + static int frameCount = 0.0; + frameCount++; + double t = (double)frameCount / 60.0; +#else double t = time_now_d(); +#endif for (int i = 0; i < 100; i++) { float x = xbase[i] + dc.GetBounds().x; float y = ybase[i] + dc.GetBounds().y + 40 * cosf(i * 7.2f + t * 1.3f);