Skip to content

Match phys::System contact listener and group handler forwarders - #184

Merged
Pistonight merged 1 commit into
zeldaret:masterfrom
RobbyV2:phys-system-contact-listeners
Jul 31, 2026
Merged

Match phys::System contact listener and group handler forwarders#184
Pistonight merged 1 commit into
zeldaret:masterfrom
RobbyV2:phys-system-contact-listeners

Conversation

@RobbyV2

@RobbyV2 RobbyV2 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The FIXME'd _128 is indexed by ContactLayerType and its elements take ContactListener calls, so it is sead::FixedPtrArray<ContactListener, 2>, named mContactListeners; the bounds check in the assembly is sead::PtrArrayImpl::at.

freeLayerContactPointInfo drops the info's layer pairs from the listener for its layer type, then frees the info through ContactMgr. registerContactPointLayerPair adds one pair to that same listener. trackLayerPair selects the listener from the first layer's ContactLayerType and returns the ContactLayerCollisionInfo it tracks.

removeSystemGroupHandler indexes mGroupFilters by the handler's layer type and forwards to GroupFilter::removeSystemGroupHandler.

I added getLayerType to LayerContactPointInfo since mLayerType is private.


This change is Reviewable

@RobbyV2
RobbyV2 force-pushed the phys-system-contact-listeners branch from 6579af9 to 0f6859e Compare July 29, 2026 21:56
@RobbyV2 RobbyV2 changed the title Match phys::System contact listener and group filter accessors Match phys::System contact listener and group handler forwarders Jul 29, 2026

@Pistonight Pistonight left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pistonight reviewed all commit messages and made 1 comment.
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on RobbyV2).


src/KingSystem/Physics/System/physSystem.cpp line 53 at r1 (raw file):

void System::removeSystemGroupHandler(SystemGroupHandler* handler) {
    mGroupFilters[int(handler->getLayerType())]->removeSystemGroupHandler(handler);

nit: prefer cpp cast static_cast<s32>(...) ( and other places )

@RobbyV2
RobbyV2 force-pushed the phys-system-contact-listeners branch from 0f6859e to 1e080b3 Compare July 30, 2026 13:10
@RobbyV2

RobbyV2 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Done

@RobbyV2
RobbyV2 requested a review from Pistonight July 30, 2026 13:32
@Pistonight

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

@Pistonight
Pistonight merged commit 4f1f92f into zeldaret:master Jul 31, 2026
3 of 4 checks passed
@RobbyV2
RobbyV2 deleted the phys-system-contact-listeners branch July 31, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants