Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
effect_86.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects_internal.h"
3
10extern Gfx D_09000C48_415CA8[];
11extern Gfx D_09000C68_415CC8[];
12extern Gfx D_09000C88_415CE8[];
13extern Gfx D_09000CA8_415D08[];
14extern Gfx D_09000CC8_415D28[];
15extern Gfx D_09000CE8_415D48[];
16extern Gfx D_09000D08_415D68[];
17
23
25
26void effect_86_init(EffectInstance* effect);
29void effect_86_appendGfx(void* effect);
30
33 EffectInstance* effect;
34 Effect86FXData* data;
36 s32 numParts = 1;
37
38 bp.init = effect_86_init;
39 bp.update = effect_86_update;
40 bp.renderScene = effect_86_render;
41 bp.unk_00 = 0;
42 bp.renderUI = NULL;
43 bp.effectID = EFFECT_86;
44
45 effect = create_effect_instance(&bp);
46 effect->numParts = numParts;
47
48 data = general_heap_malloc(numParts * sizeof(*data));
49 effect->data.unk_86 = data;
50 part = data;
51
52 ASSERT(data != NULL);
53
54 part->unk_00 = arg0;
55 part->unk_14 = 0;
56 if (arg5 <= 0) {
57 part->unk_10 = 1000;
58 } else {
59 part->unk_10 = arg5;
60 }
61 part->unk_24 = 255;
62 part->unk_04 = arg1;
63 part->unk_08 = arg2;
64 part->unk_0C = arg3;
65 part->unk_34 = arg4;
66 part->unk_18 = 70;
67 part->unk_1C = 180;
68 part->unk_20 = 120;
69 part->unk_28 = 20;
70 part->unk_2C = 230;
71 part->unk_30 = 50;
72
73 return effect;
74}
75
77}
78
80 Effect86FXData* data = effect->data.unk_86;
81
82 if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
84 data->unk_10 = 0x10;
85 }
86
87 if (data->unk_10 < 1000) {
88 data->unk_10--;
89 }
90
91 data->unk_14++;
92 if (data->unk_10 < 0) {
93 remove_effect(effect);
94 }
95}
96
109
110void effect_86_appendGfx(void* effect) {
113 Effect86FXData* part = ((EffectInstance*)effect)->data.unk_86;
115 s32 primAlpha = part->unk_24;
116 s32 dlistIdx = part->unk_00;
117
119 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->shared->graphics));
120
121 guTranslateF(sp10, part->unk_04, part->unk_08, part->unk_0C);
122 guScaleF(sp50, part->unk_34, part->unk_34, part->unk_34);
125
128 gDPSetPrimColor(gMainGfxPos++, 0, 0, part->unk_18, part->unk_1C, part->unk_20, primAlpha);
129 gDPSetEnvColor(gMainGfxPos++, part->unk_28, part->unk_2C, part->unk_30, 0);
133}
BSS s32 PopupMenu_SelectedIndex
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
Gfx D_09000C48_415CA8[]
Gfx D_09000C28_415C88[]
Gfx * D_E01284B0[]
Definition effect_86.c:24
void effect_86_render(EffectInstance *effect)
Definition effect_86.c:97
Gfx D_09000C68_415CC8[]
Gfx D_09000800_415860[]
EffectInstance * effect_86_main(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
Definition effect_86.c:31
Gfx D_09000D08_415D68[]
void effect_86_update(EffectInstance *effect)
Definition effect_86.c:79
Gfx D_09000C88_415CE8[]
void effect_86_appendGfx(void *effect)
Definition effect_86.c:110
Gfx D_09000CE8_415D48[]
Gfx D_09000BE8_415C48[]
Gfx D_09000CA8_415D08[]
Gfx D_09000BA8_415C08[]
Gfx * D_E0128480[12]
Definition effect_86.c:18
void effect_86_init(EffectInstance *effect)
Definition effect_86.c:76
Gfx D_09000C08_415C68[]
Gfx D_09000BC8_415C28[]
Gfx D_09000CC8_415D28[]
#define general_heap_malloc
#define queue_render_task
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define remove_effect
#define create_effect_instance
#define guScaleF
EffectInstanceDataPtr data
Definition effects.h:2605
struct Effect86FXData * unk_86
Definition effects.h:2598
#define ASSERT(condition)
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_CLOUD_NO_ZCMP
Definition enums.h:3311
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
void(* appendGfx)(void *)
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