From 19d6c790f36b1b1749ce7526cd33a36356f9e9c8 Mon Sep 17 00:00:00 2001 From: Nico Marikucza Date: Sun, 8 Sep 2024 19:16:46 +0200 Subject: [PATCH] Add createObjByName functions --- PTD/PTUtils/include/ActorUtil.h | 3 +++ PTD/PTUtils/source/ActorUtil.cpp | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/PTD/PTUtils/include/ActorUtil.h b/PTD/PTUtils/include/ActorUtil.h index 6be4f6b..a8d9037 100644 --- a/PTD/PTUtils/include/ActorUtil.h +++ b/PTD/PTUtils/include/ActorUtil.h @@ -17,4 +17,7 @@ namespace pt { void initShadowVolumeBox(LiveActor* pActor, const TVec3f& rPos); LiveActor* getSpecificActorFromGroup(LiveActor* pActor, const char* pName); + + NameObj *createObjByName(const char *pName); + NameObj *createObjByNameAndInitWithoutIter(const char *pName); }; diff --git a/PTD/PTUtils/source/ActorUtil.cpp b/PTD/PTUtils/source/ActorUtil.cpp index 797806f..4c2ec61 100644 --- a/PTD/PTUtils/source/ActorUtil.cpp +++ b/PTD/PTUtils/source/ActorUtil.cpp @@ -66,7 +66,7 @@ namespace pt { void initShadowVolumeBox(LiveActor* pActor, const TVec3f& rPos) { pActor->initShadowControllerList(1); - MR::addShadowVolumeBox(pActor, "ボリューム影(ボックス)", rPos, (MtxPtr)pActor->getBaseMtx()); + MR::addShadowVolumeBox(pActor, "{[e({bNX)", rPos, (MtxPtr)pActor->getBaseMtx()); } LiveActor* getSpecificActorFromGroup(LiveActor* pActor, const char* pName) { @@ -81,4 +81,18 @@ namespace pt { } return pObj; } + + NameObj *createObjByName(const char *pName) { + CreateActorFunc *pCreator; + pCreator = (CreateActorFunc *)NameObjFactory::getCreator(pName); + return pCreator(MR::getJapaneseObjectName(pName)); + } + + NameObj *createObjByNameAndInitWithoutIter(const char *pName) { + CreateActorFunc *pCreator; + pCreator = (CreateActorFunc *)NameObjFactory::getCreator(pName); + NameObj *pObj = pCreator(MR::getJapaneseObjectName(pName)); + pObj->initWithoutIter(); + return pObj; + } }