mirror of https://github.com/zeldaret/botw.git
ksys/phys: Add RigidContactPoints allocation functions
This commit is contained in:
parent
8ba8563775
commit
32531ba067
|
|
@ -83728,11 +83728,11 @@ Address,Quality,Size,Name
|
|||
0x0000007100fb24e8,O,000316,_ZN4ksys4phys10ContactMgr20loadContactInfoTableEPN4sead4HeapEN3agl3utl19ResParameterArchiveENS0_16ContactLayerTypeE
|
||||
0x0000007100fb2624,O,000688,_ZN4ksys4phys10ContactMgr22doLoadContactInfoTableEN3agl3utl19ResParameterArchiveENS0_16ContactLayerTypeEb
|
||||
0x0000007100fb28d4,O,000136,_ZN4ksys4phys10ContactMgr18allocContactPointsEPN4sead4HeapEiRKNS2_14SafeStringBaseIcEEiii
|
||||
0x0000007100fb295c,U,000220,
|
||||
0x0000007100fb2a38,O,000100,_ZN4ksys4phys10ContactMgr21registerContactPointsEPNS0_18RigidContactPointsE
|
||||
0x0000007100fb295c,O,000220,_ZN4ksys4phys10ContactMgr20allocContactPointsExEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii
|
||||
0x0000007100fb2a38,O,000100,_ZN4ksys4phys10ContactMgr21registerContactPointsEPNS0_19IRigidContactPointsE
|
||||
0x0000007100fb2a9c,U,000056,
|
||||
0x0000007100fb2ad4,U,000156,
|
||||
0x0000007100fb2b70,O,000148,_ZN4ksys4phys10ContactMgr17freeContactPointsEPNS0_18RigidContactPointsE
|
||||
0x0000007100fb2b70,O,000148,_ZN4ksys4phys10ContactMgr17freeContactPointsEPNS0_19IRigidContactPointsE
|
||||
0x0000007100fb2c04,U,000144,
|
||||
0x0000007100fb2c94,U,000216,
|
||||
0x0000007100fb2d6c,U,000136,
|
||||
|
|
@ -84086,8 +84086,8 @@ Address,Quality,Size,Name
|
|||
0x0000007100fc75a8,U,000076,
|
||||
0x0000007100fc75f4,U,000020,
|
||||
0x0000007100fc7608,U,000052,
|
||||
0x0000007100fc763c,U,000064,
|
||||
0x0000007100fc767c,U,000024,
|
||||
0x0000007100fc763c,O,000064,_ZN4ksys4phys18RigidContactPoints4makeEPN4sead4HeapEiRKNS2_14SafeStringBaseIcEEiii
|
||||
0x0000007100fc767c,O,000024,_ZN4ksys4phys18RigidContactPoints4freeEPS1_
|
||||
0x0000007100fc7694,O,000076,_ZN4ksys4phys18RigidContactPointsC1ERKN4sead14SafeStringBaseIcEEiii
|
||||
0x0000007100fc76e0,O,000004,_ZN4ksys4phys18RigidContactPointsD1Ev
|
||||
0x0000007100fc76e4,O,000004,_ZN4ksys4phys18RigidContactPointsD0Ev
|
||||
|
|
@ -84300,9 +84300,9 @@ Address,Quality,Size,Name
|
|||
0x0000007100fcf854,U,000092,
|
||||
0x0000007100fcf8b0,U,000004,nullsub_4257
|
||||
0x0000007100fcf8b4,U,000008,
|
||||
0x0000007100fcf8bc,U,000072,
|
||||
0x0000007100fcf8bc,O,000072,_ZN4ksys4phys20RigidContactPointsEx4makeEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii
|
||||
0x0000007100fcf904,O,000348,_ZN4ksys4phys20RigidContactPointsEx17registerLayerPairENS0_12ContactLayerES2_b
|
||||
0x0000007100fcfa60,U,000024,
|
||||
0x0000007100fcfa60,O,000024,_ZN4ksys4phys20RigidContactPointsEx4freeEPS1_
|
||||
0x0000007100fcfa78,O,000096,_ZN4ksys4phys20RigidContactPointsExC1ERKN4sead14SafeStringBaseIcEEiii
|
||||
0x0000007100fcfad8,O,000004,_ZN4ksys4phys20RigidContactPointsExD1Ev
|
||||
0x0000007100fcfadc,O,000004,_ZN4ksys4phys20RigidContactPointsExD0Ev
|
||||
|
|
@ -93427,7 +93427,7 @@ Address,Quality,Size,Name
|
|||
0x00000071012168c8,U,000052,
|
||||
0x00000071012168fc,O,000008,_ZNK4ksys4phys9MemSystem18allocContactPointsEPN4sead4HeapEiRKNS2_14SafeStringBaseIcEEiii
|
||||
0x0000007101216904,O,000008,_ZNK4ksys4phys9MemSystem17freeContactPointsEPNS0_18RigidContactPointsE
|
||||
0x000000710121690c,U,000008,
|
||||
0x000000710121690c,O,000008,_ZNK4ksys4phys9MemSystem20allocContactPointsExEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii
|
||||
0x0000007101216914,U,000080,
|
||||
0x0000007101216964,O,000008,_ZNK4ksys4phys9MemSystem21registerContactPointsEPNS0_18RigidContactPointsE
|
||||
0x000000710121696c,U,000008,
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "KingSystem/Physics/System/physGroupFilter.h"
|
||||
#include "KingSystem/Physics/System/physMemSystem.h"
|
||||
#include "KingSystem/Physics/System/physRigidContactPoints.h"
|
||||
#include "KingSystem/Physics/System/physRigidContactPointsEx.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
|
|
@ -72,13 +73,22 @@ RigidContactPoints* ContactMgr::allocContactPoints(sead::Heap* heap, int num,
|
|||
return points;
|
||||
}
|
||||
|
||||
void ContactMgr::registerContactPoints(RigidContactPoints* points) {
|
||||
RigidContactPointsEx* ContactMgr::allocContactPointsEx(sead::Heap* heap, int num, int num2,
|
||||
const sead::SafeString& name, int a, int b,
|
||||
int c) {
|
||||
auto* points = new (heap) RigidContactPointsEx(name, a, b, c);
|
||||
points->allocPoints(heap, num, num2);
|
||||
registerContactPoints(points);
|
||||
return points;
|
||||
}
|
||||
|
||||
void ContactMgr::registerContactPoints(IRigidContactPoints* points) {
|
||||
auto lock = sead::makeScopedLock(mMutex1);
|
||||
if (!points->isLinked())
|
||||
mRigidContactPoints.pushBack(points);
|
||||
}
|
||||
|
||||
void ContactMgr::freeContactPoints(RigidContactPoints* points) {
|
||||
void ContactMgr::freeContactPoints(IRigidContactPoints* points) {
|
||||
if (!points)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ class Heap;
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
class IRigidContactPoints;
|
||||
class RigidContactPoints;
|
||||
class RigidContactPointsEx;
|
||||
|
||||
struct ContactInfoTable {
|
||||
struct Receiver : agl::utl::ParameterObj {
|
||||
|
|
@ -54,8 +56,10 @@ public:
|
|||
|
||||
RigidContactPoints* allocContactPoints(sead::Heap* heap, int num, const sead::SafeString& name,
|
||||
int a, int b, int c);
|
||||
void registerContactPoints(RigidContactPoints* points);
|
||||
void freeContactPoints(RigidContactPoints* points);
|
||||
RigidContactPointsEx* allocContactPointsEx(sead::Heap* heap, int num, int num2,
|
||||
const sead::SafeString& name, int a, int b, int c);
|
||||
void registerContactPoints(IRigidContactPoints* points);
|
||||
void freeContactPoints(IRigidContactPoints* points);
|
||||
|
||||
private:
|
||||
void doLoadContactInfoTable(agl::utl::ResParameterArchive archive, ContactLayerType type,
|
||||
|
|
@ -66,7 +70,7 @@ private:
|
|||
sead::OffsetList<void*> mList0;
|
||||
int mList0Size = 0;
|
||||
sead::Atomic<int> _34 = 0;
|
||||
sead::OffsetList<RigidContactPoints> mRigidContactPoints;
|
||||
sead::OffsetList<IRigidContactPoints> mRigidContactPoints;
|
||||
sead::OffsetList<void*> mList2;
|
||||
sead::OffsetList<void*> mList3;
|
||||
sead::OffsetList<void*> mList4;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "KingSystem/Physics/System/physMemSystem.h"
|
||||
#include "KingSystem/Physics/System/physContactMgr.h"
|
||||
#include "KingSystem/Physics/System/physRigidContactPoints.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
|
|
@ -15,6 +16,12 @@ void MemSystem::freeContactPoints(RigidContactPoints* points) const {
|
|||
mContactMgr->freeContactPoints(points);
|
||||
}
|
||||
|
||||
RigidContactPointsEx* MemSystem::allocContactPointsEx(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);
|
||||
}
|
||||
|
||||
void MemSystem::registerContactPoints(RigidContactPoints* points) const {
|
||||
mContactMgr->registerContactPoints(points);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ public:
|
|||
RigidContactPoints* allocContactPoints(sead::Heap* heap, int num, const sead::SafeString& name,
|
||||
int a, int b, int c) const;
|
||||
void freeContactPoints(RigidContactPoints* points) const;
|
||||
RigidContactPointsEx* allocContactPointsEx(sead::Heap* heap, int num, int num2,
|
||||
const sead::SafeString& name, int a, int b,
|
||||
int c) const;
|
||||
void freeContactPointsEx(RigidContactPointsEx* points) const;
|
||||
void registerContactPoints(RigidContactPoints* points) const;
|
||||
void registerContactPointLayerPair(RigidContactPointsEx* points, ContactLayer layer1,
|
||||
ContactLayer layer2, bool enabled);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,17 @@
|
|||
#include "KingSystem/Physics/System/physRigidContactPoints.h"
|
||||
#include "KingSystem/Physics/System/physMemSystem.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
RigidContactPoints* RigidContactPoints::make(sead::Heap* heap, int num,
|
||||
const sead::SafeString& name, int a, int b, int c) {
|
||||
return MemSystem::instance()->allocContactPoints(heap, num, name, a, b, c);
|
||||
}
|
||||
|
||||
void RigidContactPoints::free(RigidContactPoints* instance) {
|
||||
MemSystem::instance()->freeContactPoints(instance);
|
||||
}
|
||||
|
||||
RigidContactPoints::RigidContactPoints(const sead::SafeString& name, int a, int b, int c)
|
||||
: IRigidContactPoints(name, a, b, c) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ public:
|
|||
IRigidContactPoints(const sead::SafeString& name, int a, int b, int c)
|
||||
: sead::INamable(name), _2c(a), _30(b), _34(c) {}
|
||||
virtual ~IRigidContactPoints() = default;
|
||||
virtual void freePoints() = 0;
|
||||
|
||||
bool isLinked() const { return mListNode.isLinked(); }
|
||||
static constexpr size_t getListNodeOffset() { return offsetof(IRigidContactPoints, mListNode); }
|
||||
|
|
@ -41,7 +42,7 @@ public:
|
|||
|
||||
RigidContactPoints(const sead::SafeString& name, int a, int b, int c);
|
||||
~RigidContactPoints() override;
|
||||
virtual void freePoints();
|
||||
void freePoints() override;
|
||||
virtual void allocPoints(sead::Heap* heap, int num);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -3,6 +3,16 @@
|
|||
|
||||
namespace ksys::phys {
|
||||
|
||||
RigidContactPointsEx* RigidContactPointsEx::make(sead::Heap* heap, int num, int num2,
|
||||
const sead::SafeString& name, int a, int b,
|
||||
int c) {
|
||||
return MemSystem::instance()->allocContactPointsEx(heap, num, num2, name, a, b, c);
|
||||
}
|
||||
|
||||
void RigidContactPointsEx::free(RigidContactPointsEx* instance) {
|
||||
MemSystem::instance()->freeContactPointsEx(instance);
|
||||
}
|
||||
|
||||
bool RigidContactPointsEx::registerLayerPair(ContactLayer layer1, ContactLayer layer2,
|
||||
bool enabled) {
|
||||
if (mLayerType == ContactLayerType::Invalid)
|
||||
|
|
|
|||
|
|
@ -100,12 +100,13 @@ public:
|
|||
const Point* const* mPointsStart = nullptr;
|
||||
};
|
||||
|
||||
static RigidContactPointsEx* make();
|
||||
static RigidContactPointsEx* make(sead::Heap* heap, int num, int num2,
|
||||
const sead::SafeString& name, int a, int b, int c);
|
||||
static void free(RigidContactPointsEx* instance);
|
||||
|
||||
RigidContactPointsEx(const sead::SafeString& name, int a, int b, int c);
|
||||
~RigidContactPointsEx() override;
|
||||
virtual void freePoints();
|
||||
void freePoints() override;
|
||||
virtual void allocPoints(sead::Heap* heap, int num, int num2);
|
||||
|
||||
bool registerLayerPair(ContactLayer layer1, ContactLayer layer2, bool enabled);
|
||||
|
|
|
|||
Loading…
Reference in New Issue