Skip to content

Commit

Permalink
Fix wrong opacity formula
Browse files Browse the repository at this point in the history
  • Loading branch information
MBmasher committed Nov 21, 2021
1 parent e9a4ee6 commit e9745a3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ public OsuDifficultyHitObject(HitObject hitObject, HitObject lastLastObject, Hit
public double Opacity(double ms, bool hidden)
{
double preemptTime = BaseObject.TimePreempt / clockRate;
double fadeInTime = BaseObject.TimeFadeIn / clockRate;

if (hidden)
return Math.Clamp(Math.Min((1 - ms / preemptTime) * 2.5, (ms / preemptTime) * (1.0 / 0.3)), 0.0, 1.0);
return Math.Clamp(Math.Min((1.0 - ms / preemptTime) * 2.5, (ms / preemptTime - 0.3) * (1.0 / 0.3)), 0.0, 1.0);
else
return Math.Clamp((1.0 - ms / preemptTime) * 1.5, 0.0, 1.0);
return Math.Clamp((preemptTime - ms) / fadeInTime, 0.0, 1.0);
}

private void setDistances(double clockRate)
Expand Down

0 comments on commit e9745a3

Please sign in to comment.