summaryrefslogtreecommitdiff
path: root/src/f_op/f_op_msg.cpp
blob: 59637aea2b110d3e71f3937737233a3cee330852 (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
/**
 * f_op_msg.cpp
 * Message Process Framework
 */

#include "f_op/f_op_msg.h"
#include "d/s/d_s_play.h"
#include "f_op/f_op_draw_tag.h"
#include "f_op/f_op_msg_mng.h"
#include "f_pc/f_pc_manager.h"

/* 8001F488-8001F4B0 019DC8 0028+00 1/0 0/0 0/0 .text            fopMsg_Draw__FPv */
static int fopMsg_Draw(void* i_this) {
    msg_class* _this = static_cast<msg_class*>(i_this);
    return fpcLf_DrawMethod(_this->sub_method, i_this);
}

/* 8001F4B0-8001F4E8 019DF0 0038+00 1/0 0/0 0/0 .text            fopMsg_Execute__FPv */
static int fopMsg_Execute(void* i_this) {
    msg_class* _this = static_cast<msg_class*>(i_this);

    int stat = 1;
    if (dScnPly_c::isPause()) {
        stat = fpcMtd_Execute(&_this->sub_method->mBase, i_this);
    }

    return stat;
}

/* 8001F4E8-8001F53C 019E28 0054+00 1/0 0/0 0/0 .text            fopMsg_IsDelete__FPv */
static int fopMsg_IsDelete(void* i_this) {
    msg_class* _this = static_cast<msg_class*>(i_this);

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

    return stat;
}

/* 8001F53C-8001F588 019E7C 004C+00 1/0 0/0 0/0 .text            fopMsg_Delete__FPv */
static int fopMsg_Delete(void* i_this) {
    msg_class* _this = static_cast<msg_class*>(i_this);

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

    return stat;
}

/* ############################################################################################## */
/* 80450CF0-80450CF8 0001F0 0004+04 1/1 0/0 0/0 .sbss            fopMsg_MSG_TYPE */
static int fopMsg_MSG_TYPE;

/* 8001F588-8001F660 019EC8 00D8+00 1/0 0/0 0/0 .text            fopMsg_Create__FPv */
int fopMsg_Create(void* i_this) {
    msg_class* _this = (msg_class*)i_this;

    if (fpcM_IsFirstCreating(_this)) {
        msg_process_profile_definition* profile =
            (msg_process_profile_definition*)fpcM_GetProfile(i_this);
        _this->mMsgType = fpcBs_MakeOfType(&fopMsg_MSG_TYPE);
        _this->sub_method = profile->sub_method;
        fopDwTg_Init(&_this->draw_tag, _this);
        fopMsg_prm_class* prm = fopMsgM_GetAppend(_this);
        if (prm != NULL) {
            _this->mpActor = prm->mpActor;
            _this->mPos = prm->mPos;
            _this->mMsgID = prm->mMsgID;
            _this->field_0xf0 = prm->field_0x14;
            _this->field_0xf4 = prm->field_0x18;
        }
    }

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

    return status;
}

/* ############################################################################################## */
/* 803A3958-803A3970 -00001 0014+04 0/0 5/0 0/0 .data            g_fopMsg_Method */
leafdraw_method_class g_fopMsg_Method = {
    (process_method_func)fopMsg_Create,  (process_method_func)fopMsg_Delete,
    (process_method_func)fopMsg_Execute, (process_method_func)fopMsg_IsDelete,
    (process_method_func)fopMsg_Draw,
};