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

Go to the source code of this file.

Functions

void big_smoke_puff_init (EffectInstance *effect)
 
void big_smoke_puff_update (EffectInstance *effect)
 
void big_smoke_puff_render (EffectInstance *effect)
 
void big_smoke_puff_appendGfx (void *effect)
 
void big_smoke_puff_main (f32 x, f32 y, f32 z)
 
void func_E0002738 (EffectInstance *effect)
 

Variables

Gfx D_09000FA0_3273B0 []
 
Gfx D_09001060_327470 []
 
Gfx D_09001120_327530 []
 
Gfx D_090011E0_3275F0 []
 
Gfx D_090012A0_3276B0 []
 
Gfx D_09001360_327770 []
 
Gfx D_09001420_327830 []
 

Function Documentation

◆ big_smoke_puff_init()

void big_smoke_puff_init ( EffectInstance * effect)

Definition at line 74 of file big_smoke_puff.c.

74 {
75}

Referenced by big_smoke_puff_main().

◆ big_smoke_puff_update()

void big_smoke_puff_update ( EffectInstance * effect)

Definition at line 77 of file big_smoke_puff.c.

77 {
78 BigSmokePuffFXData* data = effect->data.bigSmokePuff;
79 s32 cond = FALSE;
80 s32 i;
81
82 for (i = 0; i < effect->numParts; i++, data++) {
83 if (data->unk_02 >= 0) {
84 data->unk_08--;
85
86 if (data->unk_08 < 0) {
87 data->partX += data->unk_20;
88 data->partY += data->unk_24;
89 data->unk_00++;
90 data->unk_02--;
91 cond = TRUE;
92
93 if (data->unk_02 >= 0) {
94 data->unk_06--;
95 if (data->unk_06 < 0) {
96 data->unk_20 /= 1.25;
97 data->unk_24 /= 1.25;
98 }
99 }
100 }
101 }
102 }
103
104 if (!cond) {
105 remove_effect(effect);
106 }
107}
BSS s32 PopupMenu_SelectedIndex
#define remove_effect
struct BigSmokePuffFXData * bigSmokePuff
Definition effects.h:2465
EffectInstanceDataPtr data
Definition effects.h:2605

Referenced by big_smoke_puff_main().

◆ big_smoke_puff_render()

void big_smoke_puff_render ( EffectInstance * effect)

Definition at line 109 of file big_smoke_puff.c.

109 {
112
114 renderTask.appendGfxArg = effect;
115 renderTask.dist = 0;
117
120}
void big_smoke_puff_appendGfx(void *effect)
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_CLOUD_NO_ZCMP
Definition enums.h:3311
void(* appendGfx)(void *)

Referenced by big_smoke_puff_main().

◆ big_smoke_puff_appendGfx()

void big_smoke_puff_appendGfx ( void * effect)

Definition at line 122 of file big_smoke_puff.c.

122 {
124 BigSmokePuffFXData* data = ((EffectInstance*)effect)->data.bigSmokePuff;
125 Matrix4f mtx;
126 s32 i;
127
129 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->shared->graphics));
130
131 guPositionF(mtx, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, data->x, data->y, data->z);
133
136
137 for (i = 0; i < ((EffectInstance*)effect)->numParts; i++, data++) {
138 if (data->unk_02 >= 0 && data->unk_08 < 0) {
139 s32 primAlpha = data->unk_02;
141 s32 envAlpha;
142 Gfx* dlist;
143
144 if (primAlpha > 16) {
145 primAlpha = 16;
146 }
147
148 guPositionF(mtx, 0.0f, 0.0f, sPartYaws[i], sPartScales[i], data->partX,
149 data->partY, 0.0f);
151
154
155 temp_f12 = data->unk_00 - 1;
156
157 if (data->unk_04 <= temp_f12) {
158 envAlpha = 255;
159 dlist = sDlists[ARRAY_COUNT(sDlists) - 1];
160 } else {
161 f32 temp = sin_deg((((temp_f12 * 7.0f) / data->unk_04) * 90.0f) / 7.0f) * 7.0f;
162
163 envAlpha = (s32)(temp * 255.0f) % 256;
164 dlist = sDlists[(s32)temp];
165 }
166
167 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, (u32)(primAlpha * 105) / 8);
169 gSPDisplayList(gMainGfxPos++, dlist);
171 }
172 }
173
176}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guMtxF2L
#define sin_deg
#define guPositionF
#define ARRAY_COUNT(arr)
Definition macros.h:40
#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:5
DisplayContext * gDisplayContext
Definition cam_main.c:16

Referenced by big_smoke_puff_render().

◆ big_smoke_puff_main()

void big_smoke_puff_main ( f32 x,
f32 y,
f32 z )

Definition at line 27 of file big_smoke_puff.c.

27 {
29 EffectInstance* effect;
31 f32 theta;
35 s32 numParts = 10;
36 s32 i;
37
38 bp.unk_00 = 0;
41 bp.renderScene = big_smoke_puff_render;
42 bp.renderUI = NULL;
43 bp.effectID = EFFECT_BIG_SMOKE_PUFF;
44
45 effect = create_effect_instance(&bp);
46 effect->numParts = numParts;
47
48 data = general_heap_malloc(effect->numParts * sizeof(*data));
49 effect->data.bigSmokePuff = data;
50
51 ASSERT(data != NULL);
52
53 for (i = 0; i < effect->numParts; i++, data++) {
54 data->unk_00 = 0;
55 data->unk_02 = data->unk_04 = effect_rand_int(6) + 0x10;
56 data->unk_06 = 4;
57 data->unk_08 = 0;
58 data->x = x;
59 data->y = y;
60 data->z = z;
61 data->partX = 0;
62 data->partY = 0;
63
64 theta = D_E0002760[i] + 90.0f;
65 temp_f20 = 2.0 * D_E0002788[i];
68
69 data->unk_20 = temp_f20 * sinTheta;
70 data->unk_24 = -temp_f20 * cosTheta;
71 }
72}
void big_smoke_puff_update(EffectInstance *effect)
void big_smoke_puff_render(EffectInstance *effect)
void big_smoke_puff_init(EffectInstance *effect)
#define general_heap_malloc
#define cos_deg
#define create_effect_instance
#define ASSERT(condition)
s32 effect_rand_int(s32)

◆ func_E0002738()

void func_E0002738 ( EffectInstance * effect)

Definition at line 178 of file big_smoke_puff.c.

178 {
179 remove_effect(effect);
180}

Variable Documentation

◆ D_09000FA0_3273B0

Gfx D_09000FA0_3273B0[]
extern

◆ D_09001060_327470

Gfx D_09001060_327470[]
extern

◆ D_09001120_327530

Gfx D_09001120_327530[]
extern

◆ D_090011E0_3275F0

Gfx D_090011E0_3275F0[]
extern

◆ D_090012A0_3276B0

Gfx D_090012A0_3276B0[]
extern

◆ D_09001360_327770

Gfx D_09001360_327770[]
extern

◆ D_09001420_327830

Gfx D_09001420_327830[]
extern