mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 20:02:57 +08:00
Reduce smoke allocations
This commit is contained in:
parent
d544b4dbf1
commit
31dabaefaa
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -228,7 +227,9 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
int futurePointIndex = ~Source.SmokePoints.BinarySearch(new SmokePoint { Time = CurrentTime }, new SmokePoint.UpperBoundComparer());
|
int futurePointIndex = ~Source.SmokePoints.BinarySearch(new SmokePoint { Time = CurrentTime }, new SmokePoint.UpperBoundComparer());
|
||||||
|
|
||||||
points.Clear();
|
points.Clear();
|
||||||
points.AddRange(Source.SmokePoints.Skip(firstVisiblePointIndex).Take(futurePointIndex - firstVisiblePointIndex));
|
|
||||||
|
for (int i = firstVisiblePointIndex; i < futurePointIndex; i++)
|
||||||
|
points.Add(Source.SmokePoints[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected sealed override void Draw(IRenderer renderer)
|
protected sealed override void Draw(IRenderer renderer)
|
||||||
|
Loading…
Reference in New Issue
Block a user