summaryrefslogtreecommitdiff
path: root/src/d/actor/d_a_skip_2D.cpp
blob: c95ea2694d56eee4cec415bf2d778533364b4c0d (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
/**
 * d_a_skip2D.cpp
 *
 */

#include "d/dolzel_rel.h" // IWYU pragma: keep

#include "d/actor/d_a_skip_2D.h"
#include "d/d_meter_button.h"
#include "f_op/f_op_actor_mng.h"

static int daSkip2D_createHeap(fopAc_ac_c* i_this) {
    return static_cast<daSkip2D_c*>(i_this)->createHeap();
}

int daSkip2D_c::createHeap() {
    mpButton = new dMeterButton_c();

    if (mpButton == NULL) {
        return 0;
    }

    return 1;
}

int daSkip2D_c::create() {
    fopAcM_ct(this, daSkip2D_c);

    if (!fopAcM_entrySolidHeap(this, daSkip2D_createHeap, 0)) {
        return cPhs_ERROR_e;
    }

    return cPhs_COMPLEATE_e;
}

int daSkip2D_c::destroy() {
    return 1;
}

int daSkip2D_c::draw() {
    dComIfGd_set2DOpaTop((dDlst_base_c*)&mpButton);  // ???
    return 1;
}

int daSkip2D_c::execute() {
    return 1;
}

void daSkip2D_c::initiate() {
    field_0x56c = 0;
    mpButton = NULL;
    field_0x574 = 0;
}

static int daSkip2D_Create(void* i_this) {
    return static_cast<daSkip2D_c*>(i_this)->create();
}

static int daSkip2D_Delete(void* i_this) {
    return static_cast<daSkip2D_c*>(i_this)->destroy();
}

static int daSkip2D_Execute(void* i_this) {
    return static_cast<daSkip2D_c*>(i_this)->execute();
}

static int daSkip2D_Draw(void* i_this) {
    return static_cast<daSkip2D_c*>(i_this)->draw();
}

static int daSkip2D_IsDelete(void*) {
    return 1;
}

static actor_method_class daSkip2D_MethodTable = {
    (process_method_func)daSkip2D_Create,  (process_method_func)daSkip2D_Delete,
    (process_method_func)daSkip2D_Execute, (process_method_func)daSkip2D_IsDelete,
    (process_method_func)daSkip2D_Draw,
};

actor_process_profile_definition g_profile_SKIP2D = {
    /* Layer ID     */ fpcLy_CURRENT_e,
    /* List ID      */ 3,
    /* List Prio    */ fpcPi_CURRENT_e,
    /* Proc Name    */ fpcNm_SKIP2D_e,
    /* Proc SubMtd  */ &g_fpcLf_Method.base,
    /* Size         */ sizeof(daSkip2D_c),
    /* Size Other   */ 0,
    /* Parameters   */ 0,
    /* Leaf SubMtd  */ &g_fopAc_Method.base,
    /* Draw Prio    */ fpcDwPi_SKIP2D_e,
    /* Actor SubMtd */ &daSkip2D_MethodTable,
    /* Status       */ fopAcStts_UNK_0x40000_e,
    /* Group        */ fopAc_ACTOR_e,
    /* Cull Type    */ fopAc_CULLBOX_0_e,
};