summaryrefslogtreecommitdiff
path: root/src/d/actor/d_a_spotbox.cpp
blob: f7d885478c6ef77a8fdfdcd572f9ec5650688b8b (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
//
// Generated by dtk
// Translation Unit: d_a_spotbox.cpp
//

#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_spotbox.h"
#include "f_op/f_op_actor_mng.h"
#include "d/d_com_inf_game.h"
#include "m_Do/m_Do_mtx.h"

cPhs_State daSpotbox_c::create() {
    fopAcM_ct(this, daSpotbox_c);
    f32 baseScale = getType() != 0 ? 1000.0f : 100.0f;
    scale.x *= baseScale;
    scale.y *= baseScale;
    scale.z *= (baseScale * 1.2f);
    current.pos.y += scale.y * 0.5f;
    fopAcM_SetMtx(this, mMtx);
    fopAcM_setCullSizeBox(this, -0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f);

    return cPhs_COMPLEATE_e;
}

BOOL daSpotbox_c::draw() {
    if (dComIfGd_getSpotModelNum() != 0) {
        dComIfGd_setSpotModel(dDlst_alphaModel_c::TYPE_CUBE, mMtx, 0x20);
    }
    return TRUE;
}

BOOL daSpotbox_c::execute() {
    mDoMtx_stack_c::transS(current.pos);
    mDoMtx_stack_c::YrotM(current.angle.y);
    mDoMtx_stack_c::scaleM(scale);
    cMtx_copy(mDoMtx_stack_c::get(), mMtx);
    return TRUE;
}

/* 00000078-000000C4       .text daSpotbox_Draw__FP11daSpotbox_c */
static BOOL daSpotbox_Draw(daSpotbox_c* i_this) {
    return ((daSpotbox_c*)i_this)->draw();
}

/* 000000C4-00000138       .text daSpotbox_Execute__FP11daSpotbox_c */
static BOOL daSpotbox_Execute(daSpotbox_c* i_this) {
    return ((daSpotbox_c*)i_this)->execute();
}

/* 00000138-00000140       .text daSpotbox_IsDelete__FP11daSpotbox_c */
static BOOL daSpotbox_IsDelete(daSpotbox_c* i_this) {
    return TRUE;
}

/* 00000140-00000170       .text daSpotbox_Delete__FP11daSpotbox_c */
static BOOL daSpotbox_Delete(daSpotbox_c* i_this) {
    i_this->~daSpotbox_c();
    return true;
}

/* 00000170-00000250       .text daSpotbox_Create__FP10fopAc_ac_c */
static cPhs_State daSpotbox_Create(fopAc_ac_c* i_this) {
    daSpotbox_c* a_this = (daSpotbox_c*)i_this;
    return a_this->create();
}

static actor_method_class l_daSpotbox_Method = {
    (process_method_func)daSpotbox_Create,
    (process_method_func)daSpotbox_Delete,
    (process_method_func)daSpotbox_Execute,
    (process_method_func)daSpotbox_IsDelete,
    (process_method_func)daSpotbox_Draw,
};

actor_process_profile_definition g_profile_SPOTBOX = {
    /* Layer ID     */ fpcLy_CURRENT_e,
    /* List ID      */ 0x0007,
    /* List Prio    */ fpcPi_CURRENT_e,
    /* Proc Name    */ fpcNm_SPOTBOX_e,
    /* Proc SubMtd  */ &g_fpcLf_Method.base,
    /* Size         */ sizeof(daSpotbox_c),
    /* Size Other   */ 0,
    /* Parameters   */ 0,
    /* Leaf SubMtd  */ &g_fopAc_Method.base,
    /* Draw Prio    */ fpcDwPi_SPOTBOX_e,
    /* Actor SubMtd */ &l_daSpotbox_Method,
#if VERSION == VERSION_DEMO
    /* Status       */ fopAcStts_NOCULLEXEC_e | fopAcStts_CULL_e | fopAcStts_UNK40000_e,
#else
    /* Status       */ fopAcStts_NOCULLEXEC_e | fopAcStts_CULL_e | fopAcStts_UNK4000_e | fopAcStts_UNK40000_e,
#endif
    /* Group        */ fopAc_ACTOR_e,
    /* Cull Type    */ fopAc_CULLBOX_CUSTOM_e,
};