summaryrefslogtreecommitdiff
path: root/src/f_op/f_op_kankyo.cpp
blob: 31d17457c57c3881ad18520e2cec2ccce4a02ec1 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//
// Generated by dtk
// Translation Unit: f_op_kankyo.cpp
//

#include "f_op/f_op_kankyo.h"
#include "f_op/f_op_draw_tag.h"
#include "f_op/f_op_kankyo_mng.h"
#include "f_pc/f_pc_manager.h"
#include "d/d_meter.h"
#include "d/d_s_play.h"

/* 8002A454-8002A4A4       .text fopKy_Draw__FPv */
static BOOL fopKy_Draw(void* i_ky) {
    BOOL ret;
    kankyo_class* i_this = (kankyo_class*)i_ky;

    if (!dMenu_flag()) {
        ret = fpcLf_DrawMethod((leafdraw_method_class*)i_this->sub_method, i_this);
    }

    return ret;
}

/* 8002A4A4-8002A514       .text fopKy_Execute__FPv */
static BOOL fopKy_Execute(void* i_ky) {
    BOOL ret;
    kankyo_class* i_this = (kankyo_class*)i_ky;

    if (!dScnPly_ply_c::isPause() && (!dMenu_flag() || fpcM_GetName(i_ky) == fpcNm_ENVSE_e || fpcM_GetName(i_ky) == fpcNm_LEVEL_SE_e)) {
        ret = fpcMtd_Execute((process_method_class*)i_this->sub_method, i_ky);
    }

    return ret;
}

/* 8002A514-8002A568       .text fopKy_IsDelete__FPv */
static BOOL fopKy_IsDelete(void* i_ky) {
    BOOL ret;
    kankyo_class* i_this = (kankyo_class*)i_ky;

    ret = fpcMtd_IsDelete((process_method_class*)i_this->sub_method, i_this);
    if (ret == 1) {
        fopDwTg_DrawQTo(&i_this->draw_tag);
    }

    return ret;
}

/* 8002A568-8002A5B4       .text fopKy_Delete__FPv */
static BOOL fopKy_Delete(void* i_ky) {
    kankyo_class* i_this = (kankyo_class*)i_ky;

    BOOL ret = fpcMtd_Delete((process_method_class*)i_this->sub_method, i_this);
    fopDwTg_DrawQTo(&i_this->draw_tag);

    return ret;
}

static int fopKy_KANKYO_TYPE;

/* 8002A5B4-8002A688       .text fopKy_Create__FPv */
static cPhs_State fopKy_Create(void* i_ky) {
    kankyo_class* i_this = (kankyo_class*)i_ky;

    if (fpcM_IsFirstCreating(i_ky)) {
        kankyo_process_profile_definition* profile = (kankyo_process_profile_definition*)fpcM_GetProfile(i_ky);

        i_this->mBsType = fpcBs_MakeOfType(&fopKy_KANKYO_TYPE);
        i_this->sub_method = profile->sub_method;

        fopDwTg_Init(&i_this->draw_tag, i_this);
        fopKyM_prm_class* append = fopKyM_GetAppend(i_this);

        if (append != NULL) {
            i_this->mPos = append->mPos;
            i_this->mScale = append->mScale;
            i_this->mParam = append->mParam;
        }
    }

    cPhs_State ret = fpcMtd_Create((process_method_class*)i_this->sub_method, i_this);
    if (ret == cPhs_COMPLEATE_e) {
        s32 priority = fpcM_DrawPriority(i_this);
        fopDwTg_ToDrawQ(&i_this->draw_tag, priority);
    }

    return ret;
}

leafdraw_method_class g_fopKy_Method = {
    (process_method_func)fopKy_Create,
    (process_method_func)fopKy_Delete,
    (process_method_func)fopKy_Execute,
    (process_method_func)fopKy_IsDelete,
    (process_method_func)fopKy_Draw,
};