mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 07:22:55 +08:00
Improve tiling logic
This commit is contained in:
parent
afcb45f28b
commit
510df8b282
@ -21,19 +21,28 @@ namespace osu.Game.Rulesets.Taiko.Skinning
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
foreach (var sprite in InternalChildren)
|
while (true)
|
||||||
{
|
{
|
||||||
sprite.X -= (float)Time.Elapsed * 0.1f;
|
float? additiveX = null;
|
||||||
|
|
||||||
if (sprite.X + sprite.DrawWidth < 0)
|
foreach (var sprite in InternalChildren)
|
||||||
sprite.Expire();
|
{
|
||||||
}
|
// add the x coordinates and perform re-layout on all sprites as spacing may change with gameplay scale.
|
||||||
|
sprite.X = additiveX ??= sprite.X - (float)Time.Elapsed * 0.1f;
|
||||||
|
|
||||||
var last = InternalChildren.LastOrDefault();
|
additiveX += sprite.DrawWidth - 1;
|
||||||
|
|
||||||
if (last == null || last.ScreenSpaceDrawQuad.TopRight.X < ScreenSpaceDrawQuad.TopRight.X)
|
if (sprite.X + sprite.DrawWidth < 0)
|
||||||
{
|
sprite.Expire();
|
||||||
AddInternal(new ScrollerSprite { X = last == null ? 0 : last.X + last.DrawWidth });
|
}
|
||||||
|
|
||||||
|
var last = InternalChildren.LastOrDefault();
|
||||||
|
|
||||||
|
// only break from this loop once we have saturated horizontal space completely.
|
||||||
|
if (last != null && last.ScreenSpaceDrawQuad.TopRight.X >= ScreenSpaceDrawQuad.TopRight.X)
|
||||||
|
break;
|
||||||
|
|
||||||
|
AddInternal(new ScrollerSprite());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user