Skip to content

Commit

Permalink
Avoid beatmap lookup per bar in logo visualisation
Browse files Browse the repository at this point in the history
Just noticed in passing.
  • Loading branch information
peppy committed Dec 10, 2024
1 parent 197d553 commit d69f5fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion osu.Game/Screens/Menu/LogoVisualisation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ private void updateAmplitudes()
foreach (var source in amplitudeSources)
addAmplitudesFromSource(source);

float kiaiMultiplier = beatSyncProvider.CheckIsKiaiTime() ? 1 : 0.5f;

for (int i = 0; i < bars_per_visualiser; i++)
{
float targetAmplitude = (temporalAmplitudes[(i + indexOffset) % bars_per_visualiser]) * (beatSyncProvider.CheckIsKiaiTime() ? 1 : 0.5f);
float targetAmplitude = (temporalAmplitudes[(i + indexOffset) % bars_per_visualiser]) * kiaiMultiplier;

if (targetAmplitude > frequencyAmplitudes[i])
frequencyAmplitudes[i] = targetAmplitude;
}
Expand Down

0 comments on commit d69f5fd

Please sign in to comment.