ksys/phys: Finish SystemData and start implementing GroupFilter

This commit is contained in:
Léo Lam
2021-12-22 16:23:22 +01:00
parent 19f019b0ff
commit a816125247
10 changed files with 339 additions and 75 deletions
+12 -12
View File
@@ -17,22 +17,22 @@ class Handle;
namespace ksys::phys {
class ContactInfoTable;
class LayerTable;
class GroupFilter;
class MaterialTable;
class RagdollControllerKeyList;
constexpr int NumLayers = 32;
struct LayerTableInfo : agl::utl::IParameterObj {
sead::SafeArray<agl::utl::Parameter<int>, NumLayers> params;
void* table; // FIXME: type GroupFilter
int idx = 0; // FIXME: ContactLayer
int count;
struct LayerTable : agl::utl::IParameterObj {
sead::SafeArray<agl::utl::Parameter<int>, NumLayers> layer_values;
GroupFilter* filter;
ContactLayer layer;
int num_layers;
protected:
void postRead_() override;
};
KSYS_CHECK_SIZE_NX150(LayerTableInfo, 0x440);
KSYS_CHECK_SIZE_NX150(LayerTable, 0x440);
struct CharacterControllerTable : agl::utl::IParameterObj {
SEAD_ENUM(Type, Default)
@@ -63,27 +63,27 @@ public:
SystemData();
virtual ~SystemData();
void load(sead::Heap* heap, LayerTable* entity_layer_table, LayerTable* sensor_layer_table,
void load(sead::Heap* heap, GroupFilter* entity_group_filter, GroupFilter* sensor_group_filter,
MaterialTable* material_table, ContactInfoTable* contact_info_table);
private:
using LayerTableInfoContainer = Tables<LayerTableInfo, NumLayers>;
using LayerMatrix = Tables<LayerTable, NumLayers>;
void loadLayerTable(sead::Heap* heap, LayerTable* table, ContactLayerType type);
void loadLayerTable(sead::Heap* heap, GroupFilter* filter, ContactLayerType type);
void loadMaterialTable(sead::Heap* heap, MaterialTable* table);
void loadSubMaterialTable(sead::Heap* heap, MaterialTable* table);
void loadContactInfoTable(sead::Heap* heap, ContactInfoTable* table, ContactLayerType type);
void loadCharacterCtrlTable(sead::Heap* heap);
void loadRagdollCtrlKeyList(sead::Heap* heap);
agl::utl::ResParameterArchive loadLayerTableRes(const LayerTableInfoContainer& container,
agl::utl::ResParameterArchive loadLayerTableRes(const LayerMatrix& matrix,
ContactLayerType type);
agl::utl::ResParameterArchive loadMaterialTableRes();
agl::utl::ResParameterArchive loadSubMaterialTableRes();
agl::utl::ResParameterArchive loadContactInfoTableRes(ContactLayerType type);
agl::utl::ResParameterArchive loadCharacterCtrlTableRes();
sead::SafeArray<LayerTableInfoContainer, 2> mLayerTableInfo{};
sead::SafeArray<LayerMatrix, 2> mLayerMatrices{};
res::Handle* mMaterialTableHandle{};
res::Handle* mSubMaterialTableHandle{};
sead::SafeArray<res::Handle*, 2> mContactInfoTableHandles{};