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

Go to the source code of this file.

Functions

void steam_burst_init (EffectInstance *effect)
 
void steam_burst_update (EffectInstance *effect)
 
void steam_burst_render (EffectInstance *effect)
 
void steam_burst_appendGfx (void *effect)
 
void steam_burst_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 

Variables

Gfx D_09000E00_362470 []
 
Gfx D_09000F30_3625A0 []
 
Gfx * D_E005C700 [] = { D_09000F30_3625A0 }
 
Gfx * D_E005C704 [] = { D_09000E00_362470 }
 

Function Documentation

◆ steam_burst_init()

void steam_burst_init ( EffectInstance * effect)

Definition at line 67 of file steam_burst.c.

67 {
68}

Referenced by steam_burst_main().

◆ steam_burst_update()

void steam_burst_update ( EffectInstance * effect)

Definition at line 70 of file steam_burst.c.

70 {
71 SteamBurstFXData* part = effect->data.steamBurst;
72 f32 unk_1C;
73 s32 i;
74
75 part->unk_30 = part->unk_28 * 7.0f / part->unk_2C;
76 part->unk_28++;
77 part->unk_24--;
78
79 if (part->unk_24 < 0) {
80 remove_effect(effect);
81 return;
82 }
83
84 part->unk_1C += (part->unk_20 - part->unk_1C) * 0.1;
85 unk_1C = part->unk_1C;
86
87 part++;
88 for (i = 1; i < effect->numParts; i++, part++) {
89 part->unk_14 += 0.04;
90 part->unk_14 *= 0.9;
91 part->unk_04 = unk_1C * part->unk_10;
92 part->unk_08 += part->unk_14;
93 part->unk_0C = unk_1C * part->unk_18;
94 }
95}
#define remove_effect
struct SteamBurstFXData * steamBurst
Definition effects.h:2510
EffectData data
Definition effects.h:2605

Referenced by steam_burst_main().

◆ steam_burst_render()

void steam_burst_render ( EffectInstance * effect)

Definition at line 97 of file steam_burst.c.

97 {
98 RenderTask renderTask;
99 RenderTask* retTask;
100
101 renderTask.appendGfx = steam_burst_appendGfx;
102 renderTask.appendGfxArg = effect;
103 renderTask.dist = 0;
105
106 retTask = queue_render_task(&renderTask);
108}
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_PASS_THROUGH
Definition enums.h:3306
void steam_burst_appendGfx(void *effect)
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by steam_burst_main().

◆ steam_burst_appendGfx()

void steam_burst_appendGfx ( void * effect)

Definition at line 110 of file steam_burst.c.

110 {
111 SteamBurstFXData* part = ((EffectInstance*)effect)->data.steamBurst;
112 s32 unk_30_s32 = part->unk_30;
113 s32 envAlpha = (part->unk_30 - unk_30_s32) * 256.0f;
114 s32 cond = (unk_30_s32 == 6);
115 Gfx* dlist = D_E005C700[part->unk_00];
116 Gfx* dlist2 = D_E005C704[part->unk_00];
117 Matrix4f sp18;
118 Matrix4f sp58;
119 Matrix4f sp98;
120 s32 i;
121
122 gDPPipeSync(gMainGfxPos++);
123 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
124 gSPDisplayList(gMainGfxPos++, dlist2);
125
126 guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
127 guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f);
128 guMtxCatF(sp58, sp18, sp98);
130
131 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
132 gDPSetPrimColor(gMainGfxPos++, 0, 0, 230, 222, 222, 130);
133 gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, envAlpha);
134 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE,
135 (unk_30_s32 * 32 ) * 4, 0,
136 (unk_30_s32 * 32 + 32) * 4, 32 * 4);
137
138 if (cond) {
139 gDPSetTileSize(gMainGfxPos++, 1,
140 (unk_30_s32 * 32 + 32) * 4, 32 * 4,
141 (unk_30_s32 * 32 + 64) * 4, 64 * 4);
142 } else {
143 gDPSetTileSize(gMainGfxPos++, 1,
144 (unk_30_s32 * 32 + 32) * 4, 0,
145 (unk_30_s32 * 32 + 64) * 4, 32 * 4);
146 }
147
148 part++;
149 for (i = 1; i < ((EffectInstance*)effect)->numParts; i++, part++) {
150 guTranslateF(sp18, part->unk_04, part->unk_08, part->unk_0C);
152
153 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
154 gSPDisplayList(gMainGfxPos++, dlist);
155 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
156 }
157
158 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
159}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
Gfx * D_E005C704[]
Definition steam_burst.c:8
Gfx * D_E005C700[]
Definition steam_burst.c:7
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 steam_burst_render().

◆ steam_burst_main()

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

Definition at line 15 of file steam_burst.c.

22 {
24 EffectInstance* effect;
25 SteamBurstFXData* part;
26 s32 numParts = 2;
27 s32 i;
28
32 bp.unk_00 = 0;
33 bp.renderUI = NULL;
34 bp.effectID = EFFECT_STEAM_BURST;
35
36 effect = create_effect_instance(&bp);
37 effect->numParts = numParts;
38 part = effect->data.steamBurst = general_heap_malloc(numParts * sizeof(*part));
39 ASSERT(effect->data.steamBurst != NULL);
40
41 mem_clear(part, numParts * sizeof(*part));
42
43 part->unk_24 = arg5;
44 part->unk_28 = 0;
45 part->unk_2C = arg5;
46 part->unk_30 = 0;
47 part->unk_00 = arg0;
48 part->unk_04 = arg1;
49 part->unk_08 = arg2;
50 part->unk_0C = arg3;
51 part->unk_1C = 10.0f;
52 part->unk_20 = 30.0f;
53
54 part++;
55 for (i = 1; i < numParts; i++, part++) {
56 f32 zero = 0.0f;
57
58 part->unk_04 = zero;
59 part->unk_08 = zero;
60 part->unk_0C = zero;
61 part->unk_10 = sin_deg(0.0f);
62 part->unk_14 = 0.0f;
63 part->unk_18 = cos_deg(0.0f);
64 }
65}
#define general_heap_malloc
#define sin_deg
#define cos_deg
#define create_effect_instance
#define mem_clear
#define ASSERT(condition)
void steam_burst_render(EffectInstance *effect)
Definition steam_burst.c:97
void steam_burst_update(EffectInstance *effect)
Definition steam_burst.c:70
void steam_burst_init(EffectInstance *effect)
Definition steam_burst.c:67
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_09000E00_362470

Gfx D_09000E00_362470[]
extern

◆ D_09000F30_3625A0

Gfx D_09000F30_3625A0[]
extern

◆ D_E005C700

Gfx* D_E005C700[] = { D_09000F30_3625A0 }

Definition at line 7 of file steam_burst.c.

Gfx D_09000F30_3625A0[]

Referenced by steam_burst_appendGfx().

◆ D_E005C704

Gfx* D_E005C704[] = { D_09000E00_362470 }

Definition at line 8 of file steam_burst.c.

Gfx D_09000E00_362470[]

Referenced by steam_burst_appendGfx().