mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:52:55 +08:00
Simplify EditorClock.Seek method
This commit is contained in:
parent
073066170c
commit
7f2916454d
@ -85,22 +85,8 @@ namespace osu.Game.Screens.Edit
|
|||||||
var timingPoint = ControlPointInfo.TimingPointAt(CurrentTime);
|
var timingPoint = ControlPointInfo.TimingPointAt(CurrentTime);
|
||||||
|
|
||||||
if (direction < 0 && timingPoint.Time == CurrentTime)
|
if (direction < 0 && timingPoint.Time == CurrentTime)
|
||||||
{
|
|
||||||
// When going backwards and we're at the boundary of two timing points, we compute the seek distance with the timing point which we are seeking into
|
// When going backwards and we're at the boundary of two timing points, we compute the seek distance with the timing point which we are seeking into
|
||||||
int activeIndex = -1;
|
timingPoint = ControlPointInfo.TimingPointAt(CurrentTime - 1);
|
||||||
|
|
||||||
for (int i = 0; i < ControlPointInfo.TimingPoints.Count; i++)
|
|
||||||
{
|
|
||||||
if (ControlPointInfo.TimingPoints[i] == timingPoint)
|
|
||||||
{
|
|
||||||
activeIndex = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (activeIndex > 0 && CurrentTime == timingPoint.Time)
|
|
||||||
timingPoint = ControlPointInfo.TimingPoints[--activeIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
double seekAmount = timingPoint.BeatLength / beatDivisor.Value * amount;
|
double seekAmount = timingPoint.BeatLength / beatDivisor.Value * amount;
|
||||||
double seekTime = CurrentTime + seekAmount * direction;
|
double seekTime = CurrentTime + seekAmount * direction;
|
||||||
|
Loading…
Reference in New Issue
Block a user