ksys/act: Implement more ActorParamMgr functions

This commit is contained in:
Léo Lam 2020-11-12 16:03:03 +01:00
parent d9356ffa90
commit ffe38d0076
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
15 changed files with 559 additions and 109 deletions

View File

@ -90950,12 +90950,12 @@
0x00000071011680d4,ActorParam::ctor,372,_ZN4ksys3act13ActorParamMgrC1Ev 0x00000071011680d4,ActorParam::ctor,372,_ZN4ksys3act13ActorParamMgrC1Ev
0x0000007101168248,ActorParam::init,6612, 0x0000007101168248,ActorParam::init,6612,
0x0000007101169c1c,sub_7101169C1C,248,_ZN4sead9SafeArrayIN4ksys3res6HandleELi28EED2Ev 0x0000007101169c1c,sub_7101169C1C,248,_ZN4sead9SafeArrayIN4ksys3res6HandleELi28EED2Ev
0x0000007101169d14,sub_7101169D14,8, 0x0000007101169d14,sub_7101169D14,8,_ZNK4ksys3act13ActorParamMgr9checkPathERKN4sead14SafeStringBaseIcEE
0x0000007101169d1c,sub_7101169D1C,316, 0x0000007101169d1c,sub_7101169D1C,316,_ZN4ksys3act13ActorParamMgr10allocParamEPKcPb
0x0000007101169e58,ActorParam::getLoad,620,_ZNK4ksys3act13ActorParamMgr8getParamEPKcPPNS0_10ActorParamE? 0x0000007101169e58,ActorParam::getLoad,620,_ZNK4ksys3act13ActorParamMgr8getParamEPKcPPNS0_10ActorParamE?
0x000000710116a0c4,ActorParam::prepareLoad,404,_ZN4ksys3act13ActorParamMgr9loadParamEPKcPNS_3res6HandleEPvj 0x000000710116a0c4,ActorParam::prepareLoad,404,_ZN4ksys3act13ActorParamMgr9loadParamEPKcPNS_3res6HandleEPvj
0x000000710116a258,ActorParam::loadActorFiles,492, 0x000000710116a258,ActorParam::loadActorFiles,492,_ZN4ksys3act13ActorParamMgr9loadFilesEPNS0_10ActorParamEPN4sead4HeapEPNS_3res6HandleEPvj
0x000000710116a444,ActorParam::loadActorPack,284,_ZN4ksys3act13ActorParamMgr13loadActorPackEPNS_3res6HandleERKN4sead14SafeStringBaseIcEEj 0x000000710116a444,ActorParam::loadActorPack,284,_ZN4ksys3act13ActorParamMgr20requestLoadActorPackEPNS_3res6HandleERKN4sead14SafeStringBaseIcEEj
0x000000710116a560,sub_710116A560,224, 0x000000710116a560,sub_710116A560,224,
0x000000710116a640,sub_710116A640,548, 0x000000710116a640,sub_710116A640,548,
0x000000710116a864,ActorParam::__auto0,144, 0x000000710116a864,ActorParam::__auto0,144,
@ -91010,34 +91010,34 @@
0x0000007101173114,sub_7101173114,828, 0x0000007101173114,sub_7101173114,828,
0x0000007101173450,sub_7101173450,828, 0x0000007101173450,sub_7101173450,828,
0x000000710117378c,sub_710117378C,828, 0x000000710117378c,sub_710117378C,828,
0x0000007101173ac8,sub_7101173AC8,1788, 0x0000007101173ac8,sub_7101173AC8,1788,_ZN4ksys3act13ActorParamMgr14loadFilesStep2EPNS0_10ActorParamEPN4sead4HeapEPNS_3res6HandleEPvj
0x00000071011741c4,ActorParam::lockCsAndUnload,52, 0x00000071011741c4,ActorParam::lockCsAndUnload,52,_ZN4ksys3act13ActorParamMgr11unloadParamEPNS0_10ActorParamE
0x00000071011741f8,act::checkResourceIsInPackAndSetPackRes2,420, 0x00000071011741f8,act::checkResourceIsInPackAndSetPackRes2,420,_ZN4ksys3act13ActorParamMgr24prepareLoadFromActorPackEPN4sead22BufferedSafeStringBaseIcEEPNS_3res11LoadRequestEPvRKNS2_14SafeStringBaseIcEESD_SD_PNS6_6HandleEjSD_
0x000000710117439c,ActorParam::tapLoadActorPack,560, 0x000000710117439c,ActorParam::tapLoadActorPack,560,_ZN4ksys3act13ActorParamMgr13loadActorPackEPNS_3res6HandleERKN4sead14SafeStringBaseIcEEj
0x00000071011745cc,ActorParam::loadActorLink,1876, 0x00000071011745cc,ActorParam::loadActorLink,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res9ActorLinkEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x0000007101174d20,sub_7101174D20,1876, 0x0000007101174d20,sub_7101174D20,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res9ModelListEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x0000007101175474,sub_7101175474,1876, 0x0000007101175474,sub_7101175474,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res4UMiiEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x0000007101175bc8,sub_7101175BC8,1876, 0x0000007101175bc8,sub_7101175BC8,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res6ASListEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117631c,sub_710117631C,1876, 0x000000710117631c,sub_710117631C,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res13AttClientListEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x0000007101176a70,sub_7101176A70,1876, 0x0000007101176a70,sub_7101176A70,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res17RagdollConfigListEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x00000071011771c4,sub_71011771C4,1876, 0x00000071011771c4,sub_71011771C4,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res2ASEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x0000007101177918,sub_7101177918,1876, 0x0000007101177918,sub_7101177918,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res9AttClientEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117806c,sub_710117806C,1876, 0x000000710117806c,sub_710117806C,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res13RagdollConfigEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x00000071011787c0,ActorParam::loadAiprog,1876, 0x00000071011787c0,ActorParam::loadAiprog,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res9AIProgramEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x0000007101178f14,sub_7101178F14,1876, 0x0000007101178f14,sub_7101178F14,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res10GParamListEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x0000007101179668,sub_7101179668,1876, 0x0000007101179668,sub_7101179668,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res7PhysicsEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x0000007101179dbc,sub_7101179DBC,1876, 0x0000007101179dbc,sub_7101179DBC,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res8ChemicalEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117a510,sub_710117A510,1876, 0x000000710117a510,sub_710117A510,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res11DamageParamEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117ac64,sub_710117AC64,1876, 0x000000710117ac64,sub_710117AC64,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res18RagdollBlendWeightEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117b3b8,sub_710117B3B8,1876, 0x000000710117b3b8,sub_710117B3B8,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res9AwarenessEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117bb0c,sub_710117BB0C,1876, 0x000000710117bb0c,sub_710117BB0C,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res4DropEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117c260,sub_710117C260,1876, 0x000000710117c260,sub_710117C260,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res4ShopEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117c9b4,sub_710117C9B4,1876, 0x000000710117c9b4,sub_710117C9B4,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res6RecipeEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117d108,sub_710117D108,1876, 0x000000710117d108,sub_710117D108,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res3LodEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117d85c,sub_710117D85C,1876, 0x000000710117d85c,sub_710117D85C,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res10AIScheduleEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117dfb0,sub_710117DFB0,1876, 0x000000710117dfb0,sub_710117DFB0,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res11BoneControlEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117e704,sub_710117E704,1876, 0x000000710117e704,sub_710117E704,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res13LifeConditionEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117ee58,sub_710117EE58,1876, 0x000000710117ee58,sub_710117EE58,1876,_ZN4ksys3act13ActorParamMgr8loadFileINS_3res8AnimInfoEEEPT_PNS0_10ActorParamENS7_12ResourceTypeEPKcSB_SB_PNS3_6HandleEPvj
0x000000710117f5ac,sub_710117F5AC,376, 0x000000710117f5ac,sub_710117F5AC,376,
0x000000710117f724,sub_710117F724,8, 0x000000710117f724,sub_710117F724,8,
0x000000710117f72c,ActorParam::getBgparamlist,36,_ZNK4ksys3act13ActorParamMgr18getDummyGParamListEv 0x000000710117f72c,ActorParam::getBgparamlist,36,_ZNK4ksys3act13ActorParamMgr18getDummyGParamListEv
@ -91245,7 +91245,7 @@
0x00000071011858c0,ActorParam::Data::doUnload,440,_ZN4ksys3act10ActorParam10deleteDataEv 0x00000071011858c0,ActorParam::Data::doUnload,440,_ZN4ksys3act10ActorParam10deleteDataEv
0x0000007101185a78,sub_7101185A78,68,_ZN4ksys3act10ActorParamD0Ev 0x0000007101185a78,sub_7101185A78,68,_ZN4ksys3act10ActorParamD0Ev
0x0000007101185abc,ActorParam::Load::deleteRes2,164,_ZN4ksys3act10ActorParam16deleteResHandlesEv 0x0000007101185abc,ActorParam::Load::deleteRes2,164,_ZN4ksys3act10ActorParam16deleteResHandlesEv
0x0000007101185b60,ActorParam::Load::isDummyParamResource,136,_ZNK4ksys3act10ActorParam12isDummyParamENS_3res9ActorLink5Users4UserE 0x0000007101185b60,ActorParam::Load::isDummyParamResource,136,_ZNK4ksys3act10ActorParam12isDummyParamENS_3res9ActorLink4UserE
0x0000007101185be8,ActorParam::Load::constructRes2,188,_ZN4ksys3act10ActorParam15allocResHandlesEPN4sead4HeapEji 0x0000007101185be8,ActorParam::Load::constructRes2,188,_ZN4ksys3act10ActorParam15allocResHandlesEPN4sead4HeapEji
0x0000007101185ca4,ActorParam::Event::incRefCount,72,_ZN4ksys3act10ActorParam12incrementRefEv 0x0000007101185ca4,ActorParam::Event::incRefCount,72,_ZN4ksys3act10ActorParam12incrementRefEv
0x0000007101185cec,ActorParam::Data::unload,124,_ZN4ksys3act10ActorParam12decrementRefEv 0x0000007101185cec,ActorParam::Data::unload,124,_ZN4ksys3act10ActorParam12decrementRefEv
@ -91258,7 +91258,7 @@
0x0000007101186078,ActorParam::Load::setResourcePointer,28,_ZN4ksys3act10ActorParam11setResourceENS1_12ResourceTypeEPNS_7ParamIOE 0x0000007101186078,ActorParam::Load::setResourcePointer,28,_ZN4ksys3act10ActorParam11setResourceENS1_12ResourceTypeEPNS_7ParamIOE
0x0000007101186094,ActorParam::Load::loadPriority,472,_ZN4ksys3act10ActorParam11setPriorityERKN4sead14SafeStringBaseIcEE 0x0000007101186094,ActorParam::Load::loadPriority,472,_ZN4ksys3act10ActorParam11setPriorityERKN4sead14SafeStringBaseIcEE
0x000000710118626c,ActorParam::Load::checkClassAndPriority,424,_ZN4ksys3act10ActorParam21setProfileAndPriorityEPKcS3_ 0x000000710118626c,ActorParam::Load::checkClassAndPriority,424,_ZN4ksys3act10ActorParam21setProfileAndPriorityEPKcS3_
0x0000007101186414,nullsub_4613,4, 0x0000007101186414,nullsub_4613,4,_ZN4ksys3act10ActorParam14onLoadFinishedEPNS0_13ActorParamMgrE
0x0000007101186418,nullsub_4614,4,_ZN4ksys3res10GParamList9doCreate_EPhjPN4sead4HeapE 0x0000007101186418,nullsub_4614,4,_ZN4ksys3res10GParamList9doCreate_EPhjPN4sead4HeapE
0x000000710118641c,ResourceBgparamlist::doCreate,4,_ZThn632_N4ksys3res10GParamList9doCreate_EPhjPN4sead4HeapE 0x000000710118641c,ResourceBgparamlist::doCreate,4,_ZThn632_N4ksys3res10GParamList9doCreate_EPhjPN4sead4HeapE
0x0000007101186420,Bgparamlist::parse,22480,_ZN4ksys3res10GParamList6parse_EPhmPN4sead4HeapE 0x0000007101186420,Bgparamlist::parse,22480,_ZN4ksys3res10GParamList6parse_EPhmPN4sead4HeapE
@ -93180,7 +93180,7 @@
0x000000710120a4d4,nullsub_4699,4,_ZN4ksys3res17MemoryTaskRequestD2Ev 0x000000710120a4d4,nullsub_4699,4,_ZN4ksys3res17MemoryTaskRequestD2Ev
0x000000710120a4d8,res::ResourceMgrTask::load,1292, 0x000000710120a4d8,res::ResourceMgrTask::load,1292,
0x000000710120a9e4,canUseSdCard,8,_ZNK4ksys3res15ResourceMgrTask12canUseSdCardEv 0x000000710120a9e4,canUseSdCard,8,_ZNK4ksys3res15ResourceMgrTask12canUseSdCardEv
0x000000710120a9ec,return_0_0,8,_ZNK4ksys3res15ResourceMgrTask11returnFalseEv 0x000000710120a9ec,return_0_0,8,_ZNK4ksys3res15ResourceMgrTask10isHostPathERKN4sead14SafeStringBaseIcEE
0x000000710120a9f4,res::ResourceMgrTask::dropSFromExtensionForBfevflBcamanimAndBarslist,756,_ZNK4ksys3res15ResourceMgrTask26dropSFromExtensionIfNeededERKN4sead14SafeStringBaseIcEERNS2_22BufferedSafeStringBaseIcEEiS6_ 0x000000710120a9f4,res::ResourceMgrTask::dropSFromExtensionForBfevflBcamanimAndBarslist,756,_ZNK4ksys3res15ResourceMgrTask26dropSFromExtensionIfNeededERKN4sead14SafeStringBaseIcEERNS2_22BufferedSafeStringBaseIcEEiS6_
0x000000710120ace8,res::ResourceMgrTask::unloadSeadResource,84,_ZN4ksys3res15ResourceMgrTask18unloadSeadResourceEPN4sead8ResourceE 0x000000710120ace8,res::ResourceMgrTask::unloadSeadResource,84,_ZN4ksys3res15ResourceMgrTask18unloadSeadResourceEPN4sead8ResourceE
0x000000710120ad3c,res::ResourceMgrTask::getResourceSize,328,_ZNK4ksys3res15ResourceMgrTask15getResourceSizeERKN4sead14SafeStringBaseIcEEPNS2_10FileDeviceE 0x000000710120ad3c,res::ResourceMgrTask::getResourceSize,328,_ZNK4ksys3res15ResourceMgrTask15getResourceSizeERKN4sead14SafeStringBaseIcEEPNS2_10FileDeviceE
@ -93203,7 +93203,7 @@
0x000000710120b5a8,res::ResourceMgrTask::setCompactionStopped,104,_ZN4ksys3res15ResourceMgrTask20setCompactionStoppedEb? 0x000000710120b5a8,res::ResourceMgrTask::setCompactionStopped,104,_ZN4ksys3res15ResourceMgrTask20setCompactionStoppedEb?
0x000000710120b610,sub_710120B610,28, 0x000000710120b610,sub_710120B610,28,
0x000000710120b62c,sub_710120B62C,28, 0x000000710120b62c,sub_710120B62C,28,
0x000000710120b648,res::ResourceMgrTask::setStruct10OnTempResLoader,60, 0x000000710120b648,res::ResourceMgrTask::setStruct10OnTempResLoader,60,_ZN4ksys3res15ResourceMgrTask22initTempResourceLoaderEPNS0_18TempResourceLoaderERNS2_7InitArgE
0x000000710120b684,res::ResourceMgrTask::repairAllHandlesForSync,24, 0x000000710120b684,res::ResourceMgrTask::repairAllHandlesForSync,24,
0x000000710120b69c,sub_710120B69C,16, 0x000000710120b69c,sub_710120B69C,16,
0x000000710120b6ac,sub_710120B6AC,8,_ZN4ksys3res15ResourceMgrTask11returnTrue1Ev 0x000000710120b6ac,sub_710120B6AC,8,_ZN4ksys3res15ResourceMgrTask11returnTrue1Ev
@ -93317,7 +93317,7 @@
0x00000071012131a4,res::clearAllCaches,16, 0x00000071012131a4,res::clearAllCaches,16,
0x00000071012131b4,res::clearAllCaches2,16, 0x00000071012131b4,res::clearAllCaches2,16,
0x00000071012131c4,res::clearAllCaches3,16, 0x00000071012131c4,res::clearAllCaches3,16,
0x00000071012131d4,return_0_1,24, 0x00000071012131d4,return_0_1,24,_ZN4ksys3res10isHostPathERKN4sead14SafeStringBaseIcEE
0x00000071012131ec,res::isCompactionStopped,100, 0x00000071012131ec,res::isCompactionStopped,100,
0x0000007101213250,callResourceMgrTaskMethodOO,16, 0x0000007101213250,callResourceMgrTaskMethodOO,16,
0x0000007101213260,res::setCompactionStopped,24, 0x0000007101213260,res::setCompactionStopped,24,
@ -93333,7 +93333,7 @@
0x00000071012132c0,res::writeResourceListToCsv,4, 0x00000071012132c0,res::writeResourceListToCsv,4,
0x00000071012132c4,nullsub_4708,4, 0x00000071012132c4,nullsub_4708,4,
0x00000071012132c8,nullsub_4709,4, 0x00000071012132c8,nullsub_4709,4,
0x00000071012132cc,return_0,8, 0x00000071012132cc,return_0,8,_ZN4ksys3res12returnFalse3ERKN4sead14SafeStringBaseIcEE
0x00000071012132d4,return_8,8,_ZN4ksys3res19getDefaultAlignmentEv 0x00000071012132d4,return_8,8,_ZN4ksys3res19getDefaultAlignmentEv
0x00000071012132dc,return1,16, 0x00000071012132dc,return1,16,
0x00000071012132ec,ArchiveRes::ctor,60,_ZN4ksys3res7ArchiveC1Ev 0x00000071012132ec,ArchiveRes::ctor,60,_ZN4ksys3res7ArchiveC1Ev

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

View File

@ -49,8 +49,8 @@ void ActorParam::deleteResHandles() {
handles.freeBuffer(); handles.freeBuffer();
} }
bool ActorParam::isDummyParam(res::ActorLink::Users::User user) const { bool ActorParam::isDummyParam(res::ActorLink::User user) const {
return mRes.mActorLink->getUsers().getUserName(user) == "Dummy"; return sead::SafeString(mRes.mActorLink->getUserName(user)) == "Dummy";
} }
void ActorParam::allocResHandles(sead::Heap* heap, u32 buffer_idx, s32 count) { void ActorParam::allocResHandles(sead::Heap* heap, u32 buffer_idx, s32 count) {
@ -154,4 +154,6 @@ void ActorParam::setProfileAndPriority(const char* profile, const char* priority
} }
} }
void ActorParam::onLoadFinished(ActorParamMgr*) {}
} // namespace ksys::act } // namespace ksys::act

View File

@ -40,6 +40,8 @@ class UMii;
namespace act { namespace act {
class ActorParamMgr;
// FIXME: incomplete // FIXME: incomplete
class ActorParam : public sead::hostio::Node { class ActorParam : public sead::hostio::Node {
public: public:
@ -69,8 +71,15 @@ public:
LifeCondition = 22, LifeCondition = 22,
UMii = 23, UMii = 23,
AnimationInfo = 24, AnimationInfo = 24,
AS = 25,
AttClient = 26,
RagdollConfig = 27,
}; };
static constexpr bool isValidType(ResourceType type) {
return type <= ResourceType::AnimationInfo;
}
union Resources { union Resources {
struct { struct {
res::ActorLink* mActorLink; res::ActorLink* mActorLink;
@ -112,7 +121,7 @@ public:
Priority getPriority() const { return mPriority; } Priority getPriority() const { return mPriority; }
const Resources& getRes() const { return mRes; } const Resources& getRes() const { return mRes; }
bool isDummyParam(res::ActorLink::Users::User user) const; bool isDummyParam(res::ActorLink::User user) const;
static void resetDummyResources(); static void resetDummyResources();
@ -141,7 +150,15 @@ private:
bool setPriority(const sead::SafeString& priority); bool setPriority(const sead::SafeString& priority);
void setProfileAndPriority(const char* profile, const char* priority); void setProfileAndPriority(const char* profile, const char* priority);
u16 _8 = 0; void setResourceIfValidType(ResourceType type, ParamIO* param_io) {
if (isValidType(type))
setResource(type, param_io);
}
void onLoadFinished(ActorParamMgr* mgr);
u8 _8 = 0;
u8 _9 = 0;
u8 _a = 0; u8 _a = 0;
sead::FixedSafeString<64> mActorName; sead::FixedSafeString<64> mActorName;
sead::SafeString mProfile; sead::SafeString mProfile;

View File

@ -3,7 +3,36 @@
#include "KingSystem/ActorSystem/actASSetting.h" #include "KingSystem/ActorSystem/actASSetting.h"
#include "KingSystem/ActorSystem/actActorParam.h" #include "KingSystem/ActorSystem/actActorParam.h"
#include "KingSystem/Resource/resLoadRequest.h" #include "KingSystem/Resource/resLoadRequest.h"
#include "KingSystem/Resource/resResourceAIProgram.h"
#include "KingSystem/Resource/resResourceAISchedule.h"
#include "KingSystem/Resource/resResourceAS.h"
#include "KingSystem/Resource/resResourceASList.h"
#include "KingSystem/Resource/resResourceActorLink.h"
#include "KingSystem/Resource/resResourceAnimInfo.h"
#include "KingSystem/Resource/resResourceArchive.h"
#include "KingSystem/Resource/resResourceAttClient.h"
#include "KingSystem/Resource/resResourceAttClientList.h"
#include "KingSystem/Resource/resResourceAwareness.h"
#include "KingSystem/Resource/resResourceBoneControl.h"
#include "KingSystem/Resource/resResourceChemical.h"
#include "KingSystem/Resource/resResourceDamageParam.h"
#include "KingSystem/Resource/resResourceDrop.h"
#include "KingSystem/Resource/resResourceGParamList.h" #include "KingSystem/Resource/resResourceGParamList.h"
#include "KingSystem/Resource/resResourceLifeCondition.h"
#include "KingSystem/Resource/resResourceLod.h"
#include "KingSystem/Resource/resResourceMgrTask.h"
#include "KingSystem/Resource/resResourceModelList.h"
#include "KingSystem/Resource/resResourcePhysics.h"
#include "KingSystem/Resource/resResourceRagdollBlendWeight.h"
#include "KingSystem/Resource/resResourceRagdollConfig.h"
#include "KingSystem/Resource/resResourceRagdollConfigList.h"
#include "KingSystem/Resource/resResourceRecipe.h"
#include "KingSystem/Resource/resResourceShop.h"
#include "KingSystem/Resource/resResourceUMii.h"
#include "KingSystem/Resource/resSystem.h"
#include "KingSystem/Resource/resTempResourceLoader.h"
#include "KingSystem/Utils/Debug.h"
#include "KingSystem/Utils/ParamIO.h"
namespace ksys::act { namespace ksys::act {
@ -15,6 +44,31 @@ ActorParamMgr::~ActorParamMgr() {
ASSetting::deleteInstance(); ASSetting::deleteInstance();
} }
bool ActorParamMgr::checkPath(const sead::SafeString& path) const {
return res::returnFalse3(path);
}
ActorParam* ActorParamMgr::allocParam(const char* actor_name, bool* allocated_new) {
auto lock = sead::makeScopedLock(mCS);
ActorParam* free_param = nullptr;
auto* param = getParam(actor_name, &free_param);
if (!param) {
param = free_param;
if (free_param)
free_param->mRes = {};
else
param = &mParams[NumParams - 1];
param->mActorName = actor_name;
*allocated_new = true;
}
param->incrementRef();
return param;
}
// NON_MATCHING: addressing mode // NON_MATCHING: addressing mode
ActorParam* ActorParamMgr::getParam(const char* actor_name, ActorParam** out_free_param) const { ActorParam* ActorParamMgr::getParam(const char* actor_name, ActorParam** out_free_param) const {
auto lock = sead::makeScopedLock(mCS); auto lock = sead::makeScopedLock(mCS);
@ -32,30 +86,10 @@ ActorParam* ActorParamMgr::getParam(const char* actor_name, ActorParam** out_fre
ActorParam* ActorParamMgr::loadParam(const char* actor_name, res::Handle* handle, void* x, ActorParam* ActorParamMgr::loadParam(const char* actor_name, res::Handle* handle, void* x,
u32 load_req_c) { u32 load_req_c) {
ActorParam* param; bool allocated_new = false;
bool existing = false; ActorParam* param = allocParam(actor_name, &allocated_new);
{ if (allocated_new) {
auto lock = sead::makeScopedLock(mCS);
ActorParam* free_param = nullptr;
param = getParam(actor_name, &free_param);
if (param) {
existing = true;
} else {
param = free_param;
if (free_param)
free_param->mRes = {};
else
param = &mParams[NumParams - 1];
param->mActorName = actor_name;
}
param->incrementRef();
}
if (!existing) {
loadFiles(param, mTmpActorParamMgrHeap, handle, x, load_req_c); loadFiles(param, mTmpActorParamMgrHeap, handle, x, load_req_c);
param->setEventSignal(); param->setEventSignal();
} else { } else {
@ -65,7 +99,42 @@ ActorParam* ActorParamMgr::loadParam(const char* actor_name, res::Handle* handle
return param; return param;
} }
bool ActorParamMgr::loadActorPack(res::Handle* handle, const sead::SafeString& actor_name, void ActorParamMgr::loadFiles(ActorParam* param, sead::Heap* heap, res::Handle* pack_handle,
void* x, u32 load_req_c) {
param->deleteResHandles();
param->allocResHandles(heap, 0, 29);
param->mActiveBufferIdx = 0;
using Type = ActorParam::ResourceType;
using User = res::ActorLink::User;
const auto* link =
loadFile<res::ActorLink>(param, Type::ActorLink, "Actor/ActorLink", "xml",
param->getActorName().cstr(), pack_handle, x, load_req_c);
if (link)
param->setProfileAndPriority(link->getUserName(User::Profile), link->getPriority().cstr());
const auto* actor_link = param->getRes().mActorLink;
if (!actor_link)
return;
param->mActiveBufferIdx = 0;
loadFile<res::ModelList>(param, Type::ModelList, "Actor/ModelList", "modellist",
actor_link->getUserName(User::Model), pack_handle, x, load_req_c);
loadFile<res::UMii>(param, Type::UMii, "Actor/UMii", "umii",
actor_link->getUserName(User::UMii), pack_handle, x, load_req_c);
loadFile<res::ASList>(param, Type::ASList, "Actor/ASList", "aslist",
actor_link->getUserName(res::ActorLink::User::AS), pack_handle, x,
load_req_c);
loadFilesStep2(param, heap, pack_handle, x, load_req_c);
}
bool ActorParamMgr::requestLoadActorPack(res::Handle* handle, const sead::SafeString& actor_name,
u32 load_req_c) { u32 load_req_c) {
sead::FixedSafeString<128> path; sead::FixedSafeString<128> path;
res::LoadRequest req; res::LoadRequest req;
@ -81,6 +150,279 @@ bool ActorParamMgr::loadActorPack(res::Handle* handle, const sead::SafeString& a
return handle->requestLoad(path, &req); return handle->requestLoad(path, &req);
} }
void ActorParamMgr::loadFilesStep2(ActorParam* param, sead::Heap* heap, res::Handle* pack_handle,
void* x, u32 load_req_c) {
const auto* link = param->getRes().mActorLink;
param->mActiveBufferIdx = 0;
using Type = ActorParam::ResourceType;
using User = res::ActorLink::User;
loadFile<res::AttClientList>(param, Type::AttClientList, "Actor/AttClientList", "atcllist",
link->getUserName(User::Attention), pack_handle, x, load_req_c);
loadFile<res::RagdollConfigList>(param, Type::RagdollConfigList, "Actor/RagdollConfigList",
"rgconfiglist", link->getUserName(User::RgConfigList),
pack_handle, x, load_req_c);
{
s32 num_extra_handles = 0;
auto* aslist = param->getRes().mASList;
auto* atcllist = param->getRes().mAttClientList;
auto* rgconfiglist = param->getRes().mRagdollConfigList;
if (aslist)
num_extra_handles += aslist->getBuffers().as_defines.size();
if (atcllist)
num_extra_handles += atcllist->getClients().size();
if (rgconfiglist)
num_extra_handles += rgconfiglist->getImpulseParams().size();
param->allocResHandles(heap, 1, num_extra_handles);
}
// Start loading the extra ActorParam files.
param->mActiveBufferIdx = 1;
if (auto* aslist = param->getRes().mASList) {
for (s32 i = 0; i < aslist->getBuffers().as_defines.size(); ++i) {
auto* as = loadFile<res::AS>(param, Type::AS, "Actor/AS", "as",
aslist->getBuffers().as_defines[i].file_name.ref().cstr(),
pack_handle, x, load_req_c);
if (as) {
as->setIndex(u32(Type::AS));
aslist->addAS_(i, as);
}
}
}
if (auto* list = param->getRes().mAttClientList) {
for (s32 i = 0; i < list->getClients().size(); ++i) {
auto* client = loadFile<res::AttClient>(
param, Type::AttClient, "Actor/AttClient", "atcl",
list->getClients()[i].file_name.ref().cstr(), pack_handle, x, load_req_c);
if (client) {
client->setIndex(u32(Type::AttClient));
list->addClient_(i, client);
}
}
}
if (auto* list = param->getRes().mRagdollConfigList) {
for (s32 i = 0; i < list->getImpulseParams().size(); ++i) {
auto* config = loadFile<res::RagdollConfig>(
param, Type::RagdollConfig, "Actor/RagdollConfig", "rgconfig",
list->getImpulseParams()[i].file_name.ref().cstr(), pack_handle, x, load_req_c);
if (config) {
config->setIndex(u32(Type::RagdollConfig));
list->addImpulseParamConfig_(i, config);
}
}
}
// We have now finished loading the extra ActorParam files.
// Go back to using the main resource handle buffer.
param->mActiveBufferIdx = 0;
loadFile<res::AIProgram>(param, Type::AIProgram, "Actor/AIProgram", "aiprog",
link->getUsers().getAIProgram(), pack_handle, x, load_req_c);
loadFile<res::GParamList>(param, Type::GParamList, "Actor/GeneralParamList", "gparamlist",
link->getUsers().getGParam(), pack_handle, x, load_req_c);
loadFile<res::Physics>(param, Type::Physics, "Actor/Physics", "physics",
link->getUsers().getPhysics(), pack_handle, x, load_req_c);
loadFile<res::Chemical>(param, Type::Chemical, "Actor/Chemical", "chemical",
link->getUsers().getChemical(), pack_handle, x, load_req_c);
loadFile<res::DamageParam>(param, Type::DamageParam, "Actor/DamageParam", "dmgparam",
link->getUsers().getDamageParam(), pack_handle, x, load_req_c);
loadFile<res::RagdollBlendWeight>(param, Type::RagdollBlendWeight, "Actor/RagdollBlendWeight",
"rgbw", link->getUsers().getRgBlendWeight(), pack_handle, x,
load_req_c);
loadFile<res::Awareness>(param, Type::Awareness, "Actor/Awareness", "awareness",
link->getUsers().getAwareness(), pack_handle, x, load_req_c);
loadFile<res::Drop>(param, Type::DropTable, "Actor/DropTable", "drop",
link->getUsers().getDropTable(), pack_handle, x, load_req_c);
loadFile<res::Shop>(param, Type::ShopData, "Actor/ShopData", "shop",
link->getUsers().getShopData(), pack_handle, x, load_req_c);
loadFile<res::Recipe>(param, Type::Recipe, "Actor/Recipe", "recipe",
link->getUsers().getRecipe(), pack_handle, x, load_req_c);
loadFile<res::Lod>(param, Type::Lod, "Actor/LOD", "lod", link->getUsers().getLOD(), pack_handle,
x, load_req_c);
loadFile<res::AISchedule>(param, Type::AISchedule, "Actor/AISchedule", "aischedule",
link->getUsers().getAISchedule(), pack_handle, x, load_req_c);
loadFile<res::BoneControl>(param, Type::BoneControl, "Actor/BoneControl", "bonectrl",
link->getUsers().getBoneControl(), pack_handle, x, load_req_c);
loadFile<res::LifeCondition>(param, Type::LifeCondition, "Actor/LifeCondition", "lifecondition",
link->getUsers().getLifeCondition(), pack_handle, x, load_req_c);
loadFile<res::AnimInfo>(param, Type::AnimationInfo, "Actor/AnimationInfo", "animinfo",
link->getUsers().getAnimationInfo(), pack_handle, x, load_req_c);
param->_9 = 0;
param->onLoadFinished(this);
}
void ActorParamMgr::unloadParam(ActorParam* param) {
auto lock = sead::makeScopedLock(mCS);
param->decrementRef();
}
bool ActorParamMgr::prepareLoadFromActorPack(sead::BufferedSafeString* path, res::LoadRequest* req,
void*, const sead::SafeString& dir_name,
const sead::SafeString& extension,
const sead::SafeString& file_name,
res::Handle* pack_handle, u32 load_req_c,
const sead::SafeString& requester) {
path->format("%s/%s.b%s", dir_name.cstr(), file_name.cstr(), extension.cstr());
bool in_pack = false;
if (pack_handle && pack_handle->isSuccess()) {
auto* pack = static_cast<sead::ArchiveRes*>(pack_handle->getResourceUnchecked());
in_pack = pack->getFile(*path) != nullptr;
}
const bool cond1 = res::returnFalse3(*path);
const bool is_host_path = res::isHostPath(*path);
if (!in_pack && !cond1 && !is_host_path && path->include("bxml")) {
sead::FormatFixedSafeString<256> message("↓↓↓\nファイルパス : %s\n↑↑↑\n", path->cstr());
util::PrintDebug(message);
}
const bool ret = res::returnFalse3(*path);
if (!ret && pack_handle && pack_handle->isSuccess()) {
req->mPackHandle = pack_handle;
req->_24 = false;
}
req->_c = load_req_c;
req->mRequester = requester;
req->_8 = true;
return ret;
}
res::Archive* ActorParamMgr::loadActorPack(res::Handle* handle, const sead::SafeString& actor_name,
u32 load_req_c) {
sead::FixedSafeString<128> path;
res::TempResourceLoader::LoadArg arg;
arg.retry_on_failure = true;
arg.use_handle = true;
if (mFlags.isOn(Flag::_5))
return nullptr;
path.format("Actor/Pack/%s.bactorpack", actor_name.cstr());
arg.load_req.mRequester = actor_name;
arg.load_req._c = load_req_c;
arg.load_req._8 = true;
arg.load_req._28 = false;
arg.load_req.mPath = path;
res::TempResourceLoader loader;
{
res::TempResourceLoader::InitArg init_arg{};
res::ResourceMgrTask::instance()->initTempResourceLoader(&loader, init_arg);
}
loader.load(arg);
res::SimpleLoadRequest req;
req.mRequester = "tap::ActorParamMgr";
req.mPath = path;
req._c = 2;
return sead::DynamicCast<res::Archive>(handle->load(path, &req));
}
template <typename T>
T* ActorParamMgr::loadFile(ActorParam* param, ActorParam::ResourceType type, const char* dir_name_c,
const char* extension_c, const char* name_c, res::Handle* pack_handle,
void* x, u32 load_req_c) {
const sead::SafeString name = name_c;
const sead::SafeString extension = extension_c;
sead::FixedSafeString<128> path;
T* res = nullptr;
if (name != "Dummy" && !name.isEmpty()) {
auto* temp_handle = param->allocHandle();
const sead::SafeString* actor_name;
path.format("%s/%s.b%s", dir_name_c, name_c, extension_c);
{
res::SimpleLoadRequest req;
req._8 = true;
actor_name = &param->getActorName();
req.mRequester = *actor_name;
req.mPath = path;
req._c = 2;
res = sead::DynamicCast<T>(temp_handle->load(path, &req));
}
// If loading the resource from the RomFS has failed, try to load it from the actor pack.
if (!res) {
if (!pack_handle->isSuccess())
loadActorPack(pack_handle, *actor_name, load_req_c);
res::LoadRequest req;
prepareLoadFromActorPack(&path, &req, x, dir_name_c, extension_c, name_c, pack_handle,
load_req_c, *actor_name);
res = sead::DynamicCast<T>(temp_handle->load(path, &req));
if (!res) {
static_cast<void>(temp_handle->isSuccess());
// Try again without the pack.
if (req.mPackHandle) {
req.mPackHandle = nullptr;
req._24 = false;
res = sead::DynamicCast<T>(temp_handle->load(path, &req));
if (!res)
static_cast<void>(temp_handle->isSuccess());
}
}
}
if (!res)
param->freeLastHandle();
else if (type == ActorParam::ResourceType::EventFlow)
temp_handle->requestUnload2();
} else {
path.format("%s/%s.b%s", dir_name_c, name_c, extension_c);
res = sead::DynamicCast<T>(mResHandles[s32(type)].getResource());
}
if (res) {
if (type == ActorParam::ResourceType::EventFlow)
return res;
static_cast<ParamIO*>(res)->getPath().copy(path);
param->setResourceIfValidType(type, res);
return res;
}
if (extension != "fevfl")
param->_a = 1;
// Fall back to using the dummy resource.
res = sead::DynamicCast<T>(mResHandles[s32(type)].getResource());
sead::FixedSafeString<128> dummy_path;
dummy_path.format("%s/Dummy.b%s", dir_name_c, extension_c);
if (res) {
static_cast<ParamIO*>(res)->getPath().copy(dummy_path);
param->setResourceIfValidType(type, res);
}
return res;
}
res::GParamList* ActorParamMgr::getDummyGParamList() const { res::GParamList* ActorParamMgr::getDummyGParamList() const {
return static_cast<res::GParamList*>( return static_cast<res::GParamList*>(
mResHandles[u32(ActorParam::ResourceType::GParamList)].getResourceUnchecked()); mResHandles[u32(ActorParam::ResourceType::GParamList)].getResourceUnchecked());

View File

@ -6,6 +6,7 @@
#include <prim/seadSafeString.h> #include <prim/seadSafeString.h>
#include <prim/seadTypedBitFlag.h> #include <prim/seadTypedBitFlag.h>
#include <thread/seadCriticalSection.h> #include <thread/seadCriticalSection.h>
#include "KingSystem/ActorSystem/actActorParam.h"
#include "KingSystem/Resource/resHandle.h" #include "KingSystem/Resource/resHandle.h"
#include "KingSystem/System/DebugMessage.h" #include "KingSystem/System/DebugMessage.h"
#include "KingSystem/System/KingEditor.h" #include "KingSystem/System/KingEditor.h"
@ -14,13 +15,13 @@
namespace ksys { namespace ksys {
namespace res { namespace res {
class Archive;
class GParamList; class GParamList;
class LoadRequest;
} // namespace res } // namespace res
namespace act { namespace act {
class ActorParam;
// FIXME: incomplete // FIXME: incomplete
class ActorParamMgr final : public sead::hostio::Node, public KingEditorComponent { class ActorParamMgr final : public sead::hostio::Node, public KingEditorComponent {
SEAD_SINGLETON_DISPOSER(ActorParamMgr) SEAD_SINGLETON_DISPOSER(ActorParamMgr)
@ -35,10 +36,14 @@ public:
sead::Heap* getDebugHeap() const { return mDebugHeap; } sead::Heap* getDebugHeap() const { return mDebugHeap; }
sead::Heap* getTmpActorParamMgrHeap() const { return mTmpActorParamMgrHeap; } sead::Heap* getTmpActorParamMgrHeap() const { return mTmpActorParamMgrHeap; }
bool checkPath(const sead::SafeString& path) const;
void init(sead::Heap* heap, sead::Heap* debug_heap); void init(sead::Heap* heap, sead::Heap* debug_heap);
ActorParam* allocParam(const char* actor_name, bool* allocated_new);
ActorParam* getParam(const char* actor_name, ActorParam** out_free_param) const; ActorParam* getParam(const char* actor_name, ActorParam** out_free_param) const;
ActorParam* loadParam(const char* actor_name, res::Handle* handle, void* x, u32 load_req_c); ActorParam* loadParam(const char* actor_name, res::Handle* handle, void* x, u32 load_req_c);
void unloadParam(ActorParam* param);
res::GParamList* getDummyGParamList() const; res::GParamList* getDummyGParamList() const;
@ -50,9 +55,25 @@ private:
_5 = _1 | _4, _5 = _1 | _4,
}; };
void loadFiles(ActorParam* param, sead::Heap* heap, res::Handle* handle, void* x, void loadFiles(ActorParam* param, sead::Heap* heap, res::Handle* pack_handle, void* x,
u32 load_req_c);
bool requestLoadActorPack(res::Handle* handle, const sead::SafeString& actor_name,
u32 load_req_c);
bool prepareLoadFromActorPack(sead::BufferedSafeString* path, res::LoadRequest* req, void* x,
const sead::SafeString& dir_name,
const sead::SafeString& extension,
const sead::SafeString& file_name, res::Handle* pack_handle,
u32 load_req_c, const sead::SafeString& requester);
res::Archive* loadActorPack(res::Handle* handle, const sead::SafeString& actor_name,
u32 load_req_c);
template <typename T>
T* loadFile(ActorParam* param, ActorParam::ResourceType type, const char* dir_name_c,
const char* extension_c, const char* name_c, res::Handle* pack_handle, void* x,
u32 load_req_c);
void loadFilesStep2(ActorParam* param, sead::Heap* heap, res::Handle* pack_handle, void* x,
u32 load_req_c); u32 load_req_c);
bool loadActorPack(res::Handle* handle, const sead::SafeString& actor_name, u32 load_req_c);
static constexpr s32 NumParams = 0x400; static constexpr s32 NumParams = 0x400;

View File

@ -10,6 +10,8 @@
namespace ksys::res { namespace ksys::res {
class AS;
class ASList : public ParamIO, public Resource { class ASList : public ParamIO, public Resource {
SEAD_RTTI_OVERRIDE(ASList, Resource) SEAD_RTTI_OVERRIDE(ASList, Resource)
public: public:
@ -17,7 +19,7 @@ public:
agl::utl::Parameter<sead::SafeString> name; agl::utl::Parameter<sead::SafeString> name;
agl::utl::Parameter<sead::SafeString> file_name; agl::utl::Parameter<sead::SafeString> file_name;
agl::utl::ParameterObj obj; agl::utl::ParameterObj obj;
void* _88; AS* as;
}; };
KSYS_CHECK_SIZE_NX150(ASDefine, 0x88); KSYS_CHECK_SIZE_NX150(ASDefine, 0x88);
@ -65,6 +67,8 @@ public:
const Buffers& getBuffers() const { return mBuffers; } const Buffers& getBuffers() const { return mBuffers; }
const Common& getCommon() const { return mCommon.ref(); } const Common& getCommon() const { return mCommon.ref(); }
void addAS_(s32 index, AS* as);
protected: protected:
bool finishParsing_() override; bool finishParsing_() override;
bool m7_() override; bool m7_() override;

View File

@ -13,7 +13,6 @@ namespace ksys::res {
class ActorLink : public ParamIO, public Resource { class ActorLink : public ParamIO, public Resource {
SEAD_RTTI_OVERRIDE(ActorLink, Resource) SEAD_RTTI_OVERRIDE(ActorLink, Resource)
public: public:
struct Users {
enum class User { enum class User {
Profile = 0, Profile = 0,
ActorCapture = 1, ActorCapture = 1,
@ -43,11 +42,39 @@ public:
AnimationInfo = 25, AnimationInfo = 25,
}; };
struct Users {
const agl::utl::Parameter<sead::SafeString>& getUser(User user) const { const agl::utl::Parameter<sead::SafeString>& getUser(User user) const {
return *(&profile + u32(user)); return *(&profile + u32(user));
} }
sead::SafeString getUserName(User user) const { return getUser(user).ref().cstr(); } const char* getUserName(User user) const { return getUser(user).ref().cstr(); }
const char* getProfile() const { return profile.ref().cstr(); }
const char* getActorCapture() const { return actor_capture.ref().cstr(); }
const char* getAS() const { return as.ref().cstr(); }
const char* getModel() const { return model.ref().cstr(); }
const char* getAnim() const { return anim.ref().cstr(); }
const char* getAIProgram() const { return ai_program.ref().cstr(); }
const char* getGParam() const { return gparam.ref().cstr(); }
const char* getDamageParam() const { return damage_param.ref().cstr(); }
const char* getRgConfigList() const { return rg_config_list.ref().cstr(); }
const char* getRgBlendWeight() const { return rg_blend_weight.ref().cstr(); }
const char* getAwareness() const { return awareness.ref().cstr(); }
const char* getPhysics() const { return physics.ref().cstr(); }
const char* getChemical() const { return chemical.ref().cstr(); }
const char* getAttention() const { return attention.ref().cstr(); }
const char* getELink() const { return elink.ref().cstr(); }
const char* getSLink() const { return slink.ref().cstr(); }
const char* getXLink() const { return xlink.ref().cstr(); }
const char* getDropTable() const { return drop_table.ref().cstr(); }
const char* getShopData() const { return shop_data.ref().cstr(); }
const char* getRecipe() const { return recipe.ref().cstr(); }
const char* getLOD() const { return lod.ref().cstr(); }
const char* getBoneControl() const { return bone_control.ref().cstr(); }
const char* getAISchedule() const { return ai_schedule.ref().cstr(); }
const char* getLifeCondition() const { return life_condition.ref().cstr(); }
const char* getUMii() const { return umii.ref().cstr(); }
const char* getAnimationInfo() const { return animation_info.ref().cstr(); }
agl::utl::Parameter<sead::SafeString> profile; agl::utl::Parameter<sead::SafeString> profile;
agl::utl::Parameter<sead::SafeString> actor_capture; agl::utl::Parameter<sead::SafeString> actor_capture;
@ -84,6 +111,7 @@ public:
bool needsParse() const override { return true; } bool needsParse() const override { return true; }
const Users& getUsers() const { return mUsers; } const Users& getUsers() const { return mUsers; }
const char* getUserName(User user) const { return getUsers().getUserName(user); }
const sead::SafeString& getActorNameJpn() const { return mActorNameJpn.ref(); } const sead::SafeString& getActorNameJpn() const { return mActorNameJpn.ref(); }
const sead::SafeString& getPriority() const { return mPriority.ref(); } const sead::SafeString& getPriority() const { return mPriority.ref(); }
f32 getActorScale() const { return mActorScale.ref(); } f32 getActorScale() const { return mActorScale.ref(); }

View File

@ -10,6 +10,8 @@
namespace ksys::res { namespace ksys::res {
class AttClient;
class AttClientList : public ParamIO, public Resource { class AttClientList : public ParamIO, public Resource {
SEAD_RTTI_OVERRIDE(AttClientList, Resource) SEAD_RTTI_OVERRIDE(AttClientList, Resource)
public: public:
@ -26,7 +28,7 @@ public:
agl::utl::Parameter<sead::SafeString> file_name; agl::utl::Parameter<sead::SafeString> file_name;
agl::utl::Parameter<bool> is_valid; agl::utl::Parameter<bool> is_valid;
agl::utl::ParameterObj obj; agl::utl::ParameterObj obj;
void* _a0; AttClient* client;
}; };
KSYS_CHECK_SIZE_NX150(Client, 0xa8); KSYS_CHECK_SIZE_NX150(Client, 0xa8);
@ -36,6 +38,8 @@ public:
bool isForceEdit() const { return mForceEdit.ref(); } bool isForceEdit() const { return mForceEdit.ref(); }
const sead::Buffer<Client>& getClients() const { return mClients; } const sead::Buffer<Client>& getClients() const { return mClients; }
void addClient_(s32 index, AttClient* client) { mClients[index].client = client; }
private: private:
agl::utl::ParameterList mAttClientsList; agl::utl::ParameterList mAttClientsList;
agl::utl::ParameterObj mAttPosObj; agl::utl::ParameterObj mAttPosObj;

View File

@ -373,7 +373,7 @@ bool ResourceMgrTask::canUseSdCard() const {
return false; return false;
} }
bool ResourceMgrTask::returnFalse() const { bool ResourceMgrTask::isHostPath(const sead::SafeString&) const {
return false; return false;
} }
@ -634,6 +634,12 @@ bool ResourceMgrTask::isCompactionStopped() const {
return mCompactionCounter == 0; return mCompactionCounter == 0;
} }
bool ResourceMgrTask::initTempResourceLoader(TempResourceLoader* loader,
TempResourceLoader::InitArg& arg) {
arg.work = mTexHandleMgr->getArchiveWork();
return loader->init(arg);
}
bool ResourceMgrTask::returnTrue1() { bool ResourceMgrTask::returnTrue1() {
return true; return true;
} }

View File

@ -21,6 +21,7 @@
#include "KingSystem/Resource/resControlTask.h" #include "KingSystem/Resource/resControlTask.h"
#include "KingSystem/Resource/resCounter.h" #include "KingSystem/Resource/resCounter.h"
#include "KingSystem/Resource/resInfoContainer.h" #include "KingSystem/Resource/resInfoContainer.h"
#include "KingSystem/Resource/resTempResourceLoader.h"
#include "KingSystem/Resource/resUnit.h" #include "KingSystem/Resource/resUnit.h"
#include "KingSystem/Resource/resUnitPool.h" #include "KingSystem/Resource/resUnitPool.h"
#include "KingSystem/System/OverlayArena.h" #include "KingSystem/System/OverlayArena.h"
@ -162,7 +163,7 @@ public:
sead::DirectResource* load(const DirectLoadArg& arg); sead::DirectResource* load(const DirectLoadArg& arg);
bool canUseSdCard() const; bool canUseSdCard() const;
bool returnFalse() const; bool isHostPath(const sead::SafeString& path) const;
bool dropSFromExtensionIfNeeded(const sead::SafeString& path, bool dropSFromExtensionIfNeeded(const sead::SafeString& path,
sead::BufferedSafeString& new_path, s32 dot_idx, sead::BufferedSafeString& new_path, s32 dot_idx,
@ -213,6 +214,8 @@ public:
void setCompactionStopped(bool stopped); void setCompactionStopped(bool stopped);
bool isCompactionStopped() const; bool isCompactionStopped() const;
bool initTempResourceLoader(TempResourceLoader* loader, TempResourceLoader::InitArg& arg);
bool returnTrue1(); bool returnTrue1();
void clearCacheWithFileExtension(const sead::SafeString& extension); void clearCacheWithFileExtension(const sead::SafeString& extension);

View File

@ -10,13 +10,15 @@
namespace ksys::res { namespace ksys::res {
class RagdollConfig;
class RagdollConfigList : public ParamIO, public Resource { class RagdollConfigList : public ParamIO, public Resource {
SEAD_RTTI_OVERRIDE(RagdollConfigList, Resource) SEAD_RTTI_OVERRIDE(RagdollConfigList, Resource)
public: public:
struct ImpulseParam { struct ImpulseParam {
agl::utl::Parameter<sead::SafeString> file_name; agl::utl::Parameter<sead::SafeString> file_name;
agl::utl::ParameterObj obj; agl::utl::ParameterObj obj;
void* _58; RagdollConfig* config;
}; };
KSYS_CHECK_SIZE_NX150(ImpulseParam, 0x60); KSYS_CHECK_SIZE_NX150(ImpulseParam, 0x60);
@ -39,7 +41,11 @@ public:
const sead::Buffer<ImpulseParam>& getImpulseParams() const { return mImpulseParams; } const sead::Buffer<ImpulseParam>& getImpulseParams() const { return mImpulseParams; }
f32 getUpperLimitHeight() const { return mUpperLimitHeight.ref(); } f32 getUpperLimitHeight() const { return mUpperLimitHeight.ref(); }
f32 getLowerLimitHeight() const { return mLowerLimitHeight.ref(); } f32 getLowerLimitHeight() const { return mLowerLimitHeight.ref(); }
const sead::Buffer<BodyParam>& getMBodyParams() const { return mBodyParams; } const sead::Buffer<BodyParam>& getBodyParams() const { return mBodyParams; }
void addImpulseParamConfig_(s32 index, RagdollConfig* config) {
mImpulseParams[index].config = config;
}
private: private:
agl::utl::ParameterList mImpulseParamList; agl::utl::ParameterList mImpulseParamList;

View File

@ -1,4 +1,5 @@
#include "KingSystem/Resource/resSystem.h" #include "KingSystem/Resource/resSystem.h"
#include "KingSystem/Resource/resResourceMgrTask.h"
namespace ksys::res { namespace ksys::res {
@ -6,6 +7,10 @@ bool stubbedLogFunction() {
return true; return true;
} }
bool isHostPath(const sead::SafeString& path) {
return ResourceMgrTask::instance()->isHostPath(path);
}
bool returnFalse() { bool returnFalse() {
return false; return false;
} }
@ -14,6 +19,10 @@ bool returnFalse2(const sead::SafeString&) {
return false; return false;
} }
bool returnFalse3(const sead::SafeString&) {
return false;
}
s32 getDefaultAlignment() { s32 getDefaultAlignment() {
return 8; return 8;
} }

View File

@ -9,6 +9,8 @@ class EntryFactoryBase;
void registerEntryFactory(EntryFactoryBase* factory, const sead::SafeString& name); void registerEntryFactory(EntryFactoryBase* factory, const sead::SafeString& name);
void unregisterEntryFactory(EntryFactoryBase* factory); void unregisterEntryFactory(EntryFactoryBase* factory);
bool isHostPath(const sead::SafeString& path);
// In release builds, the only thing this function does is return 1. // In release builds, the only thing this function does is return 1.
// TODO: figure out what this is used for. Stubbed log function? // TODO: figure out what this is used for. Stubbed log function?
bool stubbedLogFunction(); bool stubbedLogFunction();
@ -21,6 +23,8 @@ bool returnFalse();
// TODO: figure out what this is used for. Stubbed log function? // TODO: figure out what this is used for. Stubbed log function?
bool returnFalse2(const sead::SafeString&); bool returnFalse2(const sead::SafeString&);
bool returnFalse3(const sead::SafeString& path);
s32 getDefaultAlignment(); s32 getDefaultAlignment();
} // namespace ksys::res } // namespace ksys::res

View File

@ -2,11 +2,14 @@
namespace ksys::res { namespace ksys::res {
class ArchiveWork;
// TODO: very incomplete // TODO: very incomplete
class TextureHandleMgr { class TextureHandleMgr {
public: public:
virtual ~TextureHandleMgr(); virtual ~TextureHandleMgr();
ArchiveWork* getArchiveWork() const;
void clearAllCache(); void clearAllCache();
}; };

View File

@ -16,12 +16,13 @@ public:
bool applyResourceUpdate(const char* data, const char* data1); bool applyResourceUpdate(const char* data, const char* data1);
u32 getIdx() const { return mIdx; } u32 getIdx() const { return mIdx; }
const sead::SafeString& getId() const { return mId; } sead::BufferedSafeString& getPath() { return mPath; }
const sead::BufferedSafeString& getPath() const { return mPath; }
void setIndex(u32 idx) { mIdx = idx; } void setIndex(u32 idx) { mIdx = idx; }
protected: protected:
u32 mIdx = 0x1c; u32 mIdx = 0x1c;
sead::FixedSafeString<128> mId; sead::FixedSafeString<128> mPath;
}; };
KSYS_CHECK_SIZE_NX150(ParamIO, 0x278); KSYS_CHECK_SIZE_NX150(ParamIO, 0x278);