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 []
 
Gfx * D_E007C510 []
 

Function Documentation

◆ blast_init()

void blast_init ( EffectInstance * effect)

Definition at line 65 of file blast.c.

65 {
66}

Referenced by blast_main().

◆ blast_update()

void blast_update ( EffectInstance * effect)

Definition at line 68 of file blast.c.

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

Referenced by blast_main().

◆ blast_render()

void blast_render ( EffectInstance * effect)

Definition at line 82 of file blast.c.

82 {
83 RenderTask renderTask;
84 RenderTask* retTask;
85
86 renderTask.appendGfx = blast_appendGfx;
87 renderTask.appendGfxArg = effect;
88 renderTask.dist = 0;
90
91 retTask = queue_render_task(&renderTask);
93}
void blast_appendGfx(void *effect)
Definition blast.c:95
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_PASS_THROUGH
Definition enums.h:3306
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by blast_main().

◆ blast_appendGfx()

void blast_appendGfx ( void * effect)

Definition at line 95 of file blast.c.

95 {
96 Matrix4f sp18;
97 Matrix4f sp58;
98 Matrix4f sp98;
99 Gfx* dlist = D_090017B0_37F180;
100 BlastFXData* data = ((EffectInstance*) effect)->data.blast;
101 s32 unk_20 = data->unk_20;
102 f32 t = 256.0f;
103 s32 envAlpha = (data->unk_20 - unk_20) * t;
104
105 gDPPipeSync(gMainGfxPos++);
106 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
107 gSPDisplayList(gMainGfxPos++, D_09001300_37ECD0);
108 gSPDisplayList(gMainGfxPos++, D_E007C510[unk_20]);
109
110 guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
111 guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f);
112 guMtxCatF(sp58, sp18, sp98);
113 guScaleF(sp18, data->unk_10, data->unk_10, 1.0f);
114 guMtxCatF(sp18, sp98, sp98);
115 guRotateF(sp18, data->unk_24, 0.0f, 0.0f, 1.0f);
116 guMtxCatF(sp18, sp98, sp98);
118
120 G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
121
122 if (data->unk_20 > 4.0f) {
123 gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, 127);
124 } else {
125 gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 128, 127);
126 }
127 t = !(s32)t; // required to match
128 gDPSetEnvColor(gMainGfxPos++, 255, 255, 139, envAlpha);
129
130 gSPDisplayList(gMainGfxPos++, dlist);
131 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
132}
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:47
Camera gCameras[4]
Definition cam_main.c:17
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
s32 gCurrentCameraID
Definition cam_math.c:4
DisplayContext * gDisplayContext
Definition cam_main.c:16

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 {
29 EffectBlueprint* bpPtr = &bp;
30 EffectInstance* effect;
31 BlastFXData* part;
32 s32 numParts = 1;
33 s32 randInt;
34
35 bp.init = blast_init;
38 bp.unk_00 = 0;
39 bp.renderUI = NULL;
40 bp.effectID = EFFECT_BLAST;
41
42 effect = create_effect_instance(bpPtr);
43 effect->numParts = numParts;
44
45 part = effect->data.blast = general_heap_malloc(numParts * sizeof(*part));
46
47 ASSERT(effect->data.blast != NULL);
48
49 mem_clear(part, numParts * sizeof(*part));
50
51 part->timeLeft = arg5;
52 part->unk_18 = 0;
53 part->unk_1C = arg5;
54 part->unk_20 = 0;
55 part->unk_00 = arg0;
56 part->pos.x = arg1;
57 part->pos.y = arg2;
58 part->pos.z = arg3;
59 part->unk_10 = arg4;
60 part->unk_24 = 0;
61
62 part->unk_28 = arg0 == 0 ? 0 : 40.0;
63}
void blast_update(EffectInstance *effect)
Definition blast.c:68
void blast_render(EffectInstance *effect)
Definition blast.c:82
void blast_init(EffectInstance *effect)
Definition blast.c:65
#define general_heap_malloc
#define create_effect_instance
#define mem_clear
#define ASSERT(condition)
void(* renderUI)(EffectInstance *effectInst)
Definition effects.h:2655
void(* init)(EffectInstance *effectInst)
Definition effects.h:2652
void(* update)(EffectInstance *effectInst)
Definition effects.h:2653
void(* renderWorld)(EffectInstance *effectInst)
Definition effects.h:2654

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().