Match phys::System contact listener flags and rigid body teardown - #188
Match phys::System contact listener flags and rigid body teardown#188RobbyV2 wants to merge 2 commits into
Conversation
Pistonight
left a comment
There was a problem hiding this comment.
@Pistonight made 3 comments.
Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on RobbyV2).
src/KingSystem/Physics/System/physContactListener.h line 45 at r1 (raw file):
void unregisterCollisionWithBody(RigidBody* body); bool get90() const { return _90; }
do we have better names for these?
src/KingSystem/Physics/System/physSystem.h line 147 at r1 (raw file):
u8 _28[0x60 - 0x28]; bool mPaused; u8 _61;
based on usage these are probably bools as well
src/KingSystem/Physics/System/physSystem.cpp line 192 at r1 (raw file):
bool System::isActorSystemIdle() const { const bool flag = _62 || _61;
does inlining flag work and do we have better names for _61 and _62?
(It's a bit weird if the programmer made a separate variable, they don't write if (flag) return true; immediately after)
Maybe return _62 || _61 || !mgr || mgr->getStatus() != act::BaseProcMgr::Status::ProcessingActorJobs is one line
Renamed
Changed to bools.
Inlining it changed the branch structure and function size. The exact form computes |
isActorSystemIdle reads two separate flags out of the _61 padding, so I split it into _61, _62 and _63 and left them u8; 0x7101216cb4 loads _61 with ldrb / cmp #0 / cset ne, and clang emits no cset for a bool. Writing the getStatus comparison into the return there short-circuits into an early ret and comes out four bytes short of the target's branchless orr, so I kept it in a local.
I named 0x71012167ec setDisableSensorContactPointInfoNotifications after the field it writes on the Sensor listener.
This change is