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

Go to the source code of this file.

Functions

void energy_shockwave_init (EffectInstance *effect)
 
void energy_shockwave_update (EffectInstance *effect)
 
void energy_shockwave_render (EffectInstance *effect)
 
void energy_shockwave_appendGfx (void *effect)
 
void energy_shockwave_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 
 EFFECT_DEF_SHIMMER_WAVE (shimmer_wave_main)
 

Variables

Gfx D_09000DC0_3762D0 []
 
Gfx D_09000E60_376370 []
 

Function Documentation

◆ energy_shockwave_init()

void energy_shockwave_init ( EffectInstance * effect)

Definition at line 59 of file energy_shockwave.c.

59 {
60}

Referenced by energy_shockwave_main().

◆ energy_shockwave_update()

void energy_shockwave_update ( EffectInstance * effect)

Definition at line 64 of file energy_shockwave.c.

64 {
66 s32 unk_28;
67 s32 unk_2C;
68 f32 angle;
69
70 data->unk_28--;
71 data->unk_2C++;
72
73 unk_28 = data->unk_28;
74 unk_2C = data->unk_2C;
75
76 if (unk_28 < 0) {
77 remove_effect(effect);
78 return;
79 }
80
81 if (unk_2C % 2) {
82 angle = effect_simple_rand(360, unk_2C);
83 sin_deg(angle);
84 cos_deg(angle);
85 load_effect(EFFECT_SHIMMER_WAVE);
86 shimmer_wave_main(0, data->unk_04, data->unk_08, data->unk_0C, unk_2C * 8, 10.0f, 10, 20);
87 }
88
89 data->unk_1C += data->unk_20;
90
91 if (unk_28 < 10) {
92 data->unk_24 = unk_28 * 25;
93 }
94
95 data->unk_30 += data->unk_40;
96 data->unk_34 += data->unk_44;
97 data->unk_38 += data->unk_48;
98 data->unk_3C += data->unk_4C;
99
100 if (data->unk_30 > 128.0f) {
101 data->unk_30 -= 128.0f;
102 }
103 if (data->unk_34 > 128.0f) {
104 data->unk_34 -= 128.0f;
105 }
106 if (data->unk_38 > 128.0f) {
107 data->unk_38 -= 128.0f;
108 }
109 if (data->unk_3C > 128.0f) {
110 data->unk_3C -= 128.0f;
111 }
112
113 if (data->unk_30 < 0.0f) {
114 data->unk_30 += 128.0f;
115 }
116 if (data->unk_34 < 0.0f) {
117 data->unk_34 += 128.0f;
118 }
119 if (data->unk_38 < 0.0f) {
120 data->unk_38 += 128.0f;
121 }
122 if (data->unk_3C < 0.0f) {
123 data->unk_3C += 128.0f;
124 }
125}
#define sin_deg
#define remove_effect
#define load_effect
#define cos_deg
struct EnergyShockwaveFXData * energyShockwave
Definition effects.h:2521
EffectData data
Definition effects.h:2605
s32 effect_simple_rand(s32, s32)
EffectInstance * shimmer_wave_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, s32 arg6, s32 arg7)

Referenced by energy_shockwave_main().

◆ energy_shockwave_render()

void energy_shockwave_render ( EffectInstance * effect)

Definition at line 127 of file energy_shockwave.c.

127 {
128 RenderTask renderTask;
129 RenderTask* retTask;
130
132 renderTask.appendGfxArg = effect;
133 renderTask.dist = 10;
135
136 retTask = queue_render_task(&renderTask);
138}
#define queue_render_task
void energy_shockwave_appendGfx(void *effect)
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_SURFACE_XLU_LAYER3
Definition enums.h:3299
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by energy_shockwave_main().

◆ energy_shockwave_appendGfx()

void energy_shockwave_appendGfx ( void * effect)

Definition at line 140 of file energy_shockwave.c.

140 {
141 EnergyShockwaveFXData* data = ((EffectInstance*)effect)->data.energyShockwave;
142 Matrix4f sp10;
143 Matrix4f sp50;
144 s32 uls;
145 s32 ult;
146 s32 uls2;
147 s32 ult2;
148
149 gDPPipeSync(gMainGfxPos++);
150 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
151 gSPDisplayList(gMainGfxPos++, D_09000E60_376370);
152 gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 179, 30, data->unk_24);
153 gDPSetEnvColor(gMainGfxPos++, data->unk_50, data->unk_51, data->unk_52, 128);
154
155 uls = data->unk_30 * 4;
156 ult = data->unk_34 * 4;
157 uls2 = data->unk_38 * 4;
158 ult2 = data->unk_3C * 4;
159
160 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, uls, ult, uls + 252, ult + 252);
161 gDPSetTileSize(gMainGfxPos++, 1, uls2, ult2, uls2 + 124, ult2 + 124);
162
163 guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
164 guScaleF(sp50, data->unk_1C, data->unk_1C, data->unk_1C);
165 guMtxCatF(sp50, sp10, sp10);
167
168 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
169 gSPDisplayList(gMainGfxPos++, D_09000DC0_3762D0);
170 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
171 gDPPipeSync(gMainGfxPos++);
172}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
Gfx D_09000E60_376370[]
Gfx D_09000DC0_3762D0[]
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
DisplayContext * gDisplayContext
Definition cam_main.c:16

Referenced by energy_shockwave_render().

◆ energy_shockwave_main()

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

Definition at line 12 of file energy_shockwave.c.

19 {
21 EffectInstance* effect;
23 s32 numParts = 31;
24
28 bp.unk_00 = 0;
29 bp.renderUI = NULL;
30 bp.effectID = EFFECT_ENERGY_SHOCKWAVE;
31
32 effect = create_effect_instance(&bp);
33 effect->numParts = numParts;
34 data = effect->data.energyShockwave = general_heap_malloc(numParts * sizeof(*data));
35 ASSERT(effect->data.energyShockwave != NULL);
36
37 data->unk_00 = arg0;
38 data->unk_04 = arg1;
39 data->unk_08 = arg2;
40 data->unk_0C = arg3;
41 data->unk_20 = arg4 * 0.1;
42 data->unk_24 = 255;
43 data->unk_28 = arg5;
44 data->unk_2C = 0;
45 data->unk_30 = 0;
46 data->unk_34 = 0;
47 data->unk_38 = 0;
48 data->unk_3C = 0;
49 data->unk_40 = -1.1f;
50 data->unk_44 = 0;
51 data->unk_48 = 0.4f;
52 data->unk_4C = 1.0f;
53 data->unk_1C = 0;
54 data->unk_50 = 255;
55 data->unk_51 = 255;
56 data->unk_52 = 64;
57}
#define general_heap_malloc
#define create_effect_instance
#define ASSERT(condition)
void energy_shockwave_init(EffectInstance *effect)
void energy_shockwave_update(EffectInstance *effect)
void energy_shockwave_render(EffectInstance *effect)
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

◆ EFFECT_DEF_SHIMMER_WAVE()

EFFECT_DEF_SHIMMER_WAVE ( shimmer_wave_main )

Variable Documentation

◆ D_09000DC0_3762D0

Gfx D_09000DC0_3762D0[]
extern

◆ D_09000E60_376370

Gfx D_09000E60_376370[]
extern