Commit Graph

840 Commits

Author SHA1 Message Date
f41e34ae2c Remove more obsoleted members 2021-06-09 14:10:48 +09:00
0ce7baa3f3 Make HitObjectContainer.Clear non-virtual
It just call `Remove` for all entries.
2021-06-03 15:00:16 +09:00
2c9e5b6c7e Replace EntryCrossedBoundary with more useful RemoveRewoundEntry property
It can be used for dynamically added entries.
2021-06-03 15:00:16 +09:00
fe2934db1d Factor out lifetime management logic of HitObjectContainer 2021-06-03 14:57:28 +09:00
d3d8941ec8 Make method internal 2021-06-02 11:11:41 +09:00
8ee2b3a2d2 Merge branch 'master' into fix-scrolling-lifetime 2021-06-02 11:08:28 +09:00
ac83450791 Merge pull request #13256 from ekrctb/update-lifetime-2
Update DHO lifetime on entry lifetime change
2021-06-02 11:07:54 +09:00
40949f6c1b Simplify lifetime setter
Setting entry lifetime will cause `LifetimeChanged` event and `base.LifetimeStart`/`End` will be modified in the callback.
2021-06-01 14:46:43 +09:00
0f381f7758 Fix wrong code 2021-06-01 14:38:02 +09:00
86020adf64 Revert invalid code transformation 2021-06-01 14:28:23 +09:00
d5714e63b9 Apply code styling suggestions
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
2021-06-01 13:17:30 +09:00
86d1ba7ef2 Remove unused IScrollingHitObject interface 2021-05-31 23:17:26 +09:00
56a0a24cba Make SetInitialLifetime public 2021-05-31 15:33:28 +09:00
e25cca6fbe Update drawable lifetime on entry lifetime change 2021-05-31 14:45:29 +09:00
8c6277f0d8 Merge pull request #13235 from ekrctb/update-lifetime-1
Update hit object lifetime on `HitObject.DefaultsApplied`
2021-05-31 14:44:40 +09:00
0c101d2859 Apply comment rewording suggestion
Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
2021-05-31 13:41:49 +09:00
abb77b95b4 Fix comment grammar 2021-05-30 13:06:28 +09:00
265dfe5416 Add test case of DHO setting LifetimeStart in OnApply 2021-05-28 21:51:48 +09:00
43bf734816 Reset lifetime on HitObject.DefaultsApplied 2021-05-28 21:35:26 +09:00
1d5e8f4a91 Fix wrong/misleading comment of InitialLifetimeOffset 2021-05-28 17:19:36 +09:00
122bb05aa8 Add a mention that OnApply/OnFree is performed after ApplyDefaults 2021-05-27 15:20:35 +09:00
7494ddeef4 Fix DHOs not receiving initial skin changed events 2021-05-24 14:07:40 +09:00
0489ae719d Don't couple PoolableDrawableWithLifetime lifetime with its entry
It turns out the incompatibility with `LifetimeManagementContainer` causes more issues than anticipated.
2021-05-20 14:56:15 +09:00
ef81bdf63f Merge branch 'master' into always-use-lifetime-entry 2021-05-18 20:10:12 +09:00
cd6d070b4a Consider "combo offsets" as legacy logic and separate from combo information 2021-05-05 07:43:08 +03:00
eeeb001d62 Refactor combo colour retrieval logic to request skin lookups instead 2021-05-05 07:17:27 +03:00
aa42cf2fc0 Fix setting lifetime during KeepAlive is ignored 2021-05-04 16:56:48 +09:00
36438175a0 Throw an exception if try to modify lifetime of PoolableDrawableWithLifetime without lifetime 2021-05-04 16:04:58 +09:00
e6eea73b8b Merge branch 'master' into basic-compose-checks 2021-04-30 23:41:46 +09:00
5aa522b1c2 Completely delegate DHO lifetime to Entry lifetime
A downside is lifetime update is not caught by LifetimeManagementContainer if used.
2021-04-29 14:38:01 +09:00
d262956146 Always use LifetimeEntry to manage hit objects in HitObjectContainer
Previously, non-pooled DHOs were immediately added as children of the HOC when Add is called. Also, non-pooled DHOs were always attached to the HOC as children.
New behavior is that non-pooled DHOs are only added after CheckChildLifetime, and only attached to the HOC while the DHOs are alive.

- LifetimeManagementContainer inheritance of HOC is removed, as it is now all DHOs are "unmanaged" (previously `AddInternal(false)`).
- The signature of `Clear` is changed, and it is now always not disposing the children immediately.
2021-04-29 14:38:01 +09:00
5fc731967b Merge pull request #12592 from ekrctb/fix-entry-lifetime
Fix Setting DHO's lifetime doesn't update its entry lifetime
2021-04-28 01:38:19 +09:00
b87446a577 Simplify HitObjectLifetimeEntry logic a bit 2021-04-27 19:37:01 +09:00
3ea55314f2 Update osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs
Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
2021-04-27 11:29:16 +02:00
3899e500d3 Adopt framework change of LifetimeEntry
Override SetLifetimeStart/SetLifetimeEnd separately to track individual assignment. It is necessary to ensure real lifetime is not lost when lifetime is partially updated.
2021-04-27 17:54:18 +09:00
c9e6ca5378 Use now-public Entry.SetLifetime method 2021-04-27 15:25:05 +09:00
a2c0951d94 Use overriding instead of hiding in HitObjectLifetimeEntry
Hidden properties are used when the type is the base class. It caused issues when `DrawableHitObject` logic is factored out to `PoolableDrawableWithLifetime` because it is using the base `LifetimeEntry`, not `HitObjectLifetimeEntry`.
2021-04-27 15:23:33 +09:00
a3570e18dd Add concurrent objects check
Here we use `IHasColumn` to support rulesets with columns, and so I moved that interface out into `osu.Game` from `osu.Game.Rulesets.Mania`.

We also use the same threshold as the unsnap check to ensure that no problems slip through. Specifically where an object is simultaneously not concurrent and not unsnapped but still on the same tick.
2021-04-26 20:17:18 +02:00
08a232f7fa Add method to safely refresh DrawableHitObject transforms 2021-04-26 20:08:40 +02:00
6561a7c7d6 Rename DrawableObject -> PoolableDrawableWithLifetime 2021-04-26 12:06:21 +09:00
20e3cadd30 freeIfInUse -> free, and add comments 2021-04-26 12:04:59 +09:00
e6474e6ff7 Remove redundant statement (lifetime is set in base) 2021-04-26 11:47:38 +09:00
b877a29737 Factor out pooling and lifetime management logic of DHO to a base class 2021-04-21 17:37:42 +09:00
bbf2ec369b Remove SkinReloadableDrawable inheritance from DHO 2021-04-21 17:34:57 +09:00
3fbeadf318 Deprecate old overload of Apply 2021-04-21 14:32:37 +09:00
73d3da1687 Fix wrong InitialLifetimeOffset is used for a non-pooled DHO.
HitObjectLifetimeEntry's InitialLifetimeOffset is different from DrawableHitObject's InitialLifetimeOffset.
2021-04-21 11:32:01 +09:00
44ff08cce4 Revert "Fix wrong InitialLifetimeOffset is used for a non-pooled DHO."
This reverts commit 67fcfd9d
2021-04-21 10:02:50 +09:00
67fcfd9dbc Fix wrong InitialLifetimeOffset is used for a non-pooled DHO.
HitObjectLifetimeEntry's InitialLifetimeOffset is different from DrawableHitObject's InitialLifetimeOffset.
2021-04-21 09:48:16 +09:00
e80c3c317a Rename UnmanagedHitObjectEntry -> SyntheticHitObjectEntry
"Unmanaged" was confusing because its lifetime is still managed by the HitObjectContainer.
2021-04-21 09:23:23 +09:00
c6ee4e900e Ensure a non-null hitobject entry has a non-null Result 2021-04-20 15:18:36 +09:00