mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:12:54 +08:00
remove other usages of hitobject SampleControlPoint
This commit is contained in:
parent
a634617157
commit
ebe1d852f5
@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
||||
yield break;
|
||||
|
||||
// Samples that allow themselves to be overridden by control points have a volume of 0.
|
||||
int maxVolume = sampledHitObject.Samples.Max(sample => sample.Volume > 0 ? sample.Volume : sampledHitObject.SampleControlPoint.SampleVolume);
|
||||
int maxVolume = sampledHitObject.Samples.Max(sample => sample.Volume);
|
||||
double samplePlayTime = sampledHitObject.GetEndTime();
|
||||
|
||||
EdgeType edgeType = getEdgeAtTime(hitObject, samplePlayTime);
|
||||
|
@ -74,9 +74,9 @@ namespace osu.Game.Rulesets.Edit
|
||||
/// <param name="commitStart">Whether this call is committing a value for HitObject.StartTime and continuing with further adjustments.</param>
|
||||
protected void BeginPlacement(bool commitStart = false)
|
||||
{
|
||||
var nearestSampleControlPoint = beatmap.HitObjects.LastOrDefault(h => h.GetEndTime() < HitObject.StartTime)?.SampleControlPoint?.DeepClone() as SampleControlPoint;
|
||||
|
||||
HitObject.SampleControlPoint = nearestSampleControlPoint ?? new SampleControlPoint();
|
||||
// Take the hitnormal sample of the last hit object
|
||||
var lastHitNormal = beatmap.HitObjects.LastOrDefault(h => h.GetEndTime() < HitObject.StartTime)?.Samples?.FirstOrDefault(o => o.Name == HitSampleInfo.HIT_NORMAL);
|
||||
HitObject.Samples.Add(lastHitNormal);
|
||||
|
||||
placementHandler.BeginPlacement(HitObject);
|
||||
if (commitStart)
|
||||
|
@ -357,13 +357,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
if (samples.Length <= 0)
|
||||
return;
|
||||
|
||||
if (HitObject.SampleControlPoint == null)
|
||||
{
|
||||
throw new InvalidOperationException($"{nameof(HitObject)}s must always have an attached {nameof(HitObject.SampleControlPoint)}."
|
||||
+ $" This is an indication that {nameof(HitObject.ApplyDefaults)} has not been invoked on {this}.");
|
||||
}
|
||||
|
||||
Samples.Samples = samples.Select(s => HitObject.SampleControlPoint.ApplyTo(s)).Cast<ISampleInfo>().ToArray();
|
||||
Samples.Samples = samples.Cast<ISampleInfo>().ToArray();
|
||||
}
|
||||
|
||||
private void onSamplesChanged(object sender, NotifyCollectionChangedEventArgs e) => LoadSamples();
|
||||
|
@ -52,7 +52,6 @@ namespace osu.Game.Rulesets.UI
|
||||
return;
|
||||
|
||||
var samples = nextObject.Samples
|
||||
.Select(s => nextObject.SampleControlPoint.ApplyTo(s))
|
||||
.Cast<ISampleInfo>()
|
||||
.ToArray();
|
||||
|
||||
|
@ -293,10 +293,10 @@ namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
// prepare sample pools ahead of time so we're not initialising at runtime.
|
||||
foreach (var sample in hitObject.Samples)
|
||||
prepareSamplePool(hitObject.SampleControlPoint.ApplyTo(sample));
|
||||
prepareSamplePool(sample);
|
||||
|
||||
foreach (var sample in hitObject.AuxiliarySamples)
|
||||
prepareSamplePool(hitObject.SampleControlPoint.ApplyTo(sample));
|
||||
prepareSamplePool(sample);
|
||||
|
||||
foreach (var nestedObject in hitObject.NestedHitObjects)
|
||||
preloadSamples(nestedObject);
|
||||
|
Loading…
Reference in New Issue
Block a user