Skip to content

Commit

Permalink
Add createObjByName functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bavario-lginc committed Sep 8, 2024
1 parent 0f0b902 commit 19d6c79
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions PTD/PTUtils/include/ActorUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
16 changes: 15 additions & 1 deletion PTD/PTUtils/source/ActorUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(ƒ{ƒbƒNƒX)", rPos, (MtxPtr)pActor->getBaseMtx());
}

LiveActor* getSpecificActorFromGroup(LiveActor* pActor, const char* pName) {
Expand All @@ -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;
}
}

0 comments on commit 19d6c79

Please sign in to comment.