Create a LargeTextureStore for cached (but not atlased) global textures

Also
- Fixes first transition depth being incorrect.
- Improves smoothness of transitions (and adds a slight delay to offset from screen switches).
This commit is contained in:
Dean Herbert
2017-12-31 06:40:28 +09:00
parent 398d90ee52
commit f2d302f8dc
6 changed files with 39 additions and 7 deletions

View File

@ -3,6 +3,7 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Threading;
using osu.Game.Graphics.Backgrounds;
namespace osu.Game.Screens.Backgrounds
@ -24,16 +25,22 @@ namespace osu.Game.Screens.Backgrounds
private void display(Background newBackground)
{
current?.FadeOut(800, Easing.OutQuint);
current?.FadeOut(800, Easing.InOutSine);
current?.Expire();
Add(current = newBackground);
currentDisplay++;
}
private ScheduledDelegate nextTask;
public void Next()
{
currentDisplay++;
LoadComponentAsync(new Background(backgroundName) { Depth = currentDisplay }, display);
nextTask?.Cancel();
nextTask = Scheduler.AddDelayed(() =>
{
LoadComponentAsync(new Background(backgroundName) { Depth = currentDisplay }, display);
}, 100);
}
}
}