Skip to content

Commit

Permalink
Move constant for default ControlPoint out of Slider.
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Feb 18, 2017
1 parent bf33cc6 commit 94dd268
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions osu.Game.Modes.Osu/Objects/Slider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public override void SetDefaultsFromBeatmap(Beatmap beatmap)
ControlPoint overridePoint;
ControlPoint timingPoint = beatmap.TimingPointAt(StartTime, out overridePoint);
var velocityAdjustment = overridePoint?.VelocityAdjustment ?? 1;
var baseVelocity = 100 * baseDifficulty.SliderMultiplier;
var baseVelocity = 100 * baseDifficulty.SliderMultiplier / velocityAdjustment;

Velocity = baseVelocity / ((timingPoint?.BeatLength ?? 500) * velocityAdjustment);
TickDistance = baseVelocity / (baseDifficulty.SliderTickRate * velocityAdjustment);
Velocity = baseVelocity / timingPoint.BeatLength;
TickDistance = baseVelocity / baseDifficulty.SliderTickRate;
}

public int RepeatCount = 1;
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Beatmaps/Beatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public ControlPoint TimingPointAt(double time, out ControlPoint overridePoint)
else break;
}

return timingPoint;
return timingPoint ?? ControlPoint.Default;
}
}
}
13 changes: 7 additions & 6 deletions osu.Game/Beatmaps/Timing/ControlPoint.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace osu.Game.Beatmaps.Timing
{
public class ControlPoint
{
public static ControlPoint Default = new ControlPoint
{
BeatLength = 500,
TimingChange = true,
};

public double Time;
public double BeatLength;
public double VelocityAdjustment;
public bool TimingChange;

}

internal enum TimeSignatures
Expand Down

0 comments on commit 94dd268

Please sign in to comment.