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

Go to the source code of this file.

Functions

void floating_cloud_puff_init (EffectInstance *effect)
 
void floating_cloud_puff_update (EffectInstance *effect)
 
void floating_cloud_puff_render (EffectInstance *effect)
 
void floating_cloud_puff_appendGfx (void *effect)
 
EffectInstancefloating_cloud_puff_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 
void func_E00D227C (void)
 

Variables

Gfx D_09000080_3D4F10 []
 
Gfx D_09000168_3D4FF8 []
 
u8 D_E00D2500 [] = { 0x00, 0x1E, 0x50, 0x78, 0x70, 0x68, 0x64, 0x00 }
 
u8 D_E00D2508 [] = { 0x5E, 0x5C, 0x64, 0x69, 0x6B, 0x69, 0x64, 0x00 }
 

Function Documentation

◆ floating_cloud_puff_init()

void floating_cloud_puff_init ( EffectInstance * effect)

Definition at line 62 of file floating_cloud_puff.c.

62 {
63}

Referenced by floating_cloud_puff_main().

◆ floating_cloud_puff_update()

void floating_cloud_puff_update ( EffectInstance * effect)

Definition at line 65 of file floating_cloud_puff.c.

65 {
67 s32 unk_14;
68
69 if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
70 effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
71 data->unk_10 = 16;
72 }
73
74 if (data->unk_10 < 1000) {
75 data->unk_10--;
76 }
77
78 data->unk_14++;
79
80 if (data->unk_10 < 0) {
81 remove_effect(effect);
82 return;
83 }
84
85 unk_14 = data->unk_14;
86
87 if (data->unk_10 < 16) {
88 data->unk_24 = data->unk_10 * 16;
89 }
90
91 data->unk_08 += 0.6;
92
93 if (unk_14 < 7) {
94 data->unk_38 = D_E00D2500[unk_14] * 0.01;
95 } else {
96 data->unk_38 = D_E00D2508[(unk_14 - 7) % 7] * 0.01;
97 }
98}
s8 unk_14
Definition demo_api.c:19
#define remove_effect
struct FloatingCloudPuffFXData * floatingCloudPuff
Definition effects.h:2569
EffectData data
Definition effects.h:2605
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
u8 D_E00D2500[]
u8 D_E00D2508[]

Referenced by floating_cloud_puff_main().

◆ floating_cloud_puff_render()

void floating_cloud_puff_render ( EffectInstance * effect)

Definition at line 100 of file floating_cloud_puff.c.

100 {
101 RenderTask renderTask;
102 RenderTask* retTask;
103
105 renderTask.appendGfxArg = effect;
106 renderTask.dist = 10;
108
109 retTask = queue_render_task(&renderTask);
111}
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_CLOUD_NO_ZCMP
Definition enums.h:3311
void floating_cloud_puff_appendGfx(void *effect)
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by floating_cloud_puff_main().

◆ floating_cloud_puff_appendGfx()

void floating_cloud_puff_appendGfx ( void * effect)

Definition at line 116 of file floating_cloud_puff.c.

116 {
117 FloatingCloudPuffFXData* data = ((EffectInstance*)effect)->data.floatingCloudPuff;
118 Camera* camera = &gCameras[gCurrentCameraID];
119 s32 unk_24 = data->unk_24;
120 f32 scale = data->unk_34 * data->unk_38;
121 Matrix4f sp10;
122 Matrix4f sp50;
123
124 gDPPipeSync(gMainGfxPos++);
125 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
126
127 guTranslateF(sp10, data->unk_04, data->unk_08, data->unk_0C);
128 guScaleF(sp50, scale, scale, scale);
129 guMtxCatF(sp50, sp10, sp10);
131
132 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
133 gSPMatrix(gMainGfxPos++, camera->mtxBillboard, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
134 gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_18, data->unk_1C, data->unk_20, unk_24);
135 gDPSetEnvColor(gMainGfxPos++, data->unk_28, data->unk_2C, data->unk_30, 0);
136 gSPDisplayList(gMainGfxPos++, D_09000080_3D4F10);
137 gSPDisplayList(gMainGfxPos++, D_09000168_3D4FF8);
138 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
139}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
Gfx D_09000168_3D4FF8[]
Gfx D_09000080_3D4F10[]
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
Mtx * mtxBillboard
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 floating_cloud_puff_render().

◆ floating_cloud_puff_main()

EffectInstance * floating_cloud_puff_main ( s32 arg0,
f32 arg1,
f32 arg2,
f32 arg3,
f32 arg4,
s32 arg5 )

Definition at line 15 of file floating_cloud_puff.c.

22 {
24 EffectInstance* effect;
26 s32 numParts = 1;
27
31 bp.unk_00 = 0;
32 bp.renderUI = NULL;
33 bp.effectID = EFFECT_FLOATING_CLOUD_PUFF;
34
35 effect = create_effect_instance(&bp);
36 effect->numParts = numParts;
37 data = effect->data.floatingCloudPuff = general_heap_malloc(numParts * sizeof(*data));
38 ASSERT(effect->data.floatingCloudPuff != NULL);
39
40 data->unk_00 = arg0;
41 data->unk_14 = 0;
42 if (arg5 <= 0) {
43 data->unk_10 = 1000;
44 } else {
45 data->unk_10 = arg5;
46 }
47 data->unk_24 = 255;
48 data->unk_04 = arg1;
49 data->unk_08 = arg2;
50 data->unk_0C = arg3;
51 data->unk_34 = arg4;
52 data->unk_18 = 255;
53 data->unk_1C = 255;
54 data->unk_20 = 255;
55 data->unk_28 = 10;
56 data->unk_2C = 10;
57 data->unk_30 = 120;
58
59 return effect;
60}
#define general_heap_malloc
#define create_effect_instance
#define ASSERT(condition)
void floating_cloud_puff_update(EffectInstance *effect)
void floating_cloud_puff_init(EffectInstance *effect)
void floating_cloud_puff_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

Referenced by tubba_heart_attack_update().

◆ func_E00D227C()

void func_E00D227C ( void )

Definition at line 113 of file floating_cloud_puff.c.

113 {
114}

Variable Documentation

◆ D_09000080_3D4F10

Gfx D_09000080_3D4F10[]
extern

◆ D_09000168_3D4FF8

Gfx D_09000168_3D4FF8[]
extern

◆ D_E00D2500

u8 D_E00D2500[] = { 0x00, 0x1E, 0x50, 0x78, 0x70, 0x68, 0x64, 0x00 }

Definition at line 7 of file floating_cloud_puff.c.

7{ 0x00, 0x1E, 0x50, 0x78, 0x70, 0x68, 0x64, 0x00 };

Referenced by floating_cloud_puff_update().

◆ D_E00D2508

u8 D_E00D2508[] = { 0x5E, 0x5C, 0x64, 0x69, 0x6B, 0x69, 0x64, 0x00 }

Definition at line 8 of file floating_cloud_puff.c.

8{ 0x5E, 0x5C, 0x64, 0x69, 0x6B, 0x69, 0x64, 0x00 };

Referenced by floating_cloud_puff_update().