Tidy up comments and simplify bounding box centre logic

This commit is contained in:
Dean Herbert
2022-07-02 12:58:34 +09:00
parent 1fd9c64803
commit a03abc747b
2 changed files with 6 additions and 9 deletions

View File

@ -471,12 +471,11 @@ namespace osu.Game.Overlays.Mods
var channel = columnAppearSample?.GetChannel();
if (channel == null) return;
// don't play sample if column isn't visible, but try to play it at least 5 times (assuming there's at least 5 visible columns in `columnFlow`)
// Still play sound effects for off-screen columns up to a certain point.
if (columnNumber > 5 && !column.Active.Value) return;
// use X position of the column on screen as a basis for panning the sample
var bounds = column.Parent.BoundingBox;
float balance = (bounds.TopLeft.X + bounds.Width / 2) / RelativeToAbsoluteFactor.X;
float balance = column.Parent.BoundingBox.Centre.X / RelativeToAbsoluteFactor.X;
// dip frequency and ramp volume of sample over the first 5 displayed columns
float progress = Math.Min(1, columnNumber / 5f);