summaryrefslogtreecommitdiff
path: root/src/f_op/f_op_kankyo.cpp
blob: 7c80ae7532e5307f4183d517fe05945f3577f789 (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
98
99
/**
 * f_op_kankyo.cpp
 * Environment process framework
 */

#include "f_op/f_op_kankyo.h"
#include "d/com/d_com_inf_game.h"
#include "d/s/d_s_play.h"
#include "f_op/f_op_draw_tag.h"
#include "f_op/f_op_kankyo_mng.h"

/* 8001F284-8001F2C0 019BC4 003C+00 1/0 0/0 0/0 .text            fopKy_Draw__FPv */
static int fopKy_Draw(void* i_this) {
    int ret;
    kankyo_class* _this = (kankyo_class*)i_this;

    if (!dComIfGp_isPauseFlag()) {
        ret = fpcLf_DrawMethod(_this->sub_method, i_this);
    }

    return ret;
}

/* 8001F2C0-8001F314 019C00 0054+00 1/0 0/0 0/0 .text            fopKy_Execute__FPv */
static int fopKy_Execute(void* i_this) {
    int ret;
    kankyo_class* _this = (kankyo_class*)i_this;

    if (dScnPly_c::isPause() && (!dComIfGp_isPauseFlag() || fpcM_GetName(i_this) == PROC_ENVSE)) {
        ret = fpcMtd_Execute(&_this->sub_method->mBase, i_this);
    }

    return ret;
}

/* 8001F314-8001F368 019C54 0054+00 1/0 0/0 0/0 .text            fopKy_IsDelete__FPv */
static int fopKy_IsDelete(void* i_this) {
    int ret;
    kankyo_class* _this = (kankyo_class*)i_this;

    ret = fpcMtd_IsDelete(&_this->sub_method->mBase, _this);
    if (ret == 1) {
        fopDwTg_DrawQTo(&_this->draw_tag);
    }

    return ret;
}

/* 8001F368-8001F3B4 019CA8 004C+00 1/0 0/0 0/0 .text            fopKy_Delete__FPv */
static int fopKy_Delete(void* i_this) {
    kankyo_class* _this = (kankyo_class*)i_this;

    int ret = fpcMtd_Delete(&_this->sub_method->mBase, _this);
    fopDwTg_DrawQTo(&_this->draw_tag);

    return ret;
}

/* ############################################################################################## */
/* 80450CE8-80450CF0 0001E8 0004+04 1/1 0/0 0/0 .sbss            fopKy_KANKYO_TYPE */
static int fopKy_KANKYO_TYPE;

/* 8001F3B4-8001F488 019CF4 00D4+00 1/0 0/0 0/0 .text            fopKy_Create__FPv */
static int fopKy_Create(void* i_this) {
    kankyo_class* _this = (kankyo_class*)i_this;

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

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

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

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

    int ret = fpcMtd_Create(&_this->sub_method->mBase, _this);
    if (ret == cPhs_COMPLEATE_e) {
        s32 priority = fpcLf_GetPriority(_this);
        fopDwTg_ToDrawQ(&_this->draw_tag, priority);
    }

    return ret;
}

/* ############################################################################################## */
/* 803A3940-803A3958 -00001 0014+04 0/0 7/0 0/0 .data            g_fopKy_Method */
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,
};