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

Go to the source code of this file.

Functions

void smoke_burst_init (EffectInstance *effect)
 
void smoke_burst_update (EffectInstance *effect)
 
void smoke_burst_render (EffectInstance *effect)
 
void smoke_burst_appendGfx (void *effect)
 
void smoke_burst_main (s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4, s32 timeLeft)
 

Variables

Gfx D_09002950_32B7F0 []
 
Gfx D_09002B60_32BA00 []
 
Gfx D_09002C60_32BB00 []
 
Gfx * D_E004E5E0 []
 
Gfx * D_E004E5EC []
 

Function Documentation

◆ smoke_burst_init()

void smoke_burst_init ( EffectInstance * effect)

Definition at line 73 of file smoke_burst.c.

73 {
74}

Referenced by smoke_burst_main().

◆ smoke_burst_update()

void smoke_burst_update ( EffectInstance * effect)

Definition at line 76 of file smoke_burst.c.

76 {
77 SmokeBurstFXData* data = effect->data.smokeBurst;
78
79 data->unk_20 = (data->lifeTime * 8.0f) / data->unk_1C;
80 data->lifeTime++;
81 data->timeLeft--;
82
83 if (data->timeLeft < 0) {
84 remove_effect(effect);
85 }
86}
#define remove_effect
struct SmokeBurstFXData * smokeBurst
Definition effects.h:2503
EffectData data
Definition effects.h:2605

Referenced by smoke_burst_main().

◆ smoke_burst_render()

void smoke_burst_render ( EffectInstance * effect)

Definition at line 88 of file smoke_burst.c.

88 {
89 RenderTask renderTask;
90 RenderTask* retTask;
91
93 renderTask.appendGfxArg = effect;
94 renderTask.dist = 0;
96
97 retTask = queue_render_task(&renderTask);
99}
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_PASS_THROUGH
Definition enums.h:3306
void smoke_burst_appendGfx(void *effect)
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by smoke_burst_main().

◆ smoke_burst_appendGfx()

void smoke_burst_appendGfx ( void * effect)

Definition at line 101 of file smoke_burst.c.

101 {
102 SmokeBurstFXData* data = ((EffectInstance*)effect)->data.smokeBurst;
103 s32 unk_20_s32 = data->unk_20;
104 s32 envAlpha = (data->unk_20 - unk_20_s32) * 256.0f;
105 s32 cond = (unk_20_s32 == 7);
106 s32 temp_a1;
107 Gfx* dlist = D_E004E5E0[data->unk_00];
108 Gfx* dlist2 = D_E004E5EC[0];
109 Matrix4f sp20;
110 Matrix4f sp60;
111
112 gDPPipeSync(gMainGfxPos++);
113 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
114 gSPDisplayList(gMainGfxPos++, dlist2);
115
116 guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z);
117 guRotateF(sp60, 20.0f, 0.0f, 0.0f, 1.0f);
118 guMtxCatF(sp60, sp20, sp20);
120
121 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
122 gDPSetPrimColor(gMainGfxPos++, 0, 0, data->rgba.r, data->rgba.g, data->rgba.b, data->rgba.a);
123 gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, envAlpha);
124 gDPSetAlphaCompare(gMainGfxPos++, G_AC_DITHER);
125 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE,
126 (unk_20_s32 * 32 ) * 4, 0,
127 (unk_20_s32 * 32 + 31) * 4, 31 * 4);
128
129 temp_a1 = unk_20_s32 * 32 + 32;
130
131 if (cond) {
132 gDPSetTileSize(gMainGfxPos++, 1,
133 (temp_a1 ) * 4, 32 * 4,
134 (temp_a1 + 31) * 4, 63 * 4);
135 } else {
136 gDPSetTileSize(gMainGfxPos++, 1,
137 (temp_a1 ) * 4, 0,
138 (temp_a1 + 31) * 4, 31 * 4);
139 }
140
141 gSPDisplayList(gMainGfxPos++, dlist);
142 gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
143 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
144}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guMtxCatF
#define guPositionF
Color_RGBA8 rgba
Definition effects.h:600
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
Gfx * D_E004E5E0[]
Definition smoke_burst.c:8
Gfx * D_E004E5EC[]
Definition smoke_burst.c:12
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 smoke_burst_render().

◆ smoke_burst_main()

void smoke_burst_main ( s32 arg0,
f32 posX,
f32 posY,
f32 posZ,
f32 arg4,
s32 timeLeft )

Definition at line 21 of file smoke_burst.c.

21 {
22 EffectBlueprint effectBp;
23 EffectInstance* effect;
24 SmokeBurstFXData* data;
25 s32 numParts = 1;
26
27 effectBp.init = smoke_burst_init;
28 effectBp.update = smoke_burst_update;
30 effectBp.unk_00 = 0;
31 effectBp.renderUI = NULL;
32 effectBp.effectID = EFFECT_SMOKE_BURST;
33
34 effect = create_effect_instance(&effectBp);
35 effect->numParts = numParts;
36
37 data = effect->data.smokeBurst = general_heap_malloc(numParts * sizeof(*data));
38 ASSERT(data != NULL);
39
40 mem_clear(data, numParts * sizeof(*data));
41 data->timeLeft = timeLeft;
42 data->lifeTime = 0;
43 data->unk_1C = timeLeft;
44 data->unk_20 = 0;
45 data->unk_00 = arg0;
46 data->pos.x = posX;
47 data->pos.y = posY;
48 data->pos.z = posZ;
49 data->unk_10 = arg4;
50
51 switch (arg0) {
52 case 0:
53 data->rgba.b = 0;
54 data->rgba.g = 0;
55 data->rgba.r = 0;
56 data->rgba.a = 130;
57 break;
58 case 1:
59 data->rgba.r = 255;
60 data->rgba.b = 0;
61 data->rgba.g = 0;
62 data->rgba.a = 130;
63 break;
64 default:
65 data->rgba.r = 225;
66 data->rgba.g = 215;
67 data->rgba.b = 255;
68 data->rgba.a = 180;
69 break;
70 }
71}
#define general_heap_malloc
#define create_effect_instance
#define mem_clear
#define ASSERT(condition)
void smoke_burst_update(EffectInstance *effect)
Definition smoke_burst.c:76
void smoke_burst_init(EffectInstance *effect)
Definition smoke_burst.c:73
void smoke_burst_render(EffectInstance *effect)
Definition smoke_burst.c:88
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_09002950_32B7F0

Gfx D_09002950_32B7F0[]
extern

◆ D_09002B60_32BA00

Gfx D_09002B60_32BA00[]
extern

◆ D_09002C60_32BB00

Gfx D_09002C60_32BB00[]
extern

◆ D_E004E5E0

Gfx* D_E004E5E0[]
Initial value:
= {
}
Gfx D_09002C60_32BB00[]
Gfx D_09002B60_32BA00[]

Definition at line 8 of file smoke_burst.c.

Referenced by smoke_burst_appendGfx().

◆ D_E004E5EC

Gfx* D_E004E5EC[]
Initial value:

Definition at line 12 of file smoke_burst.c.

Referenced by smoke_burst_appendGfx().