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

Go to the source code of this file.

Functions

void balloon_init (EffectInstance *effect)
 
void balloon_update (EffectInstance *effect)
 
void balloon_render (EffectInstance *effect)
 
void balloon_appendGfx (void *effect)
 
EffectInstanceballoon_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 

Variables

Gfx D_09001280_3958F0 []
 
Gfx D_09001358_3959C8 []
 
Gfx D_09001430_395AA0 []
 
Gfx D_09001508_395B78 []
 
Gfx * D_E00963E0 [] = { D_09001280_3958F0, D_09001358_3959C8, D_09001430_395AA0 }
 

Function Documentation

◆ balloon_init()

void balloon_init ( EffectInstance * effect)

Definition at line 52 of file balloon.c.

52 {
53}

Referenced by balloon_main().

◆ balloon_update()

void balloon_update ( EffectInstance * effect)

Definition at line 55 of file balloon.c.

55 {
56 BalloonFXData* part = effect->data.balloon;
57
58 part->unk_1C--;
59 part->unk_20++;
60
61 if (part->unk_1C < 0) {
62 remove_effect(effect);
63 return;
64 }
65
66 part->unk_10 += part->unk_14;
67 if (part->unk_10 > 2.0f) {
68 part->unk_10 = 2.0f;
69 }
70 part->unk_08 += part->unk_10;
71}
#define remove_effect
struct BalloonFXData * balloon
Definition effects.h:2539
EffectData data
Definition effects.h:2605

Referenced by balloon_main().

◆ balloon_render()

void balloon_render ( EffectInstance * effect)

Definition at line 73 of file balloon.c.

73 {
74 RenderTask renderTask;
75 RenderTask* retTask;
76
77 renderTask.appendGfx = balloon_appendGfx;
78 renderTask.appendGfxArg = effect;
79 renderTask.dist = 0;
81
82 retTask = queue_render_task(&renderTask);
84}
void balloon_appendGfx(void *effect)
Definition balloon.c:86
#define queue_render_task
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ RENDER_MODE_SURFACE_OPA
Definition enums.h:3264
void * appendGfxArg
void(* appendGfx)(void *)

Referenced by balloon_main().

◆ balloon_appendGfx()

void balloon_appendGfx ( void * effect)

Definition at line 86 of file balloon.c.

86 {
87 Matrix4f sp18;
88 Matrix4f sp58;
89 BalloonFXData* data = ((EffectInstance*)effect)->data.balloon;
90 s32 idx = data->unk_00;
91
92 gDPPipeSync(gMainGfxPos++);
93 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
94
95 guTranslateF(sp18, data->unk_04, data->unk_08, data->unk_0C);
96 guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f);
97 guMtxCatF(sp58, sp18, sp18);
98 guScaleF(sp58, data->unk_18, data->unk_18, 1.0f);
99 guMtxCatF(sp58, sp18, sp18);
101
103 G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
104 gSPDisplayList(gMainGfxPos++, D_E00963E0[idx]);
105 gSPDisplayList(gMainGfxPos++, D_09001508_395B78);
106 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
107 gDPPipeSync(gMainGfxPos++);
108}
Gfx D_09001508_395B78[]
Gfx * D_E00963E0[]
Definition balloon.c:9
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
#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 balloon_render().

◆ balloon_main()

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

Definition at line 16 of file balloon.c.

16 {
18 EffectInstance* effect;
19 BalloonFXData* data;
20 BalloonFXData* part;
21 s32 numParts = 1;
22
23 bp.init = balloon_init;
26 bp.unk_00 = 0;
27 bp.renderUI = NULL;
28 bp.effectID = EFFECT_BALLOON;
29
30 effect = create_effect_instance(&bp);
31 effect->numParts = numParts;
32
33 data = general_heap_malloc(numParts * sizeof(*data));
34 effect->data.balloon = data;
35 part = data;
36
37 ASSERT(data != NULL);
38
39 part->unk_00 = arg0;
40 part->unk_04 = arg1;
41 part->unk_08 = arg2;
42 part->unk_0C = arg3;
43 part->unk_10 = 0.0f;
44 part->unk_1C = arg5;
45 part->unk_18 = 0.67f;
46 part->unk_20 = 0;
47 part->unk_14 = arg4;
48
49 return effect;
50}
void balloon_render(EffectInstance *effect)
Definition balloon.c:73
void balloon_update(EffectInstance *effect)
Definition balloon.c:55
void balloon_init(EffectInstance *effect)
Definition balloon.c:52
#define general_heap_malloc
#define create_effect_instance
#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

Variable Documentation

◆ D_09001280_3958F0

Gfx D_09001280_3958F0[]
extern

◆ D_09001358_3959C8

Gfx D_09001358_3959C8[]
extern

◆ D_09001430_395AA0

Gfx D_09001430_395AA0[]
extern

◆ D_09001508_395B78

Gfx D_09001508_395B78[]
extern

Referenced by balloon_appendGfx().

◆ D_E00963E0

Definition at line 9 of file balloon.c.

Gfx D_09001430_395AA0[]
Gfx D_09001280_3958F0[]
Gfx D_09001358_3959C8[]

Referenced by balloon_appendGfx().