ksys/res: Implement AttClient

This commit is contained in:
Léo Lam 2021-04-26 12:29:17 +02:00
parent 33b2c46594
commit a500ebc6a4
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
3 changed files with 78 additions and 25 deletions

View File

@ -87850,30 +87850,30 @@
0x00000071010924c4,sub_71010924C4,280,_ZN4ksys3res15AttCheckAreaBoxC2ENS0_12AttCheckTypeE
0x00000071010925dc,sub_71010925DC,140,_ZNK4sead15RuntimeTypeInfo6DeriveIN4ksys3res8AttCheckEE9isDerivedEPKNS0_9InterfaceE
0x0000007101092668,sub_7101092668,140,_ZNK4sead15RuntimeTypeInfo6DeriveIN4ksys3res12AttCheckAreaEE9isDerivedEPKNS0_9InterfaceE
0x00000071010926f4,sub_71010926F4,248,
0x00000071010927ec,ResourceBatcllist::m2,248,
0x00000071010928e4,sub_71010928E4,252,
0x00000071010929e0,sub_71010929E0,240,
0x0000007101092ad0,ResourceBatcllist::m3,240,
0x0000007101092bc0,sub_7101092BC0,252,
0x0000007101092cbc,nullsub_4463,4,
0x0000007101092cc0,ResourceBatcllist::m5_null,4,
0x0000007101092cc4,Batcllist::parse,736,
0x0000007101092fa4,ResourceBatcllist::m9,8,
0x0000007101092fac,sub_7101092FAC,8,
0x0000007101092fb4,ResourceBatcllist::m11,8,
0x0000007101092fbc,sub_7101092FBC,104,
0x0000007101093024,ResourceBatcllist::m12,104,
0x00000071010926f4,sub_71010926F4,248,_ZN4ksys3res13AttClientListD1Ev
0x00000071010927ec,ResourceBatcllist::m2,248,_ZThn632_N4ksys3res13AttClientListD1Ev
0x00000071010928e4,sub_71010928E4,252,_ZThn664_N4ksys3res13AttClientListD1Ev
0x00000071010929e0,sub_71010929E0,240,_ZN4ksys3res13AttClientListD0Ev
0x0000007101092ad0,ResourceBatcllist::m3,240,_ZThn632_N4ksys3res13AttClientListD0Ev
0x0000007101092bc0,sub_7101092BC0,252,_ZThn664_N4ksys3res13AttClientListD0Ev
0x0000007101092cbc,nullsub_4463,4,_ZN4ksys3res13AttClientList9doCreate_EPhjPN4sead4HeapE
0x0000007101092cc0,ResourceBatcllist::m5_null,4,_ZThn632_N4ksys3res13AttClientList9doCreate_EPhjPN4sead4HeapE
0x0000007101092cc4,Batcllist::parse,736,_ZN4ksys3res13AttClientList6parse_EPhmPN4sead4HeapE
0x0000007101092fa4,ResourceBatcllist::m9,8,_ZThn632_N4ksys3res13AttClientList6parse_EPhmPN4sead4HeapE
0x0000007101092fac,sub_7101092FAC,8,_ZN4ksys3res13AttClientList14finishParsing_Ev
0x0000007101092fb4,ResourceBatcllist::m11,8,_ZThn632_N4ksys3res13AttClientList14finishParsing_Ev
0x0000007101092fbc,sub_7101092FBC,104,_ZN4ksys3res13AttClientList3m7_Ev
0x0000007101093024,ResourceBatcllist::m12,104,_ZThn632_N4ksys3res13AttClientList3m7_Ev
0x000000710109308c,sub_710109308C,128,
0x000000710109310c,sub_710109310C,8,
0x0000007101093114,sub_7101093114,8,
0x000000710109311c,sub_710109311C,92,
0x0000007101093178,sub_7101093178,8,
0x0000007101093180,ResourceBatcllist::m0,8,
0x0000007101093188,ResourceBatcllist::m1,92,
0x00000071010931e4,ResourceBatcllist::m6,8,
0x000000710109310c,sub_710109310C,8,_ZNK4ksys3res13AttClientList11isForceEditEv
0x0000007101093114,sub_7101093114,8,_ZNK4ksys3res13AttClientList27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE?
0x000000710109311c,sub_710109311C,92,_ZNK4ksys3res13AttClientList18getRuntimeTypeInfoEv
0x0000007101093178,sub_7101093178,8,_ZNK4ksys3res13AttClientList10needsParseEv
0x0000007101093180,ResourceBatcllist::m0,8,_ZThn632_NK4ksys3res13AttClientList27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE?
0x0000007101093188,ResourceBatcllist::m1,92,_ZThn632_NK4ksys3res13AttClientList18getRuntimeTypeInfoEv
0x00000071010931e4,ResourceBatcllist::m6,8,_ZThn632_NK4ksys3res13AttClientList10needsParseEv
0x00000071010931ec,sub_71010931EC,372,
0x0000007101093360,sub_7101093360,308,
0x0000007101093360,sub_7101093360,308,_ZN4sead6BufferIN4ksys3res13AttClientList6ClientEE14tryAllocBufferEiPNS_4HeapEi
0x0000007101093494,sub_7101093494,268,_ZN4ksys3res9AttClientD1Ev
0x00000071010935a0,sub_71010935A0,268,_ZThn632_N4ksys3res9AttClientD1Ev
0x00000071010936ac,sub_71010936AC,280,_ZThn664_N4ksys3res9AttClientD1Ev
@ -87889,10 +87889,10 @@
0x0000007101094670,sub_7101094670,248,
0x0000007101094768,sub_7101094768,116,
0x00000071010947dc,sub_71010947DC,364,_ZN4ksys3res9AttClient14appendPriorityEPN4sead22BufferedSafeStringBaseIcEE
0x0000007101094948,sub_7101094948,8,_ZNK4ksys3res9AttClient27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
0x0000007101094948,sub_7101094948,8,_ZNK4ksys3res9AttClient27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE?
0x0000007101094950,sub_7101094950,92,_ZNK4ksys3res9AttClient18getRuntimeTypeInfoEv
0x00000071010949ac,sub_71010949AC,8,_ZNK4ksys3res9AttClient10needsParseEv
0x00000071010949b4,sub_71010949B4,8,_ZThn632_NK4ksys3res9AttClient27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
0x00000071010949b4,sub_71010949B4,8,_ZThn632_NK4ksys3res9AttClient27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE?
0x00000071010949bc,sub_71010949BC,92,_ZThn632_NK4ksys3res9AttClient18getRuntimeTypeInfoEv
0x0000007101094a18,sub_7101094A18,8,_ZThn632_NK4ksys3res9AttClient10needsParseEv
0x0000007101094a20,sub_7101094A20,428,_ZN4ksys3act13AttActionType5text_Ei

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

View File

@ -4,6 +4,57 @@
namespace ksys::res {
AttClientList::~AttClientList() {
mClients.freeBuffer();
}
void AttClientList::doCreate_(u8* buffer, u32 buffer_size, sead::Heap* heap) {}
bool AttClientList::parse_(u8* data, size_t size, sead::Heap* heap) {
if (!data)
return false;
agl::utl::ResParameterArchive archive{data};
const auto root = archive.getRootList();
mAttPos.init(&mAttPosObj);
mForceEdit.init(false, "ForceEdit", "強制編集", "", &mAttPosObj);
addObj(&mAttPosObj, "AttPos");
const auto AttClients = agl::utl::getResParameterList(root, "AttClients");
if (int num; AttClients && (num = AttClients.getResParameterObjNum()) != 0) {
mClients.allocBufferAssert(num, heap);
for (auto it = mClients.begin(), end = mClients.end(); it != end; ++it) {
it->client = nullptr;
it->name.init("", "Name", "クライアントのキー名", "", &it->obj);
it->file_name.init("", "FileName", "クライアントのデータファイル名", "", &it->obj);
it->is_valid.init(true, "IsValid", "デフォルトの有効・無効状態", "", &it->obj);
mAttClientsList.addObj(
&it->obj, sead::FormatFixedSafeString<32>("%s%d", "AttClient_", it.getIndex()));
}
}
addList(&mAttClientsList, "AttClients");
applyResParameterArchive(archive);
return true;
}
bool AttClientList::finishParsing_() {
return true;
}
bool AttClientList::m7_() {
for (auto& client : mClients)
client.client = nullptr;
return true;
}
bool AttClientList::isForceEdit() const {
return mForceEdit.ref();
}
AttClient::~AttClient() {
for (int i = 0; i < mChecks.size(); ++i) {
if (mChecks[i]) {

View File

@ -70,9 +70,11 @@ public:
auto operator=(const AttClientList&) = delete;
const AttPos& getAttPos() const { return mAttPos; }
bool isForceEdit() const { return mForceEdit.ref(); }
bool isForceEdit() const;
const sead::Buffer<Client>& getClients() const { return mClients; }
// TODO: one more function
void addClient_(s32 index, AttClient* client) { mClients[index].client = client; }
void doCreate_(u8* buffer, u32 buffer_size, sead::Heap* heap) override;