mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:02:54 +08:00
ComputePositions -> UpdatePositions
This commit is contained in:
parent
52e3ffff30
commit
11b943c820
@ -110,7 +110,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
base.UpdateAfterChildrenLife();
|
base.UpdateAfterChildrenLife();
|
||||||
|
|
||||||
// We need to calculate this as soon as possible after lifetimes so that hitobjects get the final say in their positions
|
// We need to calculate this as soon as possible after lifetimes so that hitobjects get the final say in their positions
|
||||||
speedChangeVisualiser.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize);
|
speedChangeVisualiser.UpdatePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,24 +10,23 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
|
|||||||
public interface ISpeedChangeVisualiser
|
public interface ISpeedChangeVisualiser
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Computes the states of <see cref="DrawableHitObject"/>s that are constant, such as lifetime and spatial length.
|
/// Computes the states of <see cref="DrawableHitObject"/>s that remain constant while scrolling, such as lifetime and spatial length.
|
||||||
/// This is invoked once whenever <paramref name="timeRange"/> or <paramref name="length"/> changes.
|
/// This is invoked once whenever <paramref name="timeRange"/> or <paramref name="length"/> changes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hitObjects">The <see cref="DrawableHitObject"/>s whose states should be computed.</param>
|
/// <param name="hitObjects">The <see cref="DrawableHitObject"/>s whose states should be computed.</param>
|
||||||
/// <param name="direction">The scrolling direction.</param>
|
/// <param name="direction">The scrolling direction.</param>
|
||||||
/// <param name="timeRange">The duration required to scroll through one length of the screen before any control point adjustments.</param>
|
/// <param name="timeRange">The duration required to scroll through one length of the screen before any speed adjustments.</param>
|
||||||
/// <param name="length">The length of the screen that is scrolled through.</param>
|
/// <param name="length">The length of the screen that is scrolled through.</param>
|
||||||
void ComputeInitialStates(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double timeRange, Vector2 length);
|
void ComputeInitialStates(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double timeRange, Vector2 length);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Computes the states of <see cref="DrawableHitObject"/>s that change depending on <paramref name="currentTime"/>, such as position.
|
/// Updates the positions of <see cref="DrawableHitObject"/>s, depending on the current time. This is invoked once per frame.
|
||||||
/// This is invoked once per frame.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hitObjects">The <see cref="DrawableHitObject"/>s whose states should be computed.</param>
|
/// <param name="hitObjects">The <see cref="DrawableHitObject"/>s whose positions should be computed.</param>
|
||||||
/// <param name="direction">The scrolling direction.</param>
|
/// <param name="direction">The scrolling direction.</param>
|
||||||
/// <param name="currentTime">The current time.</param>
|
/// <param name="currentTime">The current time.</param>
|
||||||
/// <param name="timeRange">The duration required to scroll through one length of the screen before any control point adjustments.</param>
|
/// <param name="timeRange">The duration required to scroll through one length of the screen before any speed adjustments.</param>
|
||||||
/// <param name="length">The length of the screen that is scrolled through.</param>
|
/// <param name="length">The length of the screen that is scrolled through.</param>
|
||||||
void ComputePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length);
|
void UpdatePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,12 +52,12 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
|
|||||||
ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length);
|
ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length);
|
||||||
|
|
||||||
// Nested hitobjects don't need to scroll, but they do need accurate positions
|
// Nested hitobjects don't need to scroll, but they do need accurate positions
|
||||||
ComputePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length);
|
UpdatePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ComputePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length)
|
public void UpdatePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length)
|
||||||
{
|
{
|
||||||
foreach (var obj in hitObjects)
|
foreach (var obj in hitObjects)
|
||||||
{
|
{
|
||||||
|
@ -53,12 +53,12 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
|
|||||||
ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length);
|
ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length);
|
||||||
|
|
||||||
// Nested hitobjects don't need to scroll, but they do need accurate positions
|
// Nested hitobjects don't need to scroll, but they do need accurate positions
|
||||||
ComputePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length);
|
UpdatePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ComputePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length)
|
public void UpdatePositions(IEnumerable<DrawableHitObject> hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length)
|
||||||
{
|
{
|
||||||
var timelinePosition = positionAt(currentTime, timeRange);
|
var timelinePosition = positionAt(currentTime, timeRange);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user