Change IsLooping to get-only

This commit is contained in:
hwabis
2023-04-13 12:16:23 -04:00
parent b297678a86
commit 8a3d48f6c8
3 changed files with 8 additions and 5 deletions

View File

@@ -167,11 +167,13 @@ namespace osu.Framework.Graphics.Transforms
if (t.LoopCount > 0)
t.LoopCount--;
if (t.IsLooping && t.LoopCount != 0)
if (t.IsLooping)
{
int oldLoopCount = t.LoopCount;
if (tCanRewind)
{
t.IsLooping = false;
t.LoopCount = 0;
t = t.Clone();
}
@@ -179,7 +181,8 @@ namespace osu.Framework.Graphics.Transforms
t.Applied = false;
t.HasStartValue = false;
t.IsLooping = true;
if (tCanRewind)
t.LoopCount = oldLoopCount;
t.StartTime += t.LoopDelay;
t.EndTime += t.LoopDelay;

View File

@@ -33,7 +33,7 @@ namespace osu.Framework.Graphics.Transforms
public double StartTime { get; internal set; }
public double EndTime { get; internal set; }
public bool IsLooping { get; internal set; }
public bool IsLooping => LoopCount == -1 || LoopCount > 0;
public double LoopDelay { get; internal set; }
/// <summary>

View File

@@ -317,6 +317,7 @@ namespace osu.Framework.Graphics.Transforms
double currentTransformTime = t.TargetTransformable.Time.Current;
int pushForwardCount = 0;
while (t.EndTime <= currentTransformTime)
{
t.StartTime += iterDuration;
@@ -335,7 +336,6 @@ namespace osu.Framework.Graphics.Transforms
foreach (var t in sortedTransforms)
{
t.IsLooping = true;
t.LoopDelay = iterDuration;
t.Applied = false;