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

Go to the source code of this file.

Functions

void rising_bubble_init (EffectInstance *effect)
 
void rising_bubble_update (EffectInstance *effect)
 
void rising_bubble_render (EffectInstance *effect)
 
void rising_bubble_appendGfx (void *effect)
 
void rising_bubble_main (s32 arg0, f32 posX, f32 posY, f32 posZ, f32 arg4)
 

Variables

Gfx D_09000200_356730 []
 
Gfx D_090002E8_356818 []
 
Gfx D_09000308_356838 []
 
Gfx D_090003F0_356920 []
 
Gfx D_09000410_356940 []
 
Gfx D_09000430_356960 []
 
Gfx * D_E0046600 [] = { D_090002E8_356818 }
 
Gfx * D_E0046604 []
 
Gfx * D_E0046614 [] = { D_09000200_356730 }
 
Gfx * D_E0046618 [] = { D_09000308_356838 }
 

Function Documentation

◆ rising_bubble_init()

void rising_bubble_init ( EffectInstance * effect)

Definition at line 59 of file rising_bubble.c.

59 {
60}

Referenced by rising_bubble_main().

◆ rising_bubble_update()

void rising_bubble_update ( EffectInstance * effect)

Definition at line 62 of file rising_bubble.c.

62 {
63 RisingBubbleFXData* data = effect->data.risingBubble;
64 s32 timeLeft = data->timeLeft;
65
66 if (data->pos.y >= data->unk_24) {
67 data->timeLeft--;
68 data->lifeTime++;
69
70 if (data->timeLeft < 0) {
71 remove_effect(effect);
72 return;
73 }
74
75 if (timeLeft >= 6) {
76 data->unk_14 += (120 - data->unk_14) * 0.3;
77 } else {
78 data->unk_14 = timeLeft * 20;
79 }
80
81 data->unk_20++;
82 if (data->unk_20 >= 32) {
83 data->unk_20 -= 32;
84 }
85
86 data->unk_10 += 0.1;
87 return;
88 }
89
90 data->unk_14 = 255;
91 data->lifeTime++;
92 data->pos.y += 2.0f;
93}
#define remove_effect
struct RisingBubbleFXData * risingBubble
Definition effects.h:2499
EffectData data
Definition effects.h:2605

Referenced by rising_bubble_main().

◆ rising_bubble_render()

void rising_bubble_render ( EffectInstance * effect)

Definition at line 95 of file rising_bubble.c.

95 {
96 RenderTask renderTask;
97 RenderTask* retTask;
98
100 renderTask.appendGfxArg = effect;
101 renderTask.dist = 0;
103
104 retTask = queue_render_task(&renderTask);
106}
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_CLOUD_NO_ZCMP
Definition enums.h:3311
void rising_bubble_appendGfx(void *effect)
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by rising_bubble_main().

◆ rising_bubble_appendGfx()

void rising_bubble_appendGfx ( void * effect)

Definition at line 108 of file rising_bubble.c.

108 {
109 RisingBubbleFXData* data = ((EffectInstance*)effect)->data.risingBubble;
110 s32 lifeTime = data->lifeTime;
111 Matrix4f sp20;
112 Matrix4f sp60;
113
114 gDPPipeSync(gMainGfxPos++);
115 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
116
117 if (data->pos.y >= data->unk_24) {
118 s32 uls;
119 s32 ult;
120
121 gSPDisplayList(gMainGfxPos++, D_E0046614[0]);
122 gDPSetPrimColor(gMainGfxPos++, 0, 0, 127, 127, 127, data->unk_14);
123
124 uls = 0;
125 ult = data->unk_20;
126
127 gDPSetTileSize(gMainGfxPos++, 1,
128 (uls ) * 4, (ult ) * 4,
129 (uls + 32) * 4, (ult + 32) * 4);
130
131 guTranslateF(sp20, data->pos.x, data->pos.y, data->pos.z);
132 guScaleF(sp60, data->unk_10, 1.0f, data->unk_10);
133 guMtxCatF(sp60, sp20, sp20);
134 } else {
135 gSPDisplayList(gMainGfxPos++, D_E0046618[0]);
136 gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, data->unk_14);
137 gDPSetEnvColor(gMainGfxPos++, 128, 128, 255, data->unk_14);
138
139 guPositionF(sp20, 0.0f, -gCameras[gCurrentCameraID].curYaw, 0.0f, data->unk_10, data->pos.x, data->pos.y, data->pos.z);
140 }
141
143 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
144
145 if (data->pos.y >= data->unk_24) {
146 gSPDisplayList(gMainGfxPos++, D_E0046600[0]);
147 } else {
148 gSPDisplayList(gMainGfxPos++, D_E0046604[(lifeTime >> 1) & 3]);
149 }
150
151 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
152 gDPPipeSync(gMainGfxPos++);
153}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guPositionF
#define guScaleF
Gfx * D_E0046600[]
Gfx * D_E0046614[]
Gfx * D_E0046618[]
Gfx * D_E0046604[]
#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

Referenced by rising_bubble_render().

◆ rising_bubble_main()

void rising_bubble_main ( s32 arg0,
f32 posX,
f32 posY,
f32 posZ,
f32 arg4 )

Definition at line 25 of file rising_bubble.c.

25 {
26 EffectBlueprint effectBp;
27 EffectInstance* effect;
29 s32 numParts = 1;
30
31 effectBp.unk_00 = 0;
32 effectBp.init = rising_bubble_init;
35 effectBp.renderUI = NULL;
36 effectBp.effectID = EFFECT_RISING_BUBBLE;
37
38 effect = create_effect_instance(&effectBp);
39 effect->numParts = numParts;
40 data = effect->data.risingBubble = general_heap_malloc(numParts * sizeof(*data));
41 ASSERT(data != NULL);
42
43 data->unk_00 = arg0;
44 data->pos.x = posX;
45 data->pos.y = posY;
46 data->pos.z = posZ;
47 data->unk_14 = 0;
48 data->lifeTime = 0;
49 if (arg4 != 0.0f) {
50 data->unk_10 = ((rand_int(3) * 0.1) + 0.7) * 0.4;
51 } else {
52 data->unk_10 = 1.0f;
53 }
54 data->timeLeft = 32;
55 data->unk_20 = rand_int(31);
56 data->unk_24 = posY + arg4;
57}
#define general_heap_malloc
#define rand_int
#define create_effect_instance
#define ASSERT(condition)
void rising_bubble_update(EffectInstance *effect)
void rising_bubble_init(EffectInstance *effect)
void rising_bubble_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

Variable Documentation

◆ D_09000200_356730

Gfx D_09000200_356730[]
extern

◆ D_090002E8_356818

Gfx D_090002E8_356818[]
extern

◆ D_09000308_356838

Gfx D_09000308_356838[]
extern

◆ D_090003F0_356920

Gfx D_090003F0_356920[]
extern

◆ D_09000410_356940

Gfx D_09000410_356940[]
extern

◆ D_09000430_356960

Gfx D_09000430_356960[]
extern

◆ D_E0046600

Gfx* D_E0046600[] = { D_090002E8_356818 }

Definition at line 11 of file rising_bubble.c.

Gfx D_090002E8_356818[]

Referenced by rising_bubble_appendGfx().

◆ D_E0046604

Gfx* D_E0046604[]
Initial value:
= {
}
Gfx D_090003F0_356920[]
Gfx D_09000430_356960[]
Gfx D_09000410_356940[]

Definition at line 13 of file rising_bubble.c.

Referenced by rising_bubble_appendGfx().

◆ D_E0046614

Gfx* D_E0046614[] = { D_09000200_356730 }

Definition at line 17 of file rising_bubble.c.

Gfx D_09000200_356730[]

Referenced by rising_bubble_appendGfx().

◆ D_E0046618

Gfx* D_E0046618[] = { D_09000308_356838 }

Definition at line 18 of file rising_bubble.c.

Gfx D_09000308_356838[]

Referenced by rising_bubble_appendGfx().