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

Go to the source code of this file.

Functions

void entity_Tweester_render_inner_whirl (s32 entityIndex)
 
void entity_Tweester_render_outer_whirl (s32 entityIndex)
 
void entity_Tweester_render_face (s32 entityIndex)
 
void entity_Tweester_setupGfx (s32 entityIndex)
 
void entity_Tweester_update_face_anim (Entity *entity)
 
s32 entity_Tweester_has_reached_target (Entity *entity)
 
void entity_Tweester_select_target_point (Entity *entity)
 
void entity_Tweester_move (Entity *entity)
 
void entity_Tweester_idle (Entity *entity)
 
void entity_Tweester_anim_scale (Entity *entity)
 
void entity_Tweester_init (Entity *entity)
 

Variables

u8 Entity_Tweester_FaceAnimationData []
 
unsigned char D_0A000BF0_E57A50 []
 
unsigned char D_0A000FF0_E57E50 []
 
unsigned char D_0A0018A0_E58700 []
 
unsigned char D_0A0014A0_E58300 []
 
Mtx Entity_Tweester_mtxInnerWhirl
 
Mtx Entity_Tweester_mtxOuterWhirl
 
Gfx Entity_Tweester_RenderInnerWhirl []
 
Gfx Entity_Tweester_RenderOuterWhirl []
 
Gfx Entity_Tweester_Render []
 
EntityScript Entity_Tweester_Script
 
EntityModelScript Entity_Tweester_RenderScript = STANDARD_ENTITY_MODEL_SCRIPT(Entity_Tweester_Render, RENDER_MODE_SURFACE_XLU_LAYER1)
 
EntityBlueprint Entity_Tweester
 

Function Documentation

◆ entity_Tweester_render_inner_whirl()

void entity_Tweester_render_inner_whirl ( s32 entityIndex)

Definition at line 25 of file Tweester.c.

25 {
26 Entity* entity = get_entity_by_index(entityIndex);
27 TweesterData* data = entity->dataBuf.tweester;
28 Matrix4f sp18;
29 Matrix4f sp58;
30 Gfx* gfx;
31
32 guMtxL2F(sp18, ENTITY_ADDR(entity, Mtx*, &Entity_Tweester_mtxInnerWhirl));
33 guRotateF(sp58, data->innerWhirlRotY, 0.0f, 1.0f, 0.0f);
34 guMtxCatF(sp58, sp18, sp18);
35 guMtxF2L(sp18, &data->mtxInnerWhirl);
37 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
39 gSPDisplayList(gMainGfxPos++, gfx);
40 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
41}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
struct TweesterData * tweester
#define guRotateF
#define guMtxF2L
#define guMtxCatF
#define ENTITY_ADDR(entity, type, data)
Definition entity.h:64
f32 innerWhirlRotY
Definition entity.h:306
Mtx mtxInnerWhirl
Definition entity.h:308
Entity * get_entity_by_index(s32 index)
Definition entity.c:530
Mtx Entity_Tweester_mtxInnerWhirl
Definition Tweester.c:51
Gfx Entity_Tweester_RenderInnerWhirl[]
Definition Tweester.c:177
EntityData dataBuf
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
DisplayContext * gDisplayContext
Definition cam_main.c:16

Referenced by entity_Tweester_setupGfx().

◆ entity_Tweester_render_outer_whirl()

void entity_Tweester_render_outer_whirl ( s32 entityIndex)

Definition at line 43 of file Tweester.c.

43 {
44 Entity* entity = get_entity_by_index(entityIndex);
45 TweesterData* data = entity->dataBuf.tweester;
46 Matrix4f sp18;
47 Matrix4f sp58;
48 Gfx* gfx;
49
50 guMtxL2F(sp18, ENTITY_ADDR(entity, Mtx*, &Entity_Tweester_mtxOuterWhirl));
51 guRotateF(sp58, data->outerWhirlRotY, 0.0f, 1.0f, 0.0f);
52 guMtxCatF(sp58, sp18, sp18);
53 guMtxF2L(sp18, &data->mtxOuterWhirl);
55 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
57 gSPDisplayList(gMainGfxPos++, gfx);
58 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
59}
f32 outerWhirlRotY
Definition entity.h:307
Mtx mtxOuterWhirl
Definition entity.h:309
Mtx Entity_Tweester_mtxOuterWhirl
Definition Tweester.c:58
Gfx Entity_Tweester_RenderOuterWhirl[]
Definition Tweester.c:122

Referenced by entity_Tweester_setupGfx().

◆ entity_Tweester_render_face()

void entity_Tweester_render_face ( s32 entityIndex)

Definition at line 61 of file Tweester.c.

61 {
62 Entity* entity = get_entity_by_index(entityIndex);
63 TweesterData* data = entity->dataBuf.tweester;
64
65 gDPPipeSync(gMainGfxPos++);
66 gDPSetTextureLUT(gMainGfxPos++, G_TT_RGBA16);
67 gDPLoadTLUT_pal16(gMainGfxPos++, 0, D_0A0018A0_E58700);
68 gSPTexture(gMainGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
69 gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
70 gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
71 gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
72 gDPLoadTextureBlock_4b(gMainGfxPos++, D_0A0014A0_E58300, G_IM_FMT_CI, 64, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_CLAMP, 6, 5, G_TX_NOLOD, G_TX_NOLOD);
73 gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
74 gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
75 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, data->faceAnimTexOffset * 4, 0, (data->faceAnimTexOffset + 124) * 4, 31 * 4);
76}
s8 faceAnimTexOffset
Definition entity.h:304
unsigned char D_0A0014A0_E58300[]
unsigned char D_0A0018A0_E58700[]

Referenced by entity_Tweester_setupGfx().

◆ entity_Tweester_setupGfx()

void entity_Tweester_setupGfx ( s32 entityIndex)

Definition at line 78 of file Tweester.c.

78 {
79 Entity* entity = get_entity_by_index(entityIndex);
80 TweesterData* data = entity->dataBuf.tweester;
81
82 gDPPipeSync(gMainGfxPos++);
83 gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE);
84 gSPTexture(gMainGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
85 gDPSetCombineMode(gMainGfxPos++, PM_CC_ALT_INTERFERENCE, G_CC_MODULATEIA2);
86 gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
87 gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
88 gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 32, D_0A000BF0_E57A50);
89 gDPSetTile(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 4, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
90 gDPLoadSync(gMainGfxPos++);
91 gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE, 0, 0, 0x007C, 0x007C);
92 gDPPipeSync(gMainGfxPos++);
93 gDPSetTile(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 4, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
94 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0, 0, 0x007C, 0x007C);
95 gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 32, D_0A000FF0_E57E50);
96 gDPSetTile(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 4, 0x0080, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
97 gDPLoadSync(gMainGfxPos++);
98 gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE, 0, 0, 0x007C, 0x007C);
99 gDPPipeSync(gMainGfxPos++);
100 gDPSetTile(gMainGfxPos++, G_IM_FMT_I, G_IM_SIZ_8b, 4, 0x0080, 1, 0, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD);
101 gDPSetTileSize(gMainGfxPos++, 1, 0, 0, 0x007C, 0x007C);
102 gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
103 gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
104 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, data->innerWhirlTexOffsetX, data->innerWhirlTexOffsetY, data->innerWhirlTexOffsetX + 124, data->innerWhirlTexOffsetY + 124);
106 gDPPipeSync(gMainGfxPos++);
107 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, data->outerWhirlTexOffsetX, data->outerWhirlTexOffsetY, data->outerWhirlTexOffsetX + 124, data->outerWhirlTexOffsetY + 124);
109 entity_Tweester_render_face(entityIndex);
110}
s16 outerWhirlTexOffsetY
Definition entity.h:313
s16 innerWhirlTexOffsetY
Definition entity.h:311
s16 innerWhirlTexOffsetX
Definition entity.h:310
s16 outerWhirlTexOffsetX
Definition entity.h:312
unsigned char D_0A000FF0_E57E50[]
void entity_Tweester_render_inner_whirl(s32 entityIndex)
Definition Tweester.c:25
void entity_Tweester_render_face(s32 entityIndex)
Definition Tweester.c:61
void entity_Tweester_render_outer_whirl(s32 entityIndex)
Definition Tweester.c:43
unsigned char D_0A000BF0_E57A50[]
#define PM_CC_ALT_INTERFERENCE
Definition macros.h:376

Referenced by entity_Tweester_init().

◆ entity_Tweester_update_face_anim()

void entity_Tweester_update_face_anim ( Entity * entity)

Definition at line 113 of file Tweester.c.

113 {
114 TweesterData* data = entity->dataBuf.tweester;
115 s32 i;
116
117 data->faceAnimTimer--;
118 if (data->faceAnimTimer <= 0) {
119 i = data->faceAnimState;
120 if (Entity_Tweester_FaceAnimationData[i] == 255) {
121 i = 0;
122 }
125 data->faceAnimState = i;
126 }
127}
s8 faceAnimTimer
Definition entity.h:303
s8 faceAnimState
Definition entity.h:302
u8 Entity_Tweester_FaceAnimationData[]
Definition Tweester.c:5

Referenced by entity_Tweester_idle().

◆ entity_Tweester_has_reached_target()

s32 entity_Tweester_has_reached_target ( Entity * entity)

Definition at line 129 of file Tweester.c.

129 {
130 TweesterData* data = entity->dataBuf.tweester;
131 s32 count = 0;
132 f32 deltaX = fabsf(data->targetX - entity->pos.x);
133 f32 deltaZ = fabsf(data->targetZ - entity->pos.z);
134
135 if (deltaX <= 10.0f) {
136 count++;
137 }
138 if (deltaZ <= 10.0f) {
139 count++;
140 }
141
142 return count >= 2;
143}
s16 targetX
Definition entity.h:317
s16 targetZ
Definition entity.h:319
f32 fabsf(f32 f)

Referenced by entity_Tweester_move().

◆ entity_Tweester_select_target_point()

void entity_Tweester_select_target_point ( Entity * entity)

Definition at line 145 of file Tweester.c.

145 {
146 TweesterData* data = entity->dataBuf.tweester;
147 s32 pathOffset;
148 s32** paths;
149 s32 i, j;
150 s32* pathPtr;
151
152 pathOffset = data->pathOffset;
153 paths = data->paths;
154
155 if (pathOffset == 0) {
156 for (i = 0; *paths != PTR_LIST_END; paths++, i++) {
157 }
158 j = rand_int(i * 10 - 1) / 10;
159 paths = data->paths;
160 data->curPath = paths[j];
161 }
162 pathPtr = &data->curPath[pathOffset];
163 if (*pathPtr != TWEESTER_PATH_STOP) {
164 pathOffset += 3;
165 if (*pathPtr == TWEESTER_PATH_LOOP){
166 pathOffset = 0;
167 pathPtr = data->curPath;
168 data->targetX = *pathPtr++;
169 data->targetY = *pathPtr++;
170 data->targetZ = *pathPtr++;
171 } else {
172 data->targetX = *pathPtr++;
173 data->targetY = *pathPtr++;
174 data->targetZ = *pathPtr++;
175 }
176 }
177 data->pathOffset = pathOffset;
178}
#define rand_int
s32 ** paths
Definition entity.h:316
#define TWEESTER_PATH_LOOP
Definition entity.h:70
s16 targetY
Definition entity.h:318
#define TWEESTER_PATH_STOP
Definition entity.h:69
s16 pathOffset
Definition entity.h:320
s32 * curPath
Definition entity.h:315
#define PTR_LIST_END
Definition macros.h:42

Referenced by entity_Tweester_init(), and entity_Tweester_move().

◆ entity_Tweester_move()

void entity_Tweester_move ( Entity * entity)

Definition at line 180 of file Tweester.c.

180 {
181 TweesterData* data = entity->dataBuf.tweester;
182 f32 yawRad;
183
184 f32 temp_f4 = (atan2(entity->pos.x, entity->pos.z, data->targetX, data->targetZ) - data->yaw) * 0.03125f;
185 if (temp_f4 >= 0.0f && temp_f4 < 0.01) {
186 temp_f4 = 0.01f;
187 }
188 if (temp_f4 < 0.0f && temp_f4 > -0.01) {
189 temp_f4 = -0.01f;
190 }
191
192 data->yaw = clamp_angle(data->yaw + temp_f4);
193 yawRad = DEG_TO_RAD(data->yaw);
194 entity->pos.x += sin_rad(yawRad);
195 entity->pos.z -= cos_rad(yawRad);
196
199 }
200}
#define clamp_angle
#define atan2
f32 cos_rad(f32 x)
Definition 43F0.c:717
f32 sin_rad(f32 x)
Definition 43F0.c:713
void entity_Tweester_select_target_point(Entity *entity)
Definition Tweester.c:145
s32 entity_Tweester_has_reached_target(Entity *entity)
Definition Tweester.c:129
#define DEG_TO_RAD(deg)
Definition macros.h:134

Referenced by entity_Tweester_idle().

◆ entity_Tweester_idle()

void entity_Tweester_idle ( Entity * entity)

Definition at line 202 of file Tweester.c.

202 {
203 PlayerStatus* playerStatus = &gPlayerStatus;
204 PartnerStatus* partnerStatus = &gPartnerStatus;
205 PlayerData* playerData = &gPlayerData;
206 TweesterData* data = entity->dataBuf.tweester;
207 f32 delta;
208 f32 targetRotationSpeed;
209
212 !(playerStatus->flags & PS_FLAG_PAUSED) &&
213 (playerData->curPartner != PARTNER_GOOMBARIO ||
214 playerStatus->inputDisabledCount == 0 ||
216 )) {
217 entity_Tweester_move(entity);
218 }
219
221 data->frameCounter++;
222
223 if (data->frameCounter < 100) {
224 targetRotationSpeed = 3.5f;
225 delta = (targetRotationSpeed - data->rotSpeed) / 28.0f;
226 if (delta < 0.02) {
227 delta = 0.02f;
228 }
229 data->rotSpeed += delta;
230 if (data->rotSpeed >= targetRotationSpeed){
231 data->rotSpeed = targetRotationSpeed;
232 }
233 } else {
234 targetRotationSpeed = 1.3f;
235 delta = (targetRotationSpeed - data->rotSpeed) * 0.0625f;
236 if (delta > -0.02) {
237 delta = -0.02f;
238 }
239 data->rotSpeed += delta;
240 if (data->rotSpeed <= targetRotationSpeed){
241 data->rotSpeed = targetRotationSpeed;
242 data->frameCounter = 0;
243 }
244 }
245
246 data->innerWhirlRotY += data->rotSpeed;
247 if (data->innerWhirlRotY > 360.0f) {
248 data->innerWhirlRotY = 0.0f;
249 }
250
251 delta = data->innerWhirlRotY - data->outerWhirlRotY;
252 if (delta < 0.0f) {
253 delta += 360.0f;
254 }
255 delta *= 0.25;
256 data->outerWhirlRotY += delta;
257 if (data->outerWhirlRotY > 360.0f) {
258 data->outerWhirlRotY = 0.0f;
259 }
260
261 data->innerWhirlTexOffsetX += 4;
262 data->innerWhirlTexOffsetY -= 8;
263 data->outerWhirlTexOffsetX += 4;
264 data->outerWhirlTexOffsetY -= 16;
265
266 entity->rot.y = -gCameras[CAM_DEFAULT].curYaw;
267
268 if (partnerStatus->partnerActionState == PARTNER_ACTION_NONE || partnerStatus->actingPartner != PARTNER_BOW) {
269 if (playerStatus->actionState == ACTION_STATE_USE_TWEESTER) {
270 Npc* npc = npc_find_closest_simple(entity->pos.x, entity->pos.y, entity->pos.z, 50.0f);
271 if (npc != NULL && (npc->flags & NPC_FLAG_PARTNER)) {
273 }
274 }
275
276 if (!is_picking_up_item() &&
277 !(playerStatus->flags & PS_FLAG_PAUSED) &&
278 playerStatus->actionState != ACTION_STATE_USE_TWEESTER &&
279 playerStatus->blinkTimer == 0 &&
280 fabs(dist2D(entity->pos.x, entity->pos.z, playerStatus->pos.x, playerStatus->pos.z)) <= 50.0
281 ) {
282 TweesterTouchingPlayer = entity;
285 }
286 }
287}
f32 rotSpeed
Definition entity.h:305
s16 frameCounter
Definition entity.h:314
@ PS_FLAG_PAUSED
Definition enums.h:3040
@ PARTNER_ACTION_NONE
Definition enums.h:2932
@ PA_FLAG_INTERRUPT_USE_PARTNER
forces actions with bow, parakarry, watt, and lakilester to end (sushie not tested)
Definition enums.h:3093
@ TIME_FREEZE_NONE
Definition enums.h:3464
@ PARTNER_BOW
Definition enums.h:2894
@ PARTNER_GOOMBARIO
Definition enums.h:2886
@ ACTION_STATE_USE_TWEESTER
Definition enums.h:2459
@ CAM_DEFAULT
Definition enums.h:1800
@ NPC_FLAG_PARTNER
Definition enums.h:3024
f64 fabs(f64 f)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
Definition 43F0.c:670
s32 is_picking_up_item(void)
void set_action_state(s32 actionState)
Definition 7E9D0.c:209
s32 get_time_freeze_mode(void)
Definition main_loop.c:390
Npc * npc_find_closest_simple(f32 x, f32 y, f32 z, f32 radius)
Finds the closest simple-hitbox NPC to a given point within a radius.
Definition npc.c:1995
void entity_Tweester_update_face_anim(Entity *entity)
Definition Tweester.c:113
void entity_Tweester_move(Entity *entity)
Definition Tweester.c:180
s32 flags
Entity * TweesterTouchingPartner
Definition 7B440.c:5
PartnerStatus gPartnerStatus
Definition partners.c:42
Camera gCameras[4]
Definition cam_main.c:17
PlayerData gPlayerData
Definition 77480.c:40
PlayerStatus gPlayerStatus
Definition 77480.c:39
Entity * TweesterTouchingPlayer
Definition 7B440.c:6

◆ entity_Tweester_anim_scale()

void entity_Tweester_anim_scale ( Entity * entity)

Definition at line 289 of file Tweester.c.

289 {
290 entity->scale.x += 0.1;
291 if (entity->scale.x >= 1.0) {
292 entity->scale.x = 1.0f;
293 }
294 entity->scale.z = entity->scale.y = entity->scale.x;
295}
Vec3f scale

◆ entity_Tweester_init()

void entity_Tweester_init ( Entity * entity)

Definition at line 297 of file Tweester.c.

297 {
298 TweesterData* data = entity->dataBuf.tweester;
299
300 data->paths = (s32**)CreateEntityVarArgBuffer[0];
302 data->faceAnimTexOffset = 0;
304 entity->scale.x = 0;
305 entity->scale.y = 0;
306 entity->scale.z = 0;
307}
s32 CreateEntityVarArgBuffer[]
Definition entity.c:35
void entity_Tweester_setupGfx(s32 entityIndex)
Definition Tweester.c:78
void(* renderSetupFunc)(s32)

Variable Documentation

◆ Entity_Tweester_FaceAnimationData

u8 Entity_Tweester_FaceAnimationData[]
Initial value:
= {
0, 2,
32, 2,
0, 3,
32, 2,
0, 80,
255, 0
}

Definition at line 5 of file Tweester.c.

5 {
6 0, 2,
7 32, 2,
8 0, 3,
9 32, 2,
10 0, 80,
11 255, 0
12};

Referenced by entity_Tweester_update_face_anim().

◆ D_0A000BF0_E57A50

unsigned char D_0A000BF0_E57A50[]
extern

◆ D_0A000FF0_E57E50

unsigned char D_0A000FF0_E57E50[]
extern

◆ D_0A0018A0_E58700

unsigned char D_0A0018A0_E58700[]
extern

◆ D_0A0014A0_E58300

unsigned char D_0A0014A0_E58300[]
extern

◆ Entity_Tweester_mtxInnerWhirl

Mtx Entity_Tweester_mtxInnerWhirl
extern

Definition at line 51 of file Tweester.c.

Referenced by entity_Tweester_render_inner_whirl().

◆ Entity_Tweester_mtxOuterWhirl

Mtx Entity_Tweester_mtxOuterWhirl
extern

Definition at line 58 of file Tweester.c.

Referenced by entity_Tweester_render_outer_whirl().

◆ Entity_Tweester_RenderInnerWhirl

Gfx Entity_Tweester_RenderInnerWhirl[]
extern

Definition at line 177 of file Tweester.c.

177 {
178 gsDPPipeSync(),
179 gsDPSetCycleType(G_CYC_2CYCLE),
180 gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_SURF2),
181 gsSPClearGeometryMode(G_CULL_BACK | G_LIGHTING),
182 gsSPSetGeometryMode(G_SHADING_SMOOTH),
183 gsSPVertex(D_0A000000_E56E60, 31, 0),
184 gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
185 gsSP2Triangles(1, 4, 2, 0, 5, 0, 3, 0),
186 gsSP2Triangles(5, 3, 6, 0, 7, 8, 5, 0),
187 gsSP2Triangles(7, 5, 6, 0, 9, 7, 10, 0),
188 gsSP2Triangles(9, 10, 11, 0, 12, 13, 14, 0),
189 gsSP2Triangles(12, 14, 15, 0, 13, 16, 14, 0),
190 gsSP2Triangles(10, 12, 15, 0, 10, 15, 11, 0),
191 gsSP2Triangles(17, 18, 19, 0, 17, 19, 20, 0),
192 gsSP2Triangles(18, 21, 22, 0, 18, 22, 23, 0),
193 gsSP2Triangles(19, 24, 25, 0, 19, 25, 20, 0),
194 gsSP2Triangles(26, 27, 28, 0, 29, 26, 28, 0),
195 gsSP2Triangles(29, 28, 30, 0, 22, 29, 30, 0),
196 gsSP1Triangle(22, 30, 23, 0),
197 gsSPVertex(&D_0A000000_E56E60[9], 1, 0),
198 gsSPVertex(&D_0A000000_E56E60[21], 1, 1),
199 gsSPVertex(&D_0A000000_E56E60[24], 2, 2),
200 gsSPVertex(&D_0A000000_E56E60[31], 14, 4),
201 gsSPVertex(&D_0A000000_E56E60[47], 14, 18),
202 gsSP2Triangles(1, 4, 13, 0, 1, 13, 18, 0),
203 gsSP2Triangles(2, 5, 19, 0, 2, 19, 3, 0),
204 gsSP2Triangles(5, 20, 19, 0, 6, 0, 16, 0),
205 gsSP2Triangles(6, 16, 21, 0, 7, 8, 22, 0),
206 gsSP2Triangles(7, 22, 23, 0, 8, 9, 24, 0),
207 gsSP2Triangles(8, 24, 22, 0, 9, 25, 24, 0),
208 gsSP2Triangles(4, 10, 7, 0, 4, 7, 23, 0),
209 gsSP2Triangles(10, 6, 17, 0, 10, 17, 26, 0),
210 gsSP2Triangles(11, 12, 27, 0, 11, 27, 28, 0),
211 gsSP2Triangles(12, 29, 27, 0, 13, 11, 28, 0),
212 gsSP2Triangles(13, 28, 18, 0, 14, 30, 31, 0),
213 gsSPVertex(&D_0A000000_E56E60[41], 6, 0),
214 gsSPVertex(&D_0A000000_E56E60[50], 1, 6),
215 gsSPVertex(&D_0A000000_E56E60[55], 1, 7),
216 gsSPVertex(&D_0A000000_E56E60[60], 5, 8),
217 gsSP2Triangles(1, 0, 8, 0, 1, 8, 9, 0),
218 gsSP2Triangles(2, 1, 9, 0, 2, 9, 6, 0),
219 gsSP2Triangles(3, 4, 10, 0, 3, 10, 7, 0),
220 gsSP2Triangles(4, 5, 11, 0, 4, 11, 10, 0),
221 gsSP1Triangle(5, 12, 11, 0),
222 gsSPEndDisplayList(),
223};

Referenced by entity_Tweester_render_inner_whirl().

◆ Entity_Tweester_RenderOuterWhirl

Gfx Entity_Tweester_RenderOuterWhirl[]
extern

Definition at line 122 of file Tweester.c.

122 {
123 gsDPPipeSync(),
124 gsDPSetCycleType(G_CYC_2CYCLE),
125 gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_XLU_SURF2),
126 gsSPClearGeometryMode(G_CULL_BACK | G_LIGHTING),
127 gsSPSetGeometryMode(G_SHADING_SMOOTH),
128 gsSPVertex(D_0A000410_E57270, 31, 0),
129 gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
130 gsSP2Triangles(1, 4, 2, 0, 5, 0, 3, 0),
131 gsSP2Triangles(5, 3, 6, 0, 7, 8, 5, 0),
132 gsSP2Triangles(7, 5, 6, 0, 9, 7, 10, 0),
133 gsSP2Triangles(9, 10, 11, 0, 12, 13, 14, 0),
134 gsSP2Triangles(12, 14, 15, 0, 13, 16, 14, 0),
135 gsSP2Triangles(10, 12, 15, 0, 10, 15, 11, 0),
136 gsSP2Triangles(17, 18, 19, 0, 17, 19, 20, 0),
137 gsSP2Triangles(18, 21, 22, 0, 18, 22, 23, 0),
138 gsSP2Triangles(19, 24, 25, 0, 19, 25, 20, 0),
139 gsSP2Triangles(26, 27, 28, 0, 29, 26, 28, 0),
140 gsSP2Triangles(29, 28, 30, 0, 22, 29, 30, 0),
141 gsSP1Triangle(22, 30, 23, 0),
142 gsSPVertex(&D_0A000410_E57270[9], 1, 0),
143 gsSPVertex(&D_0A000410_E57270[21], 1, 1),
144 gsSPVertex(&D_0A000410_E57270[24], 2, 2),
145 gsSPVertex(&D_0A000410_E57270[31], 14, 4),
146 gsSPVertex(&D_0A000410_E57270[47], 14, 18),
147 gsSP2Triangles(1, 4, 13, 0, 1, 13, 18, 0),
148 gsSP2Triangles(2, 5, 19, 0, 2, 19, 3, 0),
149 gsSP2Triangles(5, 20, 19, 0, 6, 0, 16, 0),
150 gsSP2Triangles(6, 16, 21, 0, 7, 8, 22, 0),
151 gsSP2Triangles(7, 22, 23, 0, 8, 9, 24, 0),
152 gsSP2Triangles(8, 24, 22, 0, 9, 25, 24, 0),
153 gsSP2Triangles(4, 10, 7, 0, 4, 7, 23, 0),
154 gsSP2Triangles(10, 6, 17, 0, 10, 17, 26, 0),
155 gsSP2Triangles(11, 12, 27, 0, 11, 27, 28, 0),
156 gsSP2Triangles(12, 29, 27, 0, 13, 11, 28, 0),
157 gsSP2Triangles(13, 28, 18, 0, 14, 30, 31, 0),
158 gsSPVertex(&D_0A000410_E57270[41], 6, 0),
159 gsSPVertex(&D_0A000410_E57270[50], 1, 6),
160 gsSPVertex(&D_0A000410_E57270[55], 1, 7),
161 gsSPVertex(&D_0A000410_E57270[60], 5, 8),
162 gsSP2Triangles(1, 0, 8, 0, 1, 8, 9, 0),
163 gsSP2Triangles(2, 1, 9, 0, 2, 9, 6, 0),
164 gsSP2Triangles(3, 4, 10, 0, 3, 10, 7, 0),
165 gsSP2Triangles(4, 5, 11, 0, 4, 11, 10, 0),
166 gsSP1Triangle(5, 12, 11, 0),
167 gsSPEndDisplayList(),
168};

Referenced by entity_Tweester_render_outer_whirl().

◆ Entity_Tweester_Render

Gfx Entity_Tweester_Render[]
extern

Definition at line 225 of file Tweester.c.

225 {
226 gsSPDisplayList(D_0A001B50_E589B0),
227 gsSPEndDisplayList(),
228};
Gfx D_0A001B50_E589B0[]
Definition Tweester.c:116

◆ Entity_Tweester_Script

EntityScript Entity_Tweester_Script
Initial value:
={
}
#define es_SetCallback(func, time)
Definition entity.h:38
#define es_End
Definition entity.h:35
void entity_Tweester_idle(Entity *entity)
Definition Tweester.c:202
void entity_Tweester_anim_scale(Entity *entity)
Definition Tweester.c:289

Definition at line 309 of file Tweester.c.

◆ Entity_Tweester_RenderScript

◆ Entity_Tweester

EntityBlueprint Entity_Tweester
Initial value:
= {
.typeDataSize = sizeof(TweesterData),
.renderCommandList = Entity_Tweester_RenderScript,
.modelAnimationNodes = 0,
.updateEntityScript = Entity_Tweester_Script,
.fpHandleCollision = NULL,
{ .dma = ENTITY_ROM(Tweester) },
.entityType = ENTITY_TYPE_TWEESTER,
.aabbSize = { 50, 70, 50 }
}
#define ENTITY_ROM(name)
Definition entity.h:65
@ ENTITY_TYPE_TWEESTER
Definition enums.h:2597
@ ENTITY_FLAG_DISABLE_COLLISION
Definition enums.h:2618
EntityScript Entity_Tweester_Script
Definition Tweester.c:309
void entity_Tweester_init(Entity *entity)
Definition Tweester.c:297
EntityModelScript Entity_Tweester_RenderScript
Definition Tweester.c:315

Definition at line 317 of file Tweester.c.

317 {
319 .typeDataSize = sizeof(TweesterData),
320 .renderCommandList = Entity_Tweester_RenderScript,
321 .modelAnimationNodes = 0,
322 .fpInit = entity_Tweester_init,
323 .updateEntityScript = Entity_Tweester_Script,
324 .fpHandleCollision = NULL,
325 { .dma = ENTITY_ROM(Tweester) },
326 .entityType = ENTITY_TYPE_TWEESTER,
327 .aabbSize = { 50, 70, 50 }
328};