1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 07:32:54 +08:00
Commit Graph

35 Commits

Author SHA1 Message Date
Bartłomiej Dach
15d9147edd Ensure equality member consistency for SampleInfo
The previous implementation of `SampleInfo`'s equality members was not
completely correct in its treatment of the `sampleNames` array. While
`Equals()` compared the values of `sampleNames` using `SequenceEqual()`,
therefore performing a structural check that inspects the contents of
both arrays, `GetHashCode()` used `HashCode.Combine()` directly on the
arrays, therefore operating on reference equality. This could cause the
pooling mechanism of samples to fail, as pointed out in #11079.

To resolve, change the `GetHashCode()` implementation such that it also
considers the contents of the array rather than just the reference to
the array itself. This is achieved by leveraging
`StructuralEqualityComparer`.

Additionally, as a bonus, an array sort was added to the constructor of
`SampleInfo`. This is intended to be a "canonicalisation" processing
step for the array of sample names. Thanks to that sort, two instances
of `SampleInfo` that have the same sample names but permutated will also
turn out to be equal and have the same hash codes, given the
implementation of both equality members. This gives `SampleInfo`
set-like semantics.
2020-12-03 23:25:53 +01:00
smoogipoo
730b14b5bb Add initial hit sample pooling 2020-11-19 19:51:09 +09:00
Dean Herbert
c9a85587fb Allow SampleInfo to specify fallback sample lookup names 2020-10-30 11:59:29 +09:00
Dean Herbert
740bdee125 Apply remaining uncaught changes 2020-01-20 23:59:21 +09:00
Dean Herbert
60ea3d4e1a Fix skinning support for combobreak 2019-06-30 21:58:30 +09:00
Dean Herbert
26d53d06a9 Fix remaining issues 2019-02-28 13:31:40 +09:00
Dean Herbert
8617aaa2a7 Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
Dean Herbert
14c3cc70b1
Prefer namespace lookups first 2018-07-10 15:23:47 +09:00
Dean Herbert
ba258b8a05 Fix lack of fallback logic for custom bank samples
Closes #2966.

---

Was causing some beatmaps to not play all of their hitsounds
2018-07-10 02:56:22 +09:00
Dean Herbert
8f04acc506 Add missing xmldoc 2018-07-05 20:16:55 +09:00
smoogipoo
189194ee8d Don't include empty namespace in sample lookup 2018-07-02 14:35:03 +09:00
smoogipoo
310c4a7d6c Make SampleInfo choose its own lookup name 2018-07-02 14:18:41 +09:00
smoogipoo
8b0c6a4c85 Make SampleControlPoint clone the existing SampleInfo 2018-07-02 14:17:19 +09:00
Dean Herbert
32a74f95a5 Normalize all the line endings 2018-04-13 18:26:38 +09:00
Dean Herbert
768e0a4e2a Add SkinnableSound class
Tidy things up, move logic out of SampleInfo.
2018-02-24 22:47:14 +09:00
Dean Herbert
6ceabfe19e Add basic hitsound skinning 2018-02-23 13:38:12 +09:00
Dean Herbert
37d393bca0 Update licence headers 2018-01-05 20:21:19 +09:00
Dean Herbert
4e6988d21b As it turns out, native directory separators are not supported 2017-12-28 01:05:50 +09:00
Dean Herbert
3f73a9a693 Add better sample fallback logic
Also adds support for null channels at InputDrum level.
2017-12-27 21:44:04 +09:00
Dean Herbert
46ef17354e Simplify path construction 2017-12-27 21:05:16 +09:00
smoogipoo
9690591593 Make taiko use namespaced hitsounds
This is a temporary solution for now that uses DrawableHitObject.SampleNamespace for the override. We will not want to do this going forward, and instead have the rulesets add their custom resource stores to the games', but that requires deciding where/when to apply/remove such resource stores, and is probably left to skinning.
2017-12-26 19:55:56 +09:00
Dean Herbert
2db68df999 Simplify DrawableHitObject's sample load code 2017-12-23 17:20:14 +09:00
Dean Herbert
9ca03c0209 Simplify and tidy sample retrieval
Less static weirdness
2017-12-23 16:46:02 +09:00
Dean Herbert
5026c7a95e SoundControlPoint -> SampleControlPoint 2017-12-23 16:34:34 +09:00
Dean Herbert
46865bbacd Merge remote-tracking branch 'upstream/master' into taiko-hitsounds-fix
# Conflicts:
#	osu.Game/Audio/SampleInfo.cs
2017-12-23 14:50:35 +09:00
smoogipoo
a3fcc0b60c Back to using SortedLists 2017-12-21 19:40:41 +09:00
smoogipoo
cb7e192aff Determine SampleInfo defaults in DrawableHitObject 2017-12-21 16:02:33 +09:00
FreezyLemon
4b3cf0773d Various CI adjustments 2017-12-08 09:52:58 +01:00
FreezyLemon
61a6a2919e Fixed multiple critical bugs and changed allSamples to a normal Dictionary for faster access 2017-12-08 09:41:13 +01:00
FreezyLemon
d2f3d5a807 Added basic SampleInfo.FromSoundPoint and GetChannel methods 2017-12-07 23:09:51 +01:00
smoogipoo
851c20aff0 Add a few comments 2017-12-07 11:17:32 +09:00
smoogipoo
ea2c67ca5f Fix incorrect serialization condition 2017-12-07 11:10:46 +09:00
smoogipoo
41b607c165 Dont serialize hitobject sample properties copied from the control point 2017-12-07 03:40:43 +09:00
smoogipooo
4cc309e5a7 Make hit sounds into consts. 2017-04-06 12:14:06 +09:00
smoogipooo
eb82a4c090 Back to using SampleInfo + fix taiko beatmap conversion. 2017-04-06 11:41:16 +09:00