Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
blast.c File Reference

Go to the source code of this file.

Functions

void blast_init (EffectInstance *effect)
 
void blast_update (EffectInstance *effect)
 
void blast_render (EffectInstance *effect)
 
void blast_appendGfx (void *effect)
 
void blast_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 

Variables

Gfx D_09001300_37ECD0 []
 
Gfx D_09001378_37ED48 []
 
Gfx D_090013F0_37EDC0 []
 
Gfx D_09001468_37EE38 []
 
Gfx D_090014E0_37EEB0 []
 
Gfx D_09001558_37EF28 []
 
Gfx D_090015D0_37EFA0 []
 
Gfx D_09001648_37F018 []
 
Gfx D_090016C0_37F090 []
 
Gfx D_09001738_37F108 []
 
Gfx D_090017B0_37F180 []
 
GfxD_E007C510 []
 

Function Documentation

◆ blast_init()

void blast_init ( EffectInstance * effect)

Definition at line 64 of file blast.c.

64 {
65}

Referenced by blast_main().

◆ blast_update()

void blast_update ( EffectInstance * effect)

Definition at line 67 of file blast.c.

67 {
68 BlastFXData* part = effect->data.blast;
69
70 part->unk_20 = part->unk_18++ * 9.0f / part->unk_1C;
71 part->timeLeft--;
72
73 if (part->timeLeft < 0) {
74 remove_effect(effect);
75 return;
76 }
77
78 part->unk_24 += part->unk_28;
79}
BSS s32 PopupMenu_SelectedIndex
#define remove_effect
EffectInstanceDataPtr data
Definition effects.h:2605
struct BlastFXData * blast
Definition effects.h:2526

Referenced by blast_main().

◆ blast_render()

void blast_render ( EffectInstance * effect)

Definition at line 81 of file blast.c.

81 {
84
86 renderTask.appendGfxArg = effect;
87 renderTask.dist = 0;
89
92}
void blast_appendGfx(void *effect)
Definition blast.c:94
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3352
@ RENDER_MODE_PASS_THROUGH
Definition enums.h:3340
void(* appendGfx)(void *)

Referenced by blast_main().

◆ blast_appendGfx()

void blast_appendGfx ( void * effect)

Definition at line 94 of file blast.c.

94 {
98 Gfx* dlist = D_090017B0_37F180;
99 BlastFXData* data = ((EffectInstance*) effect)->data.blast;
100 s32 unk_20 = data->unk_20;
101 f32 t = 256.0f;
102 s32 envAlpha = (data->unk_20 - unk_20) * t;
103
105 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->shared->graphics));
108
109 guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
110 guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f);
112 guScaleF(sp18, data->unk_10, data->unk_10, 1.0f);
114 guRotateF(sp18, data->unk_24, 0.0f, 0.0f, 1.0f);
117
120
121 if (data->unk_20 > 4.0f) {
122 gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, 127);
123 } else {
124 gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 128, 127);
125 }
126 t = !(s32)t; // required to match
127 gDPSetEnvColor(gMainGfxPos++, 255, 255, 139, envAlpha);
128
129 gSPDisplayList(gMainGfxPos++, dlist);
131}
Gfx * D_E007C510[]
Definition blast.c:21
Gfx D_090017B0_37F180[]
Gfx D_09001300_37ECD0[]
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
Vec3f pos
Definition effects.h:1062
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:46
Camera gCameras[4]
Definition cam_main.c:16
Gfx * gMainGfxPos
Definition cam_main.c:14
u16 gMatrixListPos
Definition main_loop.c:44
s32 gCurrentCameraID
Definition cam_math.c:5
DisplayContext * gDisplayContext
Definition cam_main.c:15

Referenced by blast_render().

◆ blast_main()

void blast_main ( s32 arg0,
f32 arg1,
f32 arg2,
f32 arg3,
f32 arg4,
s32 arg5 )

Definition at line 27 of file blast.c.

27 {
30 EffectInstance* effect;
32 s32 numParts = 1;
33
34 bp.init = blast_init;
35 bp.update = blast_update;
36 bp.renderScene = blast_render;
37 bp.unk_00 = 0;
38 bp.renderUI = nullptr;
39 bp.effectID = EFFECT_BLAST;
40
42 effect->numParts = numParts;
43
44 part = effect->data.blast = general_heap_malloc(numParts * sizeof(*part));
45
46 ASSERT(effect->data.blast != nullptr);
47
48 mem_clear(part, numParts * sizeof(*part));
49
50 part->timeLeft = arg5;
51 part->unk_18 = 0;
52 part->unk_1C = arg5;
53 part->unk_20 = 0;
54 part->unk_00 = arg0;
55 part->pos.x = arg1;
56 part->pos.y = arg2;
57 part->pos.z = arg3;
58 part->unk_10 = arg4;
59 part->unk_24 = 0;
60
61 part->unk_28 = arg0 == 0 ? 0 : 40.0;
62}
void blast_update(EffectInstance *effect)
Definition blast.c:67
void blast_render(EffectInstance *effect)
Definition blast.c:81
void blast_init(EffectInstance *effect)
Definition blast.c:64
#define general_heap_malloc
#define create_effect_instance
#define mem_clear
#define ASSERT(condition)

Variable Documentation

◆ D_09001300_37ECD0

Gfx D_09001300_37ECD0[]
extern

Referenced by blast_appendGfx().

◆ D_09001378_37ED48

Gfx D_09001378_37ED48[]
extern

◆ D_090013F0_37EDC0

Gfx D_090013F0_37EDC0[]
extern

◆ D_09001468_37EE38

Gfx D_09001468_37EE38[]
extern

◆ D_090014E0_37EEB0

Gfx D_090014E0_37EEB0[]
extern

◆ D_09001558_37EF28

Gfx D_09001558_37EF28[]
extern

◆ D_090015D0_37EFA0

Gfx D_090015D0_37EFA0[]
extern

◆ D_09001648_37F018

Gfx D_09001648_37F018[]
extern

◆ D_090016C0_37F090

Gfx D_090016C0_37F090[]
extern

◆ D_09001738_37F108

Gfx D_09001738_37F108[]
extern

◆ D_090017B0_37F180

Gfx D_090017B0_37F180[]
extern

Referenced by blast_appendGfx().

◆ D_E007C510

Gfx* D_E007C510[]
Initial value:
= {
}
Gfx D_09001738_37F108[]
Gfx D_09001468_37EE38[]
Gfx D_09001378_37ED48[]
Gfx D_090016C0_37F090[]
Gfx D_090015D0_37EFA0[]
Gfx D_09001648_37F018[]
Gfx D_090014E0_37EEB0[]
Gfx D_09001558_37EF28[]
Gfx D_090013F0_37EDC0[]

Definition at line 21 of file blast.c.

Referenced by blast_appendGfx().