ksys/phys: Rename MemSystem to System

It was called MemSystem in the IDB because of a string in
ksys::InitializeApp that referred to MemSystem initialisation as
"Physics Memory System"; however that string actually referred to an
initialisation step for the physics system, not to the name of the
subsystem itself.
This commit is contained in:
Léo Lam 2022-01-21 12:39:01 +01:00
parent 98c69ebaef
commit c292675646
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
11 changed files with 50 additions and 50 deletions

View File

@ -93408,7 +93408,7 @@ Address,Quality,Size,Name
0x0000007101214b04,U,000016,PhysicsMemSys::waitForResourceCreation
0x0000007101214b14,U,000136,PhysicsMemSys::x_0
0x0000007101214b9c,U,000564,PhysicsMemSys::initHeaps
0x0000007101214dd0,O,001416,_ZN4ksys4phys9MemSystem14initSystemDataEPN4sead4HeapE
0x0000007101214dd0,O,001416,_ZN4ksys4phys6System14initSystemDataEPN4sead4HeapE
0x0000007101215358,U,000092,
0x00000071012153b4,U,000120,
0x000000710121542c,U,000276,
@ -93443,11 +93443,11 @@ Address,Quality,Size,Name
0x000000710121686c,U,000040,PhysicsMemSys::addGroupFilterX
0x0000007101216894,U,000052,
0x00000071012168c8,U,000052,
0x00000071012168fc,O,000008,_ZNK4ksys4phys9MemSystem18allocContactPointsEPN4sead4HeapEiRKNS2_14SafeStringBaseIcEEiii
0x0000007101216904,O,000008,_ZNK4ksys4phys9MemSystem17freeContactPointsEPNS0_18RigidContactPointsE
0x000000710121690c,O,000008,_ZNK4ksys4phys9MemSystem20allocContactPointsExEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii
0x00000071012168fc,O,000008,_ZNK4ksys4phys6System18allocContactPointsEPN4sead4HeapEiRKNS2_14SafeStringBaseIcEEiii
0x0000007101216904,O,000008,_ZNK4ksys4phys6System17freeContactPointsEPNS0_18RigidContactPointsE
0x000000710121690c,O,000008,_ZNK4ksys4phys6System20allocContactPointsExEPN4sead4HeapEiiRKNS2_14SafeStringBaseIcEEiii
0x0000007101216914,U,000080,PhysicsMemSys::freeContactPoints2
0x0000007101216964,O,000008,_ZNK4ksys4phys9MemSystem21registerContactPointsEPNS0_18RigidContactPointsE
0x0000007101216964,O,000008,_ZNK4ksys4phys6System21registerContactPointsEPNS0_18RigidContactPointsE
0x000000710121696c,U,000008,PhysicsMemSys::x_3
0x0000007101216974,U,000048,PhysicsMemSys::x_2
0x00000071012169a4,U,000008,PhysicsMemSys::allocCollisionStuff

Can't render this file because it is too large.

View File

@ -84,8 +84,6 @@ target_sources(uking PRIVATE
System/physMaterialMask.h
System/physMaterialTable.cpp
System/physMaterialTable.h
System/physMemSystem.cpp
System/physMemSystem.h
System/physParamSet.cpp
System/physParamSet.h
System/physRigidContactPoints.cpp
@ -96,6 +94,8 @@ target_sources(uking PRIVATE
System/physSensorGroupFilter.h
System/physShapeParam.cpp
System/physShapeParam.h
System/physSystem.cpp
System/physSystem.h
System/physSystemData.cpp
System/physSystemData.h
System/physUserTag.cpp

View File

@ -13,7 +13,7 @@
#include "KingSystem/Physics/RigidBody/physRigidBodyMotionSensor.h"
#include "KingSystem/Physics/RigidBody/physRigidBodyParam.h"
#include "KingSystem/Physics/RigidBody/physRigidBodyRequestMgr.h"
#include "KingSystem/Physics/System/physMemSystem.h"
#include "KingSystem/Physics/System/physSystem.h"
#include "KingSystem/Physics/System/physUserTag.h"
#include "KingSystem/Physics/physConversions.h"
@ -185,7 +185,7 @@ void RigidBody::x_0() {
if (mMotionAccessor) {
const bool use_system_time_factor = hasFlag(Flag::UseSystemTimeFactor);
setTimeFactor(use_system_time_factor ? MemSystem::instance()->getTimeFactor() : 1.0f);
setTimeFactor(use_system_time_factor ? System::instance()->getTimeFactor() : 1.0f);
if (isSensor()) {
auto* accessor = sead::DynamicCast<RigidBodyMotionSensor>(mMotionAccessor);
@ -209,7 +209,7 @@ void RigidBody::setMotionFlag(MotionFlag flag) {
if (mFlags.isOff(Flag::_20) && mFlags.isOff(Flag::UpdateRequested)) {
mFlags.set(Flag::UpdateRequested);
MemSystem::instance()->getRigidBodyRequestMgr()->pushRigidBody(getLayerType(), this);
System::instance()->getRigidBodyRequestMgr()->pushRigidBody(getLayerType(), this);
}
}
@ -262,7 +262,7 @@ bool RigidBody::x_6() {
setMotionFlag(MotionFlag::_2);
result = false;
} else if (mFlags.isOn(Flag::UpdateRequested)) {
MemSystem::instance()->getRigidBodyRequestMgr()->pushRigidBody(getLayerType(), this);
System::instance()->getRigidBodyRequestMgr()->pushRigidBody(getLayerType(), this);
result = false;
}
@ -353,7 +353,7 @@ MotionType RigidBody::getMotionType() const {
void RigidBody::setContactPoints(RigidContactPoints* points) {
mContactPoints = points;
if (isFlag8Set() && mContactPoints && !mContactPoints->isLinked())
MemSystem::instance()->registerContactPoints(points);
System::instance()->registerContactPoints(points);
}
void RigidBody::freeze(bool should_freeze, bool preserve_velocities, bool preserve_max_impulse) {
@ -619,7 +619,7 @@ float RigidBody::getMaxAngularVelocity() const {
}
void RigidBody::applyLinearImpulse(const sead::Vector3f& impulse) {
if (MemSystem::instance()->isPaused())
if (System::instance()->isPaused())
return;
if (hasFlag(Flag::_400) || hasFlag(Flag::_40))
@ -635,7 +635,7 @@ void RigidBody::applyLinearImpulse(const sead::Vector3f& impulse) {
}
void RigidBody::applyAngularImpulse(const sead::Vector3f& impulse) {
if (MemSystem::instance()->isPaused())
if (System::instance()->isPaused())
return;
if (hasFlag(Flag::_400) || hasFlag(Flag::_40))
@ -651,7 +651,7 @@ void RigidBody::applyAngularImpulse(const sead::Vector3f& impulse) {
}
void RigidBody::applyPointImpulse(const sead::Vector3f& impulse, const sead::Vector3f& point) {
if (MemSystem::instance()->isPaused())
if (System::instance()->isPaused())
return;
if (hasFlag(Flag::_400) || hasFlag(Flag::_40))
@ -1083,7 +1083,7 @@ void RigidBody::lock() {
void RigidBody::lock(bool also_lock_world) {
if (also_lock_world)
MemSystem::instance()->lockWorld(getLayerType());
System::instance()->lockWorld(getLayerType());
lock();
}
@ -1094,7 +1094,7 @@ void RigidBody::unlock() {
void RigidBody::unlock(bool also_unlock_world) {
unlock();
if (also_unlock_world)
MemSystem::instance()->unlockWorld(getLayerType());
System::instance()->unlockWorld(getLayerType());
}
hkpMotion* RigidBody::getMotion() const {

View File

@ -2,9 +2,9 @@
#include <prim/seadScopedLock.h>
#include "KingSystem/Physics/System/physEntityGroupFilter.h"
#include "KingSystem/Physics/System/physGroupFilter.h"
#include "KingSystem/Physics/System/physMemSystem.h"
#include "KingSystem/Physics/System/physRigidContactPoints.h"
#include "KingSystem/Physics/System/physRigidContactPointsEx.h"
#include "KingSystem/Physics/System/physSystem.h"
namespace ksys::phys {
@ -53,7 +53,7 @@ void ContactMgr::doLoadContactInfoTable(agl::utl::ResParameterArchive archive,
const auto root = archive.getRootList();
const auto names = root.getResParameterObj(0);
const auto* filter = MemSystem::instance()->getGroupFilter(type);
const auto* filter = System::instance()->getGroupFilter(type);
const auto layer_base = static_cast<int>(getContactLayerBase(type));
for (int i = 0; i < table.receivers.size(); ++i) {

View File

@ -8,7 +8,7 @@
#include <Havok/Physics2012/Dynamics/World/hkpWorldObject.h>
#include <heap/seadHeap.h>
#include "KingSystem/Physics/System/physContactMgr.h"
#include "KingSystem/Physics/System/physMemSystem.h"
#include "KingSystem/Physics/System/physSystem.h"
#include "KingSystem/Utils/BitField.h"
#include "KingSystem/Utils/HeapUtil.h"
@ -59,7 +59,7 @@ void receiverMaskEnableLayer(ReceiverMask* mask, ContactLayer layer) {
bool receiverMaskGetSensorLayerMaskForType(ReceiverMask* mask,
const sead::SafeString& receiver_type) {
return MemSystem::instance()->getContactMgr()->getSensorLayerMask(mask, receiver_type);
return System::instance()->getContactMgr()->getSensorLayerMask(mask, receiver_type);
}
void receiverMaskSetSensorLayerMask(ReceiverMask* mask, u32 layer_mask) {

View File

@ -1,6 +1,6 @@
#include "KingSystem/Physics/System/physGroupFilter.h"
#include <prim/seadScopedLock.h>
#include "KingSystem/Physics/System/physMemSystem.h"
#include "KingSystem/Physics/System/physSystem.h"
namespace ksys::phys {
@ -55,7 +55,7 @@ u32 SystemGroupHandler::m7() {
}
void SystemGroupHandler::removeThis() {
MemSystem::instance()->removeSystemGroupHandler(this);
System::instance()->removeSystemGroupHandler(this);
}
} // namespace ksys::phys

View File

@ -1,6 +1,6 @@
#include "KingSystem/Physics/System/physMaterialMask.h"
#include "KingSystem/Physics/System/physMaterialTable.h"
#include "KingSystem/Physics/System/physMemSystem.h"
#include "KingSystem/Physics/System/physSystem.h"
namespace ksys::phys {
@ -57,15 +57,15 @@ const char* MaterialMask::getSubMaterialName() const {
}
int MaterialMask::getSubMaterialIdx(Material mat, const sead::SafeString& submat_name) {
return MemSystem::instance()->getMaterialTable()->getSubMaterialIdx(mat, submat_name);
return System::instance()->getMaterialTable()->getSubMaterialIdx(mat, submat_name);
}
const sead::SafeString& MaterialMask::getSubMaterialName(Material mat, int submat_idx) {
return MemSystem::instance()->getMaterialTable()->getSubMaterial(mat, submat_idx);
return System::instance()->getMaterialTable()->getSubMaterial(mat, submat_idx);
}
int MaterialMask::getNumSubMaterials(Material mat) {
return MemSystem::instance()->getMaterialTable()->getNumSubMaterials(mat);
return System::instance()->getMaterialTable()->getNumSubMaterials(mat);
}
const sead::SafeString& MaterialMask::getSubMaterialName(int mat, int submat_idx) {

View File

@ -1,15 +1,15 @@
#include "KingSystem/Physics/System/physRigidContactPoints.h"
#include "KingSystem/Physics/System/physMemSystem.h"
#include "KingSystem/Physics/System/physSystem.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);
return System::instance()->allocContactPoints(heap, num, name, a, b, c);
}
void RigidContactPoints::free(RigidContactPoints* instance) {
MemSystem::instance()->freeContactPoints(instance);
System::instance()->freeContactPoints(instance);
}
RigidContactPoints::RigidContactPoints(const sead::SafeString& name, int a, int b, int c)

View File

@ -1,17 +1,17 @@
#include "KingSystem/Physics/System/physRigidContactPointsEx.h"
#include "KingSystem/Physics/System/physContactMgr.h"
#include "KingSystem/Physics/System/physMemSystem.h"
#include "KingSystem/Physics/System/physSystem.h"
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);
return System::instance()->allocContactPointsEx(heap, num, num2, name, a, b, c);
}
void RigidContactPointsEx::free(RigidContactPointsEx* instance) {
MemSystem::instance()->freeContactPointsEx(instance);
System::instance()->freeContactPointsEx(instance);
}
bool RigidContactPointsEx::registerLayerPair(ContactLayer layer1, ContactLayer layer2,
@ -30,7 +30,7 @@ bool RigidContactPointsEx::registerLayerPair(ContactLayer layer1, ContactLayer l
entry->layer1 = layer1;
entry->layer2 = layer2;
entry->enabled = enabled;
[&] { MemSystem::instance()->registerContactPointLayerPair(this, layer1, layer2, enabled); }();
[&] { System::instance()->registerContactPointLayerPair(this, layer1, layer2, enabled); }();
return true;
}

View File

@ -1,4 +1,4 @@
#include "KingSystem/Physics/System/physMemSystem.h"
#include "KingSystem/Physics/System/physSystem.h"
#include "KingSystem/Physics/Cloth/physClothResource.h"
#include "KingSystem/Physics/Ragdoll/physRagdollControllerKeyList.h"
#include "KingSystem/Physics/Ragdoll/physRagdollResource.h"
@ -17,9 +17,9 @@
namespace ksys::phys {
SEAD_SINGLETON_DISPOSER_IMPL(MemSystem)
SEAD_SINGLETON_DISPOSER_IMPL(System)
void MemSystem::initSystemData(sead::Heap* heap) {
void System::initSystemData(sead::Heap* heap) {
res::registerEntryFactory(new (heap) res::EntryFactory<RigidBodyResource>(1.0, 0x400), "hkrb");
res::registerEntryFactory(new (heap) res::EntryFactory<RagdollResource>(1.0, 0x400), "hkrg");
res::registerEntryFactory(new (heap) res::EntryFactory<SupportBoneResource>(1.0, 0x100000),
@ -48,23 +48,23 @@ void MemSystem::initSystemData(sead::Heap* heap) {
mContactMgr);
}
RigidContactPoints* MemSystem::allocContactPoints(sead::Heap* heap, int num,
const sead::SafeString& name, int a, int b,
int c) const {
RigidContactPoints* System::allocContactPoints(sead::Heap* heap, int num,
const sead::SafeString& name, int a, int b,
int c) const {
return mContactMgr->allocContactPoints(heap, num, name, a, b, c);
}
void MemSystem::freeContactPoints(RigidContactPoints* points) const {
void System::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 {
RigidContactPointsEx* System::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 {
void System::registerContactPoints(RigidContactPoints* points) const {
mContactMgr->registerContactPoints(points);
}

View File

@ -24,10 +24,10 @@ enum class IsIndoorStage {
Yes,
};
class MemSystem {
SEAD_SINGLETON_DISPOSER(MemSystem)
MemSystem();
virtual ~MemSystem();
class System {
SEAD_SINGLETON_DISPOSER(System)
System();
virtual ~System();
public:
float getTimeFactor() const { return mTimeFactor; }
@ -90,6 +90,6 @@ private:
sead::Heap* mPhysicsTempLowHeap{};
u8 _1c8[0x480 - 0x1c8];
};
KSYS_CHECK_SIZE_NX150(MemSystem, 0x480);
KSYS_CHECK_SIZE_NX150(System, 0x480);
} // namespace ksys::phys