Files
dusklight/src/f/f_pc/f_pc_leaf.cpp
T
lepelog 5ffa0945b0 A few f_pc files (#26)
* f_pc_base, one non matching

* some of f_pc_manager

* f_pc_node OK

* f_pc_pause partly

* started node_req

* more progress

* most of node req

* delete unused asm

* node req header and param names

* param renaming

* header for manager

* review comment struct names

* fpcM_Management OK

* int -> s32

* merge master

* most of f_pc_create_iter

* f_pc_stdcreate_req OK

* f_pc_fstcreate OK

* f_pc_leaf OK

* f_pc_draw OK

* f_pc_deletor partly

* fix parameter type in f_pc_pause

* review

* review, use cPh enum and fix process_profile_definition struct

* convert f_pc files to C

* matched more functions

* fix global.h

* fix variable types

* format

* mpre Phs enum

* fix merge errors

* fix gamepad stopPatternedRumble

* format

* delete leftover files from merge

* move asm to correct folder

* revert f_pc from C to CPP

* remove C hacks and format

* format

* OK
2020-12-31 15:12:29 -05:00

51 lines
1.3 KiB
C++

#include "f/f_pc/f_pc_leaf.h"
#include "dolphin/types.h"
// f_pc_leaf::g_fpcLf_type
extern s32 lbl_80450D30;
extern "C" {
s32 fpcLf_GetPriority(leafdraw_class* pLeaf) {
return fpcDwPi_Get(&pLeaf->mDwPi);
}
s32 fpcLf_DrawMethod(leafdraw_method_class* pMthd, void* pUserData) {
return fpcMtd_Method(pMthd->mpDrawFunc, pUserData);
}
s32 fpcLf_Draw(leafdraw_class* pLeaf) {
s32 ret = 0;
if (pLeaf->mbUnk0 == 0)
ret = fpcLf_DrawMethod(pLeaf->mpDrawMtd, pLeaf);
return ret;
}
s32 fpcLf_Execute(leafdraw_class* pLeaf) {
return fpcMtd_Execute(&pLeaf->mpDrawMtd->mBase, pLeaf);
}
s32 fpcLf_IsDelete(leafdraw_class* pLeaf) {
return fpcMtd_IsDelete(&pLeaf->mpDrawMtd->mBase, pLeaf);
}
s32 fpcLf_Delete(leafdraw_class* pLeaf) {
s32 ret = fpcMtd_Delete(&pLeaf->mpDrawMtd->mBase, pLeaf);
if (ret == 1) {
pLeaf->mBase.mSubType = 0;
}
return ret;
}
s32 fpcLf_Create(leafdraw_class* pLeaf) {
leaf_process_profile_definition* profDef;
if (pLeaf->mBase.mInitState == 0) {
profDef = (leaf_process_profile_definition*)pLeaf->mBase.mpProf;
pLeaf->mpDrawMtd = profDef->mLfDrwMth;
pLeaf->mBase.mSubType = fpcBs_MakeOfType(&lbl_80450D30);
fpcDwPi_Init(&pLeaf->mDwPi, profDef->unk20);
pLeaf->mbUnk0 = 0;
}
return fpcMtd_Create(&pLeaf->mpDrawMtd->mBase, pLeaf);
}
}