Skip to content

Commit

Permalink
handle Beat values >= 1920
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasu3D authored and Raymonf committed Jan 9, 2024
1 parent 341d3b0 commit 744235b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions BAKKA_Editor/Note.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,41 @@ public BeatInfo(int measure, int beat)
{
Measure = measure;
Beat = beat;

if (beat >= 1920)
{
Measure++;
Beat %= 1920;
}

MeasureDecimal = GetMeasureDecimal(measure, beat);
}

public BeatInfo(float measure)
{
Measure = (int) measure;
Beat = (int) MathF.Round((measure - Measure) * 1920.0f);

if (Beat >= 1920)
{
Measure++;
Beat %= 1920;
}

MeasureDecimal = measure;
}

public BeatInfo(BeatInfo info)
{
Measure = info.Measure;
Beat = info.Beat;

if (Beat >= 1920)
{
Measure++;
Beat %= 1920;
}

MeasureDecimal = GetMeasureDecimal(Measure, Beat);
}

Expand Down

0 comments on commit 744235b

Please sign in to comment.