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

Go to the source code of this file.

Functions

void quizmo_assistant_init (EffectInstance *effect)
 
void quizmo_assistant_update (EffectInstance *effect)
 
void quizmo_assistant_render (EffectInstance *effect)
 
void quizmo_assistant_appendGfx (void *effect)
 
EffectInstancequizmo_assistant_main (s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
 

Variables

Gfx D_09002400_409480 []
 
Gfx D_09002528_4095A8 []
 
Gfx D_090025B8_409638 []
 
Gfx D_09002648_4096C8 []
 
Gfx D_090026D8_409758 []
 
Gfx D_090027F0_409870 []
 
Gfx * D_E011C500 []
 
Gfx * D_E011C514 [] = { D_09002400_409480 }
 
s32 D_E011C518 [] = { 1, 1, 2, 2, 2 }
 
s32 D_E011C52C [] = { 3, 3, 4, 4 }
 

Function Documentation

◆ quizmo_assistant_init()

void quizmo_assistant_init ( EffectInstance * effect)

Definition at line 60 of file quizmo_assistant.c.

60 {
61}

Referenced by quizmo_assistant_main().

◆ quizmo_assistant_update()

void quizmo_assistant_update ( EffectInstance * effect)

Definition at line 63 of file quizmo_assistant.c.

63 {
65
66 if (effect->flags & FX_INSTANCE_FLAG_DISMISS) {
67 effect->flags &= ~FX_INSTANCE_FLAG_DISMISS;
68 data->vanishTimer = 16;
69 }
70
71 if (data->vanishTimer < 1000) {
72 data->vanishTimer--;
73 }
74
75 data->lifetime++;
76
77 if (data->vanishTimer < 0) {
78 remove_effect(effect);
79 return;
80 }
81
82 if (data->vanishTimer < 16) {
83 data->fadeInAmt = data->vanishTimer * 16;
84 }
85}
#define remove_effect
struct QuizmoAssistantFXData * quizmoAssistant
Definition effects.h:2592
EffectData data
Definition effects.h:2605
@ FX_INSTANCE_FLAG_DISMISS
Definition enums.h:3517

Referenced by quizmo_assistant_main().

◆ quizmo_assistant_render()

void quizmo_assistant_render ( EffectInstance * effect)

Definition at line 87 of file quizmo_assistant.c.

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

Referenced by quizmo_assistant_main().

◆ quizmo_assistant_appendGfx()

void quizmo_assistant_appendGfx ( void * effect)

Definition at line 100 of file quizmo_assistant.c.

100 {
101 QuizmoAssistantFXData* data = ((EffectInstance*)effect)->data.quizmoAssistant;
102 s32 lifetime = data->lifetime;
103 s32 fadeInAmt = data->fadeInAmt;
104 s32 idx;
105 Matrix4f sp18;
106 Matrix4f sp58;
107
108 gDPPipeSync(gMainGfxPos++);
109 gSPSegment(gMainGfxPos++, 0x09, VIRTUAL_TO_PHYSICAL(((EffectInstance*)effect)->graphics->data));
110
111 guTranslateF(sp18, data->pos.x, data->pos.y, data->pos.z);
112 guRotateF(sp58, -gCameras[gCurrentCameraID].curYaw, 0.0f, 1.0f, 0.0f);
113 guMtxCatF(sp58, sp18, sp18);
114 guTranslateF(sp58, 89.5f, 0.0f, 2.0f);
115 guMtxCatF(sp58, sp18, sp18);
116 guScaleF(sp58, 5.0f / 7, 5.0f / 7, 5.0f / 7);
117 guMtxCatF(sp58, sp18, sp18);
119
120 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
121 gDPSetPrimColor(gMainGfxPos++, 0, 0, fadeInAmt, fadeInAmt, fadeInAmt, 255);
122 gSPDisplayList(gMainGfxPos++, D_E011C514[0]);
123
124 switch (data->anim) {
125 case 0:
126 idx = 0;
127 break;
128 case 1:
129 idx = D_E011C518[lifetime % ARRAY_COUNT(D_E011C518)];
130 break;
131 case 2:
132 default:
133 idx = D_E011C52C[lifetime % ARRAY_COUNT(D_E011C52C)];
134 break;
135 }
136
137 gSPDisplayList(gMainGfxPos++, D_E011C500[idx]);
138 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
139 gDPPipeSync(gMainGfxPos++);
140}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
Gfx * D_E011C514[]
s32 D_E011C52C[]
s32 D_E011C518[]
Gfx * D_E011C500[]
#define ARRAY_COUNT(arr)
Definition macros.h:40
#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 quizmo_assistant_render().

◆ quizmo_assistant_main()

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

Definition at line 26 of file quizmo_assistant.c.

26 {
28 EffectInstance* effect;
30 s32 numParts = 1;
31
35 bp.unk_00 = 0;
36 bp.renderUI = NULL;
37 bp.effectID = EFFECT_QUIZMO_ASSISTANT;
38
39 effect = create_effect_instance(&bp);
40 effect->numParts = numParts;
41 data = effect->data.quizmoAssistant = general_heap_malloc(numParts * sizeof(*data));
42 ASSERT(effect->data.quizmoAssistant != NULL);
43
44 data->unk_00 = arg0;
45 data->lifetime = 0;
46 if (arg5 <= 0) {
47 data->vanishTimer = 1000;
48 } else {
49 data->vanishTimer = arg5;
50 }
51 data->fadeInAmt = 255;
52 data->pos.x = arg1;
53 data->pos.y = arg2;
54 data->pos.z = arg3;
55 data->anim = 0;
56
57 return effect;
58}
#define general_heap_malloc
#define create_effect_instance
#define ASSERT(condition)
void quizmo_assistant_render(EffectInstance *effect)
void quizmo_assistant_init(EffectInstance *effect)
void quizmo_assistant_update(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_09002400_409480

Gfx D_09002400_409480[]
extern

◆ D_09002528_4095A8

Gfx D_09002528_4095A8[]
extern

◆ D_090025B8_409638

Gfx D_090025B8_409638[]
extern

◆ D_09002648_4096C8

Gfx D_09002648_4096C8[]
extern

◆ D_090026D8_409758

Gfx D_090026D8_409758[]
extern

◆ D_090027F0_409870

Gfx D_090027F0_409870[]
extern

◆ D_E011C500

Gfx* D_E011C500[]
Initial value:
= {
}
Gfx D_090025B8_409638[]
Gfx D_09002648_4096C8[]
Gfx D_090026D8_409758[]
Gfx D_090027F0_409870[]
Gfx D_09002528_4095A8[]

Definition at line 11 of file quizmo_assistant.c.

Referenced by quizmo_assistant_appendGfx().

◆ D_E011C514

Gfx* D_E011C514[] = { D_09002400_409480 }

Definition at line 16 of file quizmo_assistant.c.

Gfx D_09002400_409480[]

Referenced by quizmo_assistant_appendGfx().

◆ D_E011C518

s32 D_E011C518[] = { 1, 1, 2, 2, 2 }

Definition at line 18 of file quizmo_assistant.c.

18{ 1, 1, 2, 2, 2 };

Referenced by quizmo_assistant_appendGfx().

◆ D_E011C52C

s32 D_E011C52C[] = { 3, 3, 4, 4 }

Definition at line 19 of file quizmo_assistant.c.

19{ 3, 3, 4, 4 };

Referenced by quizmo_assistant_appendGfx().