summaryrefslogtreecommitdiff
path: root/src/f_pc/f_pc_leaf.cpp
blob: 795ad160448ccfd46cdcbe726506e9714e324cc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
// Generated By: dol2asm
// Translation Unit: f_pc/f_pc_leaf
//

#include "f_pc/f_pc_leaf.h"
#include "dol2asm.h"
#include "dolphin/types.h"

//
// Declarations:
//

/* 80021A00-80021A24 0024+00 s=0 e=4 z=2  None .text      fpcLf_GetPriority__FPC14leafdraw_class */
s32 fpcLf_GetPriority(const leafdraw_class* pLeaf) {
    return fpcDwPi_Get(&pLeaf->mDwPi);
}

/* 80021A24-80021A48 0024+00 s=1 e=6 z=0  None .text fpcLf_DrawMethod__FP21leafdraw_method_classPv
 */
s32 fpcLf_DrawMethod(leafdraw_method_class* pMthd, void* pUserData) {
    return fpcMtd_Method(pMthd->mpDrawFunc, pUserData);
}

/* 80021A48-80021A80 0038+00 s=1 e=0 z=0  None .text      fpcLf_Draw__FP14leafdraw_class */
s32 fpcLf_Draw(leafdraw_class* pLeaf) {
    s32 ret = 0;
    if (pLeaf->mbUnk0 == 0)
        ret = fpcLf_DrawMethod(pLeaf->mpDrawMtd, pLeaf);
    return ret;
}

/* 80021A80-80021AA8 0028+00 s=1 e=0 z=0  None .text      fpcLf_Execute__FP14leafdraw_class */
s32 fpcLf_Execute(leafdraw_class* pLeaf) {
    return fpcMtd_Execute(&pLeaf->mpDrawMtd->mBase, pLeaf);
}

/* 80021AA8-80021AD0 0028+00 s=1 e=0 z=0  None .text      fpcLf_IsDelete__FP14leafdraw_class */
s32 fpcLf_IsDelete(leafdraw_class* pLeaf) {
    return fpcMtd_IsDelete(&pLeaf->mpDrawMtd->mBase, pLeaf);
}

/* 80021AD0-80021B14 0044+00 s=1 e=0 z=0  None .text      fpcLf_Delete__FP14leafdraw_class */
s32 fpcLf_Delete(leafdraw_class* pLeaf) {
    s32 ret = fpcMtd_Delete(&pLeaf->mpDrawMtd->mBase, pLeaf);
    if (ret == 1) {
        pLeaf->mBase.mSubType = 0;
    }
    return ret;
}

/* ############################################################################################## */
/* 80450D30-80450D38 0004+04 s=1 e=1 z=0  None .sbss      g_fpcLf_type */
int g_fpcLf_type;

/* 80021B14-80021B88 0074+00 s=1 e=0 z=0  None .text      fpcLf_Create__FP14leafdraw_class */
s32 fpcLf_Create(leafdraw_class* pLeaf) {
    process_profile_definition* profDef;
    if (pLeaf->mBase.mInitState == 0) {
        profDef = (process_profile_definition*)pLeaf->mBase.mpProf;
        pLeaf->mpDrawMtd = profDef->mLfDrwMth;
        pLeaf->mBase.mSubType = fpcBs_MakeOfType(&g_fpcLf_type);
        fpcDwPi_Init(&pLeaf->mDwPi, profDef->mPriority);
        pLeaf->mbUnk0 = 0;
    }
    return fpcMtd_Create(&pLeaf->mpDrawMtd->mBase, pLeaf);
}

/* ############################################################################################## */
/* 803A39E8-803A3A00 0014+04 s=0 e=27 z=756  None .data      g_fpcLf_Method */
leafdraw_method_class g_fpcLf_Method = {
    (process_method_func)fpcLf_Create,  (process_method_func)fpcLf_Delete,
    (process_method_func)fpcLf_Execute, (process_method_func)fpcLf_IsDelete,
    (process_method_func)fpcLf_Draw,
};