summaryrefslogtreecommitdiff
path: root/src/d/d_ovlp_fade3.cpp
blob: af2d6af354bc7be9ef4c4a9e7ad006c5ebb62645 (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
100
101
102
103
104
105
106
107
108
109
110
//
// Generated by dtk
// Translation Unit: d_ovlp_fade3.cpp
//

#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_ovlp_fade3.h"
#include "d/d_drawlist.h"
#include "f_op/f_op_overlap.h"
#include "f_op/f_op_overlap_mng.h"
#include "m_Do/m_Do_graphic.h"
#include "dolphin/gx/GX.h"

/* 8022433C-80224390       .text draw__16dDlst_snapShot_cFv */
void dDlst_snapShot_c::draw() {
    GXSetTexCopySrc(0, 0, 640, 480);
    GXSetTexCopyDst(320, 240, GX_TF_RGBA8, GX_TRUE);
    GXCopyTex(mDoGph_gInf_c::getFrameBufferTex(), GX_FALSE);
    GXPixModeSync();
}

#if VERSION <= VERSION_JPN
dOvlpFd3_c::dOvlpFd3_c() {
    setExecute(&dOvlpFd3_c::execFirstSnap);

    JKRArchive* menu_archive = dComIfGp_getMenuArchive();
    ResTIMG* texture = (ResTIMG*)JKRArchive::getGlbResource('TIMG', "wipe_00.bti", menu_archive);
    JUT_ASSERT(81, texture != 0);
    field_0xdc.init(texture, -9.0f, -21.0f, 659.0f, 524.0f, 0, 1, 1, 2.0f, 2.436f);
    field_0x120.init(mDoGph_gInf_c::getFrameBufferTimg(), -9.0f, -21.0f, 659.0f, 524.0f, 1, 0, 0, 1.0f, 1.0f);
}

BOOL dOvlpFd3_c::execFirstSnap() {
    if (field_0x164 != 0) {
        setExecute(&dOvlpFd3_c::execFadeOut);
        fopOvlpM_Done(this);

        dComIfGp_setWindowNum(0);
    }
    
    return TRUE;
}

BOOL dOvlpFd3_c::execFadeOut() {
    dComIfGp_setWindowNum(0);

    cLib_chaseF(field_0xdc.getScaleX_p(), 0.0f, 0.05f);
    field_0xdc.setScaleY(field_0xdc.getScaleX() * 1.218f);

    return TRUE;
}

BOOL dOvlpFd3_c::draw() {
    if (field_0x164 == 0) {
        dComIfGd_set2DXlu(&mSnapshot_c);
        field_0x164 = 1;
    }
    dComIfGd_set2DXlu(&field_0x120);
    dComIfGd_set2DXlu(&field_0xdc);
    return TRUE;
}

static BOOL dOvlpFd3_Draw(dOvlpFd3_c* i_this) {
    return i_this->draw();
}

BOOL dOvlpFd3_c::execute() {
    return (this->*mExecuteFn)();
}

static BOOL dOvlpFd3_Execute(dOvlpFd3_c* i_this) {
    return i_this->execute();
}

static BOOL dOvlpFd3_IsDelete(dOvlpFd3_c* i_this) {
    return TRUE;
}

static BOOL dOvlpFd3_Delete(dOvlpFd3_c* i_this) {
    return TRUE;
}

static cPhs_State dOvlpFd3_Create(void* i_this) {
    overlap_task_class* ovlp = (overlap_task_class*)i_this;
    new (ovlp) dOvlpFd3_c();
    return cPhs_COMPLEATE_e;
}

static overlap_method_class l_dOvlpFd3_Method = {
    (process_method_func)dOvlpFd3_Create,
    (process_method_func)dOvlpFd3_Delete,
    (process_method_func)dOvlpFd3_Execute,
    (process_method_func)dOvlpFd3_IsDelete,
    (process_method_func)dOvlpFd3_Draw,
};

overlap_process_profile_definition g_profile_OVERLAP3 = {
    /* Layer ID    */ fpcLy_ROOT_e,
    /* List ID     */ 2,
    /* List Prio   */ fpcPi_CURRENT_e,
    /* Proc Name   */ fpcNm_OVERLAP3_e,
    /* Proc SubMtd */ &g_fpcLf_Method.base,
    /* Size        */ sizeof(dOvlpFd3_c),
    /* Size Other  */ 0,
    /* Parameters  */ 0,
    /* Leaf SubMtd */ &g_fopOvlp_Method,
    /* Draw Prio   */ fpcDwPi_OVERLAP3_e,
    /* Fade SubMtd */ &l_dOvlpFd3_Method,
};
#endif