Rewrite the way speed adjustments are applied.

This commit is contained in:
smoogipooo
2017-06-09 19:57:03 +09:00
parent 921350128d
commit 1f56848442
11 changed files with 138 additions and 109 deletions

View File

@ -5,14 +5,14 @@ using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Caching;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
using osu.Framework.Configuration;
namespace osu.Game.Rulesets.Timing.Drawables
namespace osu.Game.Rulesets.Timing
{
/// <summary>
/// A collection of hit objects which scrolls within a <see cref="SpeedAdjustmentContainer"/>.

View File

@ -1,11 +1,13 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.IO.Serialization;
namespace osu.Game.Rulesets.Timing
{
public class MultiplierControlPoint
public class MultiplierControlPoint : IJsonSerializable, IComparable<MultiplierControlPoint>
{
/// <summary>
/// The time in milliseconds at which this control point starts.
@ -20,9 +22,22 @@ namespace osu.Game.Rulesets.Timing
public TimingControlPoint TimingPoint = new TimingControlPoint();
public DifficultyControlPoint DifficultyPoint = new DifficultyControlPoint();
public MultiplierControlPoint()
{
}
public MultiplierControlPoint(double startTime)
{
StartTime = startTime;
}
public MultiplierControlPoint(double startTime, MultiplierControlPoint other)
: this(startTime)
{
TimingPoint = other.TimingPoint;
DifficultyPoint = other.DifficultyPoint;
}
public int CompareTo(MultiplierControlPoint other) => StartTime.CompareTo(other?.StartTime);
}
}

View File

@ -7,7 +7,6 @@ using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Timing.Drawables;
using OpenTK;
namespace osu.Game.Rulesets.Timing

View File

@ -120,6 +120,11 @@ namespace osu.Game.Rulesets.UI
/// </summary>
public Beatmap<TObject> Beatmap;
/// <summary>
/// The mods which are to be applied.
/// </summary>
protected IEnumerable<Mod> Mods;
/// <summary>
/// Creates a hit renderer for a beatmap.
/// </summary>
@ -129,6 +134,8 @@ namespace osu.Game.Rulesets.UI
{
Debug.Assert(beatmap != null, "HitRenderer initialized with a null beatmap.");
Mods = beatmap.Mods.Value;
RelativeSizeAxes = Axes.Both;
BeatmapConverter<TObject> converter = CreateBeatmapConverter();