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

Go to the source code of this file.

Functions

void walking_dust_init (EffectInstance *effect)
 
void walking_dust_update (EffectInstance *effect)
 
void walking_dust_render (EffectInstance *effect)
 
void walking_dust_appendGfx (void *effect)
 
void walking_dust_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5)
 

Variables

s8 D_E000E660 [16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, -1, 0 }
 
s8 D_E000E670 [20] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, -1, 0, 0, 0 }
 
s8 * D_E000E684 [2] = { D_E000E660, D_E000E670 }
 
Gfx D_09002780_32B620 []
 
Gfx D_09002868_32B708 []
 
Gfx D_09002950_32B7F0 []
 
Gfx D_09002B20_32B9C0 []
 
Gfx D_09002B40_32B9E0 []
 

Function Documentation

◆ walking_dust_init()

void walking_dust_init ( EffectInstance * effect)

Definition at line 60 of file walking_dust.c.

60 {
61}

Referenced by walking_dust_main().

◆ walking_dust_update()

void walking_dust_update ( EffectInstance * effect)

Definition at line 63 of file walking_dust.c.

63 {
64 WalkingDustFXData* data = effect->data.walkingDust;
65
66 data->unk_74 = D_E000E684[data->unk_6C][data->unk_70++];
67
68 if (data->unk_74 < 0) {
69 remove_effect(effect);
70 } else {
71 s32 i;
72
73 for (i = 0; i < effect->numParts; i++, data++) {
74 data->unk_08 += data->unk_58 * data->unk_64;
75 data->unk_10 += data->unk_58 * data->unk_68;
76 data->unk_5C = data->unk_5C + data->unk_60;
77 data->unk_0C += data->unk_5C;
78 }
79 }
80}
#define remove_effect
struct WalkingDustFXData * walkingDust
Definition effects.h:2471
EffectData data
Definition effects.h:2605
s8 * D_E000E684[2]
Definition walking_dust.c:8

Referenced by walking_dust_main().

◆ walking_dust_render()

void walking_dust_render ( EffectInstance * effect)

Definition at line 82 of file walking_dust.c.

82 {
83 RenderTask renderTask;
84 RenderTask* retTask;
85
87 renderTask.appendGfxArg = effect;
88 renderTask.dist = 0;
90
91 retTask = queue_render_task(&renderTask);
93}
#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 *)
void walking_dust_appendGfx(void *effect)

Referenced by walking_dust_main().

◆ walking_dust_appendGfx()

void walking_dust_appendGfx ( void * effect)

Definition at line 95 of file walking_dust.c.

95 {
96 EffectInstance* effectTemp = effect;
97 WalkingDustFXData* data = effectTemp->data.walkingDust;
98 s32 temp_t3 = data->unk_04;
99 s32 temp_t4 = data->unk_74;
100 s32 cond = FALSE;
101 Matrix4f sp18;
102 Matrix4f sp58;
103 s32 temp_a0;
104 s32 temp_lo;
105 Gfx* dlist;
106 Gfx* dlist2;
107 s32 phi_t1;
108 s32 i;
109
110 if (temp_t3 == 0) {
111 dlist2 = D_09002B20_32B9C0;
112 } else {
113 dlist2 = D_09002B40_32B9E0;
114 }
115
116 switch (temp_t3) {
117 case 1:
118 dlist = D_09002868_32B708;
119 break;
120 default:
121 dlist = D_09002950_32B7F0;
122 break;
123 case 0:
124 dlist = D_09002780_32B620;
125 break;
126 }
127
128
129 if ((data->unk_6C == 0 && temp_t4 == 6) || (data->unk_6C == 1 && temp_t4 == 7)) {
130 cond = TRUE;
131 }
132
133 gDPPipeSync(gMainGfxPos++);
134 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(effectTemp->graphics->data));
135 gSPDisplayList(gMainGfxPos++, dlist);
136 gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, 127);
137 gDPSetPrimColor(gMainGfxPos++, 0, 0, 230, 222, 222, 110);
138
139 if (temp_t3 == 0) {
140 phi_t1 = 24;
141 } else {
142 phi_t1 = 32;
143 }
144
145 temp_lo = temp_t4 * phi_t1;
146 temp_a0 = temp_lo + phi_t1;
147
148 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, temp_lo * 4, 0, (temp_a0 - 1) * 4, ((phi_t1 - 1) * 4));
149
150 if (cond) {
151 gDPSetTileSize(gMainGfxPos++, 1, temp_a0 * 4, 0, ((temp_lo + (phi_t1 * 2)) - 1) * 4, 0);
152 } else {
153 gDPSetTileSize(gMainGfxPos++, 1, temp_a0 * 4, 0, ((temp_lo + (phi_t1 * 2)) - 1) * 4, (phi_t1 - 1) * 4);
154 }
155
156 for (i = 0; i < effectTemp->numParts; i++, data++) {
157 guTranslateF(sp18, data->unk_08, data->unk_0C, data->unk_10);
158 guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f);
159 guMtxCatF(sp58, sp18, sp18);
162 G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
163 gSPDisplayList(gMainGfxPos++, dlist2);
164 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
165 }
166 gDPPipeSync(gMainGfxPos++);
167}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
struct EffectGraphics * graphics
Definition effects.h:2606
#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
Gfx D_09002950_32B7F0[]
Gfx D_09002780_32B620[]
Gfx D_09002B40_32B9E0[]
Gfx D_09002B20_32B9C0[]
Gfx D_09002868_32B708[]

Referenced by walking_dust_render().

◆ walking_dust_main()

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

Definition at line 21 of file walking_dust.c.

21 {
23 EffectInstance* effect;
25 s32 numParts = 1;
26 s32 i;
27
28 bp.unk_00 = 0;
32 bp.renderUI = NULL;
33 bp.effectID = EFFECT_WALKING_DUST;
34
35 effect = create_effect_instance(&bp);
36 effect->numParts = numParts;
37
38 data = general_heap_malloc(numParts * sizeof(*data));
39 effect->data.walkingDust = data;
40 ASSERT(effect->data.walkingDust != NULL);
41
42 mem_clear(data, numParts * sizeof(*data));
43 data->unk_6C = arg0 == 2;
44 data->unk_70 = 0;
45 data->unk_04 = arg0;
46
47 for (i = 0; i < numParts; i++, data++) {
48 data->unk_00 = 1;
49 data->unk_64 = arg4;
50 data->unk_68 = arg5;
51 data->unk_08 = arg1;
52 data->unk_0C = arg2;
53 data->unk_10 = arg3;
54 data->unk_58 = 0.33333334f;
55 data->unk_5C = 1.75f;
56 data->unk_60 = -0.16f;
57 }
58}
#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
void walking_dust_init(EffectInstance *effect)
void walking_dust_render(EffectInstance *effect)
void walking_dust_update(EffectInstance *effect)

Variable Documentation

◆ D_E000E660

s8 D_E000E660[16] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, -1, 0 }

Definition at line 4 of file walking_dust.c.

4{ 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, -1, 0 };

◆ D_E000E670

s8 D_E000E670[20] = { 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, -1, 0, 0, 0 }

Definition at line 6 of file walking_dust.c.

6{ 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, -1, 0, 0, 0 };

◆ D_E000E684

s8* D_E000E684[2] = { D_E000E660, D_E000E670 }

Definition at line 8 of file walking_dust.c.

s8 D_E000E660[16]
Definition walking_dust.c:4
s8 D_E000E670[20]
Definition walking_dust.c:6

Referenced by walking_dust_update().

◆ D_09002780_32B620

Gfx D_09002780_32B620[]
extern

Referenced by walking_dust_appendGfx().

◆ D_09002868_32B708

Gfx D_09002868_32B708[]
extern

Referenced by walking_dust_appendGfx().

◆ D_09002950_32B7F0

Gfx D_09002950_32B7F0[]
extern

Referenced by walking_dust_appendGfx().

◆ D_09002B20_32B9C0

Gfx D_09002B20_32B9C0[]
extern

Referenced by walking_dust_appendGfx().

◆ D_09002B40_32B9E0

Gfx D_09002B40_32B9E0[]
extern

Referenced by walking_dust_appendGfx().