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

Go to the source code of this file.

Functions

void shiny_flare_init (EffectInstance *effect)
 
void shiny_flare_update (EffectInstance *effect)
 
void shiny_flare_render (EffectInstance *effect)
 
void shiny_flare_appendGfx (void *effect)
 
EffectInstanceshiny_flare_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 
void func_E00DA228 (void)
 

Variables

Gfx D_09000240_3D79B0 []
 
Gfx D_090002E0_3D7A50 []
 
u8 D_E00DA500 []
 

Function Documentation

◆ shiny_flare_init()

void shiny_flare_init ( EffectInstance * effect)

Definition at line 57 of file shiny_flare.c.

57 {
58}

Referenced by shiny_flare_main().

◆ shiny_flare_update()

void shiny_flare_update ( EffectInstance * effect)

Definition at line 60 of file shiny_flare.c.

60 {
61 ShinyFlareFXData *data = effect->data.shinyFlare;
62
63 if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
64 effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
65 data->timeLeft = 10;
66 }
67 if (data->timeLeft < 1000) {
68 data->timeLeft--;
69 }
70
71 data->lifeTime++;
72 if (data->timeLeft < 0) {
73 remove_effect(effect);
74 return;
75 }
76 if (data->timeLeft < 4) {
77 data->unk_2C *= 0.5;
78 return;
79 }
80
81 data->unk_2C = data->lifeTime * 0.2f + 0.3;
82}
#define remove_effect
struct ShinyFlareFXData * shinyFlare
Definition effects.h:2573
EffectData data
Definition effects.h:2605
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517

Referenced by shiny_flare_main().

◆ shiny_flare_render()

void shiny_flare_render ( EffectInstance * effect)

Definition at line 84 of file shiny_flare.c.

84 {
85 RenderTask renderTask;
86 RenderTask* retTask;
87
89 renderTask.appendGfxArg = effect;
90 renderTask.dist = 10;
92
93 retTask = queue_render_task(&renderTask);
95}
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_CLOUD_NO_ZCMP
Definition enums.h:3311
void shiny_flare_appendGfx(void *effect)
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by shiny_flare_main().

◆ shiny_flare_appendGfx()

void shiny_flare_appendGfx ( void * effect)

Definition at line 100 of file shiny_flare.c.

100 {
101 ShinyFlareFXData* data = ((EffectInstance*)effect)->data.shinyFlare;
102 Camera* camera = &gCameras[gCurrentCameraID];
103 s32 unk_24 = data->unk_24;
104 f32 scale = data->unk_28 * data->unk_2C;
105 s32 idx;
106 Matrix4f sp10;
107 Matrix4f sp50;
108
109 gDPPipeSync(gMainGfxPos++);
110 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
111
112 guTranslateF(sp10, data->pos.x, data->pos.y, data->pos.z);
113 guScaleF(sp50, scale, scale, scale);
114 guMtxCatF(sp50, sp10, sp10);
116
117 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
118 gSPMatrix(gMainGfxPos++, camera->mtxBillboard, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
119 gSPDisplayList(gMainGfxPos++, D_09000240_3D79B0);
120 gDPSetPrimColor(gMainGfxPos++, 0, 0, data->unk_18, data->unk_1C, data->unk_20, unk_24);
121
122 idx = data->lifeTime * 3;
123
124 gDPSetPrimColor(gMainGfxPos++, 0, 0,
128 unk_24);
129 gSPDisplayList(gMainGfxPos++, D_090002E0_3D7A50);
130 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
131}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
Gfx D_09000240_3D79B0[]
Gfx D_090002E0_3D7A50[]
u8 D_E00DA500[]
Definition shiny_flare.c:7
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 shiny_flare_render().

◆ shiny_flare_main()

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

Definition at line 23 of file shiny_flare.c.

23 {
24 EffectBlueprint effectBp;
25 EffectInstance* effect;
26 ShinyFlareFXData* data;
27 s32 numParts = 1;
28
29 effectBp.init = shiny_flare_init;
30 effectBp.update = shiny_flare_update;
32 effectBp.unk_00 = 0;
33 effectBp.renderUI = NULL;
34 effectBp.effectID = EFFECT_SHINY_FLARE;
35 effect = create_effect_instance(&effectBp);
36 effect->numParts = numParts;
37
38 data = effect->data.shinyFlare = general_heap_malloc(numParts * sizeof(*data));
39 ASSERT(data != NULL);
40
41 data->unk_00 = arg0;
42 data->lifeTime = 0;
43 data->timeLeft = 10;
44 data->unk_24 = 255;
45 data->pos.x = arg1;
46 data->pos.y = arg2;
47 data->pos.z = arg3;
48 data->unk_28 = arg4;
49 data->unk_18 = 70;
50 data->unk_1C = 180;
51 data->unk_20 = 120;
52 data->unk_2C = 0;
53
54 return effect;
55}
#define general_heap_malloc
#define create_effect_instance
#define ASSERT(condition)
void shiny_flare_update(EffectInstance *effect)
Definition shiny_flare.c:60
void shiny_flare_render(EffectInstance *effect)
Definition shiny_flare.c:84
void shiny_flare_init(EffectInstance *effect)
Definition shiny_flare.c:57
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

◆ func_E00DA228()

void func_E00DA228 ( void )

Definition at line 97 of file shiny_flare.c.

97 {
98}

Variable Documentation

◆ D_09000240_3D79B0

Gfx D_09000240_3D79B0[]
extern

Referenced by shiny_flare_appendGfx().

◆ D_090002E0_3D7A50

Gfx D_090002E0_3D7A50[]
extern

Referenced by shiny_flare_appendGfx().

◆ D_E00DA500

u8 D_E00DA500[]
Initial value:
= {
255, 255, 82,
255, 255, 82,
181, 148, 0,
181, 148, 0,
255, 255, 214,
255, 255, 214,
181, 148, 0,
181, 148, 0
}

Definition at line 7 of file shiny_flare.c.

7 {
8 255, 255, 82,
9 255, 255, 82,
10 181, 148, 0,
11 181, 148, 0,
12 255, 255, 214,
13 255, 255, 214,
14 181, 148, 0,
15 181, 148, 0
16};

Referenced by shiny_flare_appendGfx().