diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 500b185a..8dddb375 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -84320,18 +84320,18 @@ Address,Quality,Size,Name 0x0000007100fcf854,O,000092,_ZNK4ksys4phys15ContactListener18getRuntimeTypeInfoEv 0x0000007100fcf8b0,O,000004,_ZN4ksys4phys15ContactListener3m11Ev 0x0000007100fcf8b4,O,000008,_ZN4ksys4phys15ContactListener3m15Ev -0x0000007100fcf8bc,O,000072,_ZN4ksys4phys18ContactPointInfoEx4makeEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii -0x0000007100fcf904,O,000348,_ZN4ksys4phys18ContactPointInfoEx17registerLayerPairENS0_12ContactLayerES2_b -0x0000007100fcfa60,O,000024,_ZN4ksys4phys18ContactPointInfoEx4freeEPS1_ -0x0000007100fcfa78,O,000096,_ZN4ksys4phys18ContactPointInfoExC1ERKN4sead14SafeStringBaseIcEEiii -0x0000007100fcfad8,O,000004,_ZN4ksys4phys18ContactPointInfoExD1Ev -0x0000007100fcfadc,O,000004,_ZN4ksys4phys18ContactPointInfoExD0Ev -0x0000007100fcfae0,O,000300,_ZN4ksys4phys18ContactPointInfoEx11allocPointsEPN4sead4HeapEii -0x0000007100fcfc0c,O,000168,_ZN4ksys4phys18ContactPointInfoEx10freePointsEv -0x0000007100fcfcb4,O,000260,_ZNK4ksys4phys18ContactPointInfoEx8Iterator7getDataEPN4sead7Vector3IfEENS2_4ModeE -0x0000007100fcfdb8,O,000048,_ZNK4ksys4phys18ContactPointInfoEx8Iterator7getDataENS2_4ModeE -0x0000007100fcfde8,O,000068,_ZN4ksys4phys18ContactPointInfoEx8IteratorC1ERKN4sead6BufferIPNS0_12ContactPointEEEi -0x0000007100fcfe2c,O,000028,_ZN4ksys4phys18ContactPointInfoEx11IteratorEndC1ERKN4sead6BufferIPNS0_12ContactPointEEEi +0x0000007100fcf8bc,O,000072,_ZN4ksys4phys21LayerContactPointInfo4makeEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii +0x0000007100fcf904,O,000348,_ZN4ksys4phys21LayerContactPointInfo17registerLayerPairENS0_12ContactLayerES2_b +0x0000007100fcfa60,O,000024,_ZN4ksys4phys21LayerContactPointInfo4freeEPS1_ +0x0000007100fcfa78,O,000096,_ZN4ksys4phys21LayerContactPointInfoC1ERKN4sead14SafeStringBaseIcEEiii +0x0000007100fcfad8,O,000004,_ZN4ksys4phys21LayerContactPointInfoD1Ev +0x0000007100fcfadc,O,000004,_ZN4ksys4phys21LayerContactPointInfoD0Ev +0x0000007100fcfae0,O,000300,_ZN4ksys4phys21LayerContactPointInfo11allocPointsEPN4sead4HeapEii +0x0000007100fcfc0c,O,000168,_ZN4ksys4phys21LayerContactPointInfo10freePointsEv +0x0000007100fcfcb4,O,000260,_ZNK4ksys4phys21LayerContactPointInfo8Iterator7getDataEPN4sead7Vector3IfEENS2_4ModeE +0x0000007100fcfdb8,O,000048,_ZNK4ksys4phys21LayerContactPointInfo8Iterator7getDataENS2_4ModeE +0x0000007100fcfde8,O,000068,_ZN4ksys4phys21LayerContactPointInfo8IteratorC1ERKN4sead6BufferIPNS0_12ContactPointEEEi +0x0000007100fcfe2c,O,000028,_ZN4ksys4phys21LayerContactPointInfo11IteratorEndC1ERKN4sead6BufferIPNS0_12ContactPointEEEi 0x0000007100fcfe48,U,000112, 0x0000007100fcfeb8,U,000072, 0x0000007100fcff00,U,000692, @@ -93448,8 +93448,8 @@ Address,Quality,Size,Name 0x00000071012168c8,U,000052, 0x00000071012168fc,O,000008,_ZNK4ksys4phys6System21allocContactPointInfoEPN4sead4HeapEiRKNS2_14SafeStringBaseIcEEiii 0x0000007101216904,O,000008,_ZNK4ksys4phys6System20freeContactPointInfoEPNS0_16ContactPointInfoE -0x000000710121690c,O,000008,_ZNK4ksys4phys6System20allocContactPointsExEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii -0x0000007101216914,U,000080,PhysicsMemSys::freeContactPoints2 +0x000000710121690c,O,000008,_ZNK4ksys4phys6System26allocLayerContactPointInfoEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii +0x0000007101216914,U,000080,ksys::phys::System::freeLayerContactPointInfo 0x0000007101216964,O,000008,_ZNK4ksys4phys6System24registerContactPointInfoEPNS0_16ContactPointInfoE 0x000000710121696c,U,000008,PhysicsMemSys::x_3 0x0000007101216974,U,000048,PhysicsMemSys::x_2 diff --git a/src/KingSystem/Physics/CMakeLists.txt b/src/KingSystem/Physics/CMakeLists.txt index fcf5219d..08625137 100644 --- a/src/KingSystem/Physics/CMakeLists.txt +++ b/src/KingSystem/Physics/CMakeLists.txt @@ -113,8 +113,8 @@ target_sources(uking PRIVATE System/physContactMgr.h System/physContactPointInfo.cpp System/physContactPointInfo.h - System/physContactPointInfoEx.cpp - System/physContactPointInfoEx.h + System/physLayerContactPointInfo.cpp + System/physLayerContactPointInfo.h System/physEntityGroupFilter.cpp System/physEntityGroupFilter.h System/physGroupFilter.cpp diff --git a/src/KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.cpp b/src/KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.cpp index fb45b399..77ddadbf 100644 --- a/src/KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.cpp +++ b/src/KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.cpp @@ -27,7 +27,7 @@ RigidBodyRequestMgr::~RigidBodyRequestMgr() { mMotionAccessors.freeBuffer(); if (mContactPoints) { - ksys::phys::ContactPointInfoEx::free(mContactPoints); + ksys::phys::LayerContactPointInfo::free(mContactPoints); mContactPoints = nullptr; } } @@ -62,7 +62,7 @@ void RigidBodyRequestMgr::init(sead::Heap* heap) { mNumEntitiesInWorld = 0; mContactPoints = - ContactPointInfoEx::make(heap, 0x1000, 11, "RigidBodyRequestMgr::Water", 0, 0, 0); + LayerContactPointInfo::make(heap, 0x1000, 11, "RigidBodyRequestMgr::Water", 0, 0, 0); mContactPoints->setCallback(&mCallback); mContactPoints->set30(1); diff --git a/src/KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.h b/src/KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.h index fd4d5e09..dda84700 100644 --- a/src/KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.h +++ b/src/KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.h @@ -9,7 +9,7 @@ #include #include #include -#include "KingSystem/Physics/System/physContactPointInfoEx.h" +#include "KingSystem/Physics/System/physLayerContactPointInfo.h" #include "KingSystem/Physics/physDefines.h" #include "KingSystem/Utils/Container/LockFreeQueue.h" #include "KingSystem/Utils/Types.h" @@ -84,7 +84,7 @@ private: }; KSYS_CHECK_SIZE_NX150(Unk6, 0x48); - struct PointCallback : ContactPointInfoEx::Callback { + struct PointCallback : LayerContactPointInfo::Callback { explicit PointCallback(RigidBodyRequestMgr* mgr_) : mgr(mgr_) {} void invoke(void* arg) override { mgr->someFunction2(arg); } @@ -112,7 +112,7 @@ private: sead::Atomic _130; sead::Buffer _138; u32 mNumEntitiesInWorld{}; - ContactPointInfoEx* mContactPoints{}; + LayerContactPointInfo* mContactPoints{}; sead::SafeArray mCriticalSections; sead::CriticalSection mCS; float _218 = 1.0; diff --git a/src/KingSystem/Physics/System/physContactMgr.cpp b/src/KingSystem/Physics/System/physContactMgr.cpp index 43735edd..02b76086 100644 --- a/src/KingSystem/Physics/System/physContactMgr.cpp +++ b/src/KingSystem/Physics/System/physContactMgr.cpp @@ -1,9 +1,9 @@ #include "KingSystem/Physics/System/physContactMgr.h" #include #include "KingSystem/Physics/System/physContactPointInfo.h" -#include "KingSystem/Physics/System/physContactPointInfoEx.h" #include "KingSystem/Physics/System/physEntityGroupFilter.h" #include "KingSystem/Physics/System/physGroupFilter.h" +#include "KingSystem/Physics/System/physLayerContactPointInfo.h" #include "KingSystem/Physics/System/physSystem.h" namespace ksys::phys { @@ -84,10 +84,10 @@ ContactPointInfo* ContactMgr::allocContactPoints(sead::Heap* heap, int num, return points; } -ContactPointInfoEx* ContactMgr::allocContactPointsEx(sead::Heap* heap, int num, int num2, - const sead::SafeString& name, int a, int b, - int c) { - auto* points = new (heap) ContactPointInfoEx(name, a, b, c); +LayerContactPointInfo* ContactMgr::allocContactPointsEx(sead::Heap* heap, int num, int num2, + const sead::SafeString& name, int a, int b, + int c) { + auto* points = new (heap) LayerContactPointInfo(name, a, b, c); points->allocPoints(heap, num, num2); registerContactPointInfo(points); return points; diff --git a/src/KingSystem/Physics/System/physContactMgr.h b/src/KingSystem/Physics/System/physContactMgr.h index 04b107dd..02e0c88c 100644 --- a/src/KingSystem/Physics/System/physContactMgr.h +++ b/src/KingSystem/Physics/System/physContactMgr.h @@ -27,7 +27,7 @@ enum class IsIndoorStage; class ContactPointInfoBase; class RigidBody; class ContactPointInfo; -class ContactPointInfoEx; +class LayerContactPointInfo; struct ContactInfoTable { struct Receiver : agl::utl::ParameterObj { @@ -83,8 +83,8 @@ public: ContactPointInfo* allocContactPoints(sead::Heap* heap, int num, const sead::SafeString& name, int a, int b, int c); - ContactPointInfoEx* allocContactPointsEx(sead::Heap* heap, int num, int num2, - const sead::SafeString& name, int a, int b, int c); + LayerContactPointInfo* allocContactPointsEx(sead::Heap* heap, int num, int num2, + const sead::SafeString& name, int a, int b, int c); void registerContactPointInfo(ContactPointInfoBase* info); void freeContactPointInfo(ContactPointInfoBase* info); diff --git a/src/KingSystem/Physics/System/physContactPointInfoEx.cpp b/src/KingSystem/Physics/System/physLayerContactPointInfo.cpp similarity index 57% rename from src/KingSystem/Physics/System/physContactPointInfoEx.cpp rename to src/KingSystem/Physics/System/physLayerContactPointInfo.cpp index 2f1851b4..881b4d08 100644 --- a/src/KingSystem/Physics/System/physContactPointInfoEx.cpp +++ b/src/KingSystem/Physics/System/physLayerContactPointInfo.cpp @@ -1,19 +1,21 @@ -#include "KingSystem/Physics/System/physContactPointInfoEx.h" +#include "KingSystem/Physics/System/physLayerContactPointInfo.h" #include "KingSystem/Physics/System/physContactMgr.h" #include "KingSystem/Physics/System/physSystem.h" namespace ksys::phys { -ContactPointInfoEx* ContactPointInfoEx::make(sead::Heap* heap, int num, int num2, - const sead::SafeString& name, int a, int b, int c) { - return System::instance()->allocContactPointsEx(heap, num, num2, name, a, b, c); +LayerContactPointInfo* LayerContactPointInfo::make(sead::Heap* heap, int num, int num2, + const sead::SafeString& name, int a, int b, + int c) { + return System::instance()->allocLayerContactPointInfo(heap, num, num2, name, a, b, c); } -void ContactPointInfoEx::free(ContactPointInfoEx* instance) { - System::instance()->freeContactPointInfoEx(instance); +void LayerContactPointInfo::free(LayerContactPointInfo* instance) { + System::instance()->freeLayerContactPointInfo(instance); } -bool ContactPointInfoEx::registerLayerPair(ContactLayer layer1, ContactLayer layer2, bool enabled) { +bool LayerContactPointInfo::registerLayerPair(ContactLayer layer1, ContactLayer layer2, + bool enabled) { if (mLayerType == ContactLayerType::Invalid) mLayerType = getContactLayerType(layer1); @@ -32,7 +34,7 @@ bool ContactPointInfoEx::registerLayerPair(ContactLayer layer1, ContactLayer lay return true; } -bool ContactPointInfoEx::isPairUnknown(ContactLayer layer1, ContactLayer layer2) const { +bool LayerContactPointInfo::isPairUnknown(ContactLayer layer1, ContactLayer layer2) const { for (int i = 0; i < mLayerEntries.size(); ++i) { const auto* entry = mLayerEntries[i]; if (int(layer1) == entry->layer1 && int(layer2) == entry->layer2) @@ -43,23 +45,23 @@ bool ContactPointInfoEx::isPairUnknown(ContactLayer layer1, ContactLayer layer2) return true; } -ContactPointInfoEx::ContactPointInfoEx(const sead::SafeString& name, int a, int b, int c) +LayerContactPointInfo::LayerContactPointInfo(const sead::SafeString& name, int a, int b, int c) : ContactPointInfoBase(name, a, b, c) {} -ContactPointInfoEx::~ContactPointInfoEx() = default; +LayerContactPointInfo::~LayerContactPointInfo() = default; -void ContactPointInfoEx::allocPoints(sead::Heap* heap, int num, int num2) { +void LayerContactPointInfo::allocPoints(sead::Heap* heap, int num, int num2) { mPoints.allocBufferAssert(num, heap); mLayerEntries.allocBuffer(num2, heap); } -void ContactPointInfoEx::freePoints() { +void LayerContactPointInfo::freePoints() { mPoints.freeBuffer(); mLayerEntries.freeBuffer(); } -void ContactPointInfoEx::Iterator::getData(sead::Vector3f* out, - ContactPointInfoEx::Iterator::Mode mode) const { +void LayerContactPointInfo::Iterator::getData(sead::Vector3f* out, + LayerContactPointInfo::Iterator::Mode mode) const { const float scale = getPoint()->scale; out->e = getPoint()->_10.e; @@ -87,13 +89,13 @@ void ContactPointInfoEx::Iterator::getData(sead::Vector3f* out, } sead::Vector3f -ContactPointInfoEx::Iterator::getData(ContactPointInfoEx::Iterator::Mode mode) const { +LayerContactPointInfo::Iterator::getData(LayerContactPointInfo::Iterator::Mode mode) const { sead::Vector3f out; getData(&out, mode); return out; } -ContactPointInfoEx::Iterator::Iterator(const ContactPointInfoEx::Points& points, int count) +LayerContactPointInfo::Iterator::Iterator(const LayerContactPointInfo::Points& points, int count) : mPoints(points.getBufferPtr()), mPointsNum(count), mPointsStart(points.getBufferPtr()) { for (int i = 0; i != count; ++i) { if (!mPoints[i]->flags.isOn(ContactPoint::Flag::_1)) @@ -102,7 +104,8 @@ ContactPointInfoEx::Iterator::Iterator(const ContactPointInfoEx::Points& points, } } -ContactPointInfoEx::IteratorEnd::IteratorEnd(const ContactPointInfoEx::Points& points, int count) +LayerContactPointInfo::IteratorEnd::IteratorEnd(const LayerContactPointInfo::Points& points, + int count) : mIdx(count), mPoints(points.getBufferPtr()), mPointsNum(count), mPointsStart(points.getBufferPtr()) {} diff --git a/src/KingSystem/Physics/System/physContactPointInfoEx.h b/src/KingSystem/Physics/System/physLayerContactPointInfo.h similarity index 87% rename from src/KingSystem/Physics/System/physContactPointInfoEx.h rename to src/KingSystem/Physics/System/physLayerContactPointInfo.h index 42f2b4e5..953458f6 100644 --- a/src/KingSystem/Physics/System/physContactPointInfoEx.h +++ b/src/KingSystem/Physics/System/physLayerContactPointInfo.h @@ -12,7 +12,7 @@ namespace ksys::phys { struct ContactPoint; -class ContactPointInfoEx : public ContactPointInfoBase { +class LayerContactPointInfo : public ContactPointInfoBase { public: using Points = sead::Buffer; @@ -83,12 +83,12 @@ public: // FIXME: figure out the types using Callback = sead::IDelegate1; - static ContactPointInfoEx* make(sead::Heap* heap, int num, int num2, - const sead::SafeString& name, int a, int b, int c); - static void free(ContactPointInfoEx* instance); + static LayerContactPointInfo* make(sead::Heap* heap, int num, int num2, + const sead::SafeString& name, int a, int b, int c); + static void free(LayerContactPointInfo* instance); - ContactPointInfoEx(const sead::SafeString& name, int a, int b, int c); - ~ContactPointInfoEx() override; + LayerContactPointInfo(const sead::SafeString& name, int a, int b, int c); + ~LayerContactPointInfo() override; void freePoints() override; virtual void allocPoints(sead::Heap* heap, int num, int num2); @@ -112,6 +112,6 @@ private: ContactLayerType mLayerType = ContactLayerType::Invalid; Callback* mCallback = nullptr; }; -KSYS_CHECK_SIZE_NX150(ContactPointInfoEx, 0x88); +KSYS_CHECK_SIZE_NX150(LayerContactPointInfo, 0x88); } // namespace ksys::phys diff --git a/src/KingSystem/Physics/System/physSystem.cpp b/src/KingSystem/Physics/System/physSystem.cpp index 0ef11465..2efa20ae 100644 --- a/src/KingSystem/Physics/System/physSystem.cpp +++ b/src/KingSystem/Physics/System/physSystem.cpp @@ -57,9 +57,9 @@ void System::freeContactPointInfo(ContactPointInfo* info) const { mContactMgr->freeContactPointInfo(info); } -ContactPointInfoEx* System::allocContactPointsEx(sead::Heap* heap, int num, int num2, - const sead::SafeString& name, int a, int b, - int c) const { +LayerContactPointInfo* System::allocLayerContactPointInfo(sead::Heap* heap, int num, int num2, + const sead::SafeString& name, int a, int b, + int c) const { return mContactMgr->allocContactPointsEx(heap, num, num2, name, a, b, c); } diff --git a/src/KingSystem/Physics/System/physSystem.h b/src/KingSystem/Physics/System/physSystem.h index 12339455..9ad2a173 100644 --- a/src/KingSystem/Physics/System/physSystem.h +++ b/src/KingSystem/Physics/System/physSystem.h @@ -16,7 +16,7 @@ class MaterialTable; class RigidBody; class RigidBodyRequestMgr; class ContactPointInfo; -class ContactPointInfoEx; +class LayerContactPointInfo; class SystemData; class SystemGroupHandler; @@ -47,16 +47,16 @@ public: int a, int b, int c) const; void freeContactPointInfo(ContactPointInfo* info) const; - ContactPointInfoEx* allocContactPointsEx(sead::Heap* heap, int num, int num2, - const sead::SafeString& name, int a, int b, - int c) const; - void freeContactPointInfoEx(ContactPointInfoEx* info) const; + LayerContactPointInfo* allocLayerContactPointInfo(sead::Heap* heap, int num, int num2, + const sead::SafeString& name, int a, int b, + int c) const; + void freeLayerContactPointInfo(LayerContactPointInfo* info) const; void registerContactPointInfo(ContactPointInfo* info) const; // 0x000000710121696c void registerCollisionInfo(CollisionInfo* info) const; // 0x0000007101216974 - void registerContactPointLayerPair(ContactPointInfoEx* info, ContactLayer layer1, + void registerContactPointLayerPair(LayerContactPointInfo* info, ContactLayer layer1, ContactLayer layer2, bool enabled); // 0x00000071012169a4