Simplify agl::utl::IParameterObj::applyResParameterObj calls

This commit is contained in:
Léo Lam 2021-04-23 19:45:14 +02:00
parent 97e9bad1af
commit c6630576bb
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
11 changed files with 20 additions and 20 deletions

View File

@ -14,7 +14,7 @@ Root::~Root() {
void Root::parse(const agl::utl::ResParameterList& res_list, sead::Heap* heap) {
const auto header_obj = agl::utl::getResParameterObj(res_list, "chemical_header");
chemical_header.applyResParameterObj(header_obj, nullptr);
chemical_header.applyResParameterObj(header_obj);
if (res_shape_num.ref() != 0) {
shapes.allocBufferAssert(res_shape_num.ref(), heap);

View File

@ -17,7 +17,7 @@ bool ClothSetParam::parse(const agl::utl::ResParameterList& res_list, sead::Heap
if (!res_list)
return false;
cloth_header_obj.applyResParameterObj(res_list.getResParameterObj(0), nullptr);
cloth_header_obj.applyResParameterObj(res_list.getResParameterObj(0));
const int num_cloths = cloth_num.ref();
if (num_cloths <= 0)

View File

@ -50,7 +50,7 @@ bool RigidBodyParam::parse(const agl::utl::ResParameterList& res_list, sead::Hea
if (!res_list)
return false;
info.applyResParameterObj(res_list.getResParameterObj(0), nullptr);
info.applyResParameterObj(res_list.getResParameterObj(0));
const int num_shapes = info.shape_num.ref();
if (num_shapes < 1)

View File

@ -16,7 +16,7 @@ bool RigidBodySetParam::parse(agl::utl::ResParameterList res_list, sead::Heap* h
if (!res_list)
return false;
obj.applyResParameterObj(res_list.getResParameterObj(0), nullptr);
obj.applyResParameterObj(res_list.getResParameterObj(0));
if (*type == "from_shape_type")
type_val = Type::FromShapeType;

View File

@ -46,7 +46,7 @@ bool CharacterControllerParam::parse(agl::utl::ResParameterList res_list, sead::
if (!res_list || res_list.getResParameterObjNum() < 1)
return false;
obj.applyResParameterObj(res_list.getResParameterObj(0), nullptr);
obj.applyResParameterObj(res_list.getResParameterObj(0));
const int num_forms = *form_num;
if (num_forms < 0)
@ -86,7 +86,7 @@ bool CharacterControllerParam::Form::parse(agl::utl::ResParameterList res_list,
if (!res_list || res_list.getResParameterObjNum() < 2)
return false;
form_header_obj.applyResParameterObj(res_list.getResParameterObj(0), nullptr);
form_header_obj.applyResParameterObj(res_list.getResParameterObj(0));
const int num_shapes = *shape_num;
if (num_shapes < 1)

View File

@ -15,7 +15,7 @@ bool ContactInfoParam::parse(const agl::utl::ResParameterList& res_list, sead::H
if (!res_list || res_list.getResParameterObjNum() < 1)
return false;
obj.applyResParameterObj(res_list.getResParameterObj(0), nullptr);
obj.applyResParameterObj(res_list.getResParameterObj(0));
const int num_contact_point_info = *contact_point_info_num;
const int num_collision_info = *collision_info_num;

View File

@ -20,7 +20,7 @@ ShapeParam::~ShapeParam() {
bool ShapeParam::parse(const agl::utl::ResParameterObj& res_obj, sead::Heap* heap) {
vertices.freeBuffer();
applyResParameterObj(res_obj, nullptr);
applyResParameterObj(res_obj);
const int num_vertices = vertex_num.ref();
if (num_vertices > 0) {
@ -30,7 +30,7 @@ bool ShapeParam::parse(const agl::utl::ResParameterObj& res_obj, sead::Heap* hea
vertices[i].init(sead::Vector3f::zero, name, "頂点", this);
}
applyResParameterObj(res_obj, nullptr);
applyResParameterObj(res_obj);
}
return true;

View File

@ -28,7 +28,7 @@ bool Drop::parse_(u8* data, size_t, sead::Heap* heap) {
mTables[i].name.init("", name, "テーブル名", &mObj);
}
mObj.applyResParameterObj(header_obj, nullptr);
mObj.applyResParameterObj(header_obj);
for (s32 i = 0; i < num_tables; ++i) {
const auto obj = root.getResParameterObj(i + 1);
@ -42,7 +42,7 @@ bool Drop::parse_(u8* data, size_t, sead::Heap* heap) {
addObj(&mTables[i].obj, mTables[i].name.ref());
applyResParameterArchive(agl::utl::ResParameterArchive{data});
mTables[i].obj.applyResParameterObj(obj, nullptr);
mTables[i].obj.applyResParameterObj(obj);
if (mTables[i].column_num.ref() > 0) {
mTables[i].items.allocBufferAssert(mTables[i].column_num.ref(), heap);

View File

@ -25,7 +25,7 @@ bool LifeCondition::parse_(u8* data, size_t, sead::Heap* heap) {
if (display_distance_obj.ptr()) {
mDisplayDistance.init(0.0, "Item", "表示距離", &mDisplayDistanceObj);
addObj(&mDisplayDistanceObj, "DisplayDistance");
mDisplayDistanceObj.applyResParameterObj(display_distance_obj, nullptr);
mDisplayDistanceObj.applyResParameterObj(display_distance_obj);
}
const auto auto_display_distance_algorithm_obj =
@ -33,14 +33,14 @@ bool LifeCondition::parse_(u8* data, size_t, sead::Heap* heap) {
if (auto_display_distance_algorithm_obj.ptr()) {
mBoundingY.init("Bouding.Y", "Item", "自動距離算出アルゴリズム", &mBoundingYObj);
addObj(&mBoundingYObj, "AutoDisplayDistanceAlgorithm");
mBoundingYObj.applyResParameterObj(auto_display_distance_algorithm_obj, nullptr);
mBoundingYObj.applyResParameterObj(auto_display_distance_algorithm_obj);
}
const auto y_limit_algorithm_obj = agl::utl::getResParameterObj(root, "YLimitAlgorithm");
if (y_limit_algorithm_obj.ptr()) {
mYLimitAlgorithm.init("NoLimit", "Item", "Y制限アルゴリズム", &mYLimitAlgorithmObj);
addObj(&mYLimitAlgorithmObj, "YLimitAlgorithm");
mYLimitAlgorithmObj.applyResParameterObj(y_limit_algorithm_obj, nullptr);
mYLimitAlgorithmObj.applyResParameterObj(y_limit_algorithm_obj);
}
const auto delete_weathers_obj = agl::utl::getResParameterObj(root, "DeleteWeathers");
@ -61,7 +61,7 @@ void LifeCondition::parseArray(const agl::utl::ResParameterObj* data, agl::utl::
const sead::SafeString& key, const sead::SafeString& desc,
sead::Heap* heap) {
addObj(obj, key);
obj->applyResParameterObj(*data, nullptr);
obj->applyResParameterObj(*data);
auto count = data->mPtr->getNumParameters();
if (count == 0)
@ -76,7 +76,7 @@ void LifeCondition::parseArray(const agl::utl::ResParameterObj* data, agl::utl::
(*buffer)[i].init("", s, desc, obj);
}
obj->applyResParameterObj(*data, nullptr);
obj->applyResParameterObj(*data);
}
} // namespace ksys::res

View File

@ -28,7 +28,7 @@ bool Recipe::parse_(u8* data, size_t, sead::Heap* heap) {
mTables[i].name.init("", name, "テーブル名", &mObj);
}
mObj.applyResParameterObj(header_obj, nullptr);
mObj.applyResParameterObj(header_obj);
for (s32 i = 0; i < num_tables; ++i) {
const auto obj = root.getResParameterObj(i + 1);
@ -36,7 +36,7 @@ bool Recipe::parse_(u8* data, size_t, sead::Heap* heap) {
addObj(&mTables[i].obj, mTables[i].name.ref());
applyResParameterArchive(agl::utl::ResParameterArchive{data});
mTables[i].obj.applyResParameterObj(obj, nullptr);
mTables[i].obj.applyResParameterObj(obj);
if (mTables[i].column_num.ref() > 0) {
mTables[i].items.allocBufferAssert(mTables[i].column_num.ref(), heap);

View File

@ -27,7 +27,7 @@ bool Shop::parse_(u8* data, size_t, sead::Heap* heap) {
mTables[i].name.init("", name, "テーブル名", &mObj);
}
mObj.applyResParameterObj(header_obj, nullptr);
mObj.applyResParameterObj(header_obj);
for (s32 i = 0; i < num_tables; ++i) {
const auto obj = root.getResParameterObj(i + 1);
@ -35,7 +35,7 @@ bool Shop::parse_(u8* data, size_t, sead::Heap* heap) {
addObj(&mTables[i].obj, mTables[i].name.ref());
applyResParameterArchive(agl::utl::ResParameterArchive{data});
mTables[i].obj.applyResParameterObj(obj, nullptr);
mTables[i].obj.applyResParameterObj(obj);
if (mTables[i].column_num.ref() > 0) {
mTables[i].items.allocBufferAssert(mTables[i].column_num.ref(), heap);