Fix weird application logic

This commit is contained in:
Dean Herbert 2019-03-13 21:37:33 +09:00
parent 5d23a966d7
commit c40e24739b
1 changed files with 5 additions and 3 deletions

View File

@ -62,12 +62,14 @@ public virtual void ApplyToBeatmap(Beatmap<T> beatmap)
public virtual void Update(Playfield playfield)
{
var absRate = Math.Abs(FinalRateAdjustment);
applyAdjustment(MathHelper.Clamp(absRate * ((clock.CurrentTime - beginRampTime) / finalRateTime), 0, absRate));
applyAdjustment((clock.CurrentTime - beginRampTime) / finalRateTime);
}
private void applyAdjustment(double adjustment)
private void applyAdjustment(double adjustAmount)
{
var localAdjust = 1 + Math.Sign(FinalRateAdjustment) * adjustment;
adjustAmount = MathHelper.Clamp(adjustAmount, 0, 1);
var localAdjust = 1 + Math.Sign(FinalRateAdjustment) * adjustAmount * Math.Abs(FinalRateAdjustment);
if (clock is IHasPitchAdjust tempo)
tempo.PitchAdjust = baseAdjust * localAdjust;