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

Go to the source code of this file.

Functions

void entity_WoodenCrate_setupGfx (s32)
 
void entity_WoodenCrate_init_fragments (Entity *entity, Gfx **dlists, Mtx *matrices)
 
void entity_WoodenCrate_init (Entity *entity)
 
void entity_WoodenCrate_reset_fragments (Entity *entity)
 
void entity_WoodenCrate_update_fragments (Entity *entity)
 
s32 entity_WoodenCrate_idle (Entity *entity)
 
f32 player_get_camera_facing_angle (void)
 
void entity_WoodenCrate_shatter (Entity *entity, f32 arg1)
 

Variables

Gfx Entity_RenderNone []
 
Gfx Entity_WoodenCrate_Render []
 
Gfx * Entity_WoodenCrate_FragmentsRender []
 
Mtx Entity_WoodenCrate_FragmentsMatrices []
 
s32 Entity_WoodenCrate_RenderShatteredScript [] = STANDARD_ENTITY_MODEL_SCRIPT(Entity_RenderNone, RENDER_MODE_SURFACE_XLU_LAYER1)
 
EntityModelScript Entity_WoodenCrate_RenderScript = STANDARD_ENTITY_MODEL_SCRIPT(Entity_WoodenCrate_Render, RENDER_MODE_SURFACE_OPA)
 
EntityScript Entity_WoodenCrate_Script
 
EntityBlueprint Entity_WoodenCrate
 

Function Documentation

◆ entity_WoodenCrate_setupGfx()

void entity_WoodenCrate_setupGfx ( s32 entityIndex)

Definition at line 179 of file WoodenCrate.c.

179 {
180 s32 i;
181 Matrix4f mtxTransInv;
182 Matrix4f mtx;
183 Matrix4f mtxRotX;
184 Matrix4f mtxRotY;
185 f32 x_inv;
186 f32 y_inv;
187 f32 z_inv;
188 Gfx* gfxPos = gMainGfxPos;
189 Entity* entity = get_entity_by_index(entityIndex);
190 WoodenCrateData* data = entity->dataBuf.crate;
191 Gfx* fragmentDlist;
192 Gfx** gfx = data->fragmentsGfx;
193
194 x_inv = -entity->pos.x;
195 y_inv = -entity->pos.y;
196 z_inv = -entity->pos.z;
197
198 for (i = 0; i < 35; i++) {
199 if (data->fragmentRebounds[i] < 2) {
200 gDPSetRenderMode(gfxPos++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
201 gDPSetCombineMode(gfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
202 } else {
203 gDPSetCombineMode(gfxPos++, PM_CC_11, PM_CC_12);
204 gDPSetPrimColor(gfxPos++, 0, 0, 0, 0, 0, data->fragmentMoveAngle[i]);
205 }
206
207 guTranslateF(mtxTransInv, x_inv, y_inv, z_inv);
208 guRotateF(mtxRotX, data->fragmentRotX[i] * 360.0f / 256, 1.0f, 0.0f, 0.0f);
209 guRotateF(mtxRotY, data->fragmentRotY[i] * 360.0f / 256, 0.0f, 1.0f, 0.0f);
210 guMtxCatF(mtxRotX, mtxRotY, mtxRotY);
211 guMtxCatF(mtxRotY, mtxTransInv, mtxTransInv);
212 guTranslateF(mtx, data->fragmentPosX[i], data->fragmentPosY[i], data->fragmentPosZ[i]);
213 guMtxCatF(mtxTransInv, mtx, mtx);
215
216 gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
217 fragmentDlist = ENTITY_ADDR(entity, Gfx*, *gfx++);
218 gSPDisplayList(gfxPos++, fragmentDlist);
219 gSPPopMatrix(gfxPos++, G_MTX_MODELVIEW);
220 }
221
222 gMainGfxPos = gfxPos;
223}
struct WoodenCrateData * crate
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
u8 fragmentRotY[36]
Definition entity.h:182
#define ENTITY_ADDR(entity, type, data)
Definition entity.h:64
s8 fragmentRebounds[36]
Definition entity.h:179
f32 fragmentPosY[36]
Definition entity.h:186
f32 fragmentPosZ[36]
Definition entity.h:187
f32 fragmentPosX[36]
Definition entity.h:185
u8 fragmentMoveAngle[36]
Definition entity.h:180
Gfx ** fragmentsGfx
Definition entity.h:177
u8 fragmentRotX[36]
Definition entity.h:181
Entity * get_entity_by_index(s32 index)
Definition entity.c:530
#define PM_CC_11
Definition macros.h:294
#define PM_CC_12
Definition macros.h:295
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_WoodenCrate_init_fragments().

◆ entity_WoodenCrate_init_fragments()

void entity_WoodenCrate_init_fragments ( Entity * entity,
Gfx ** dlists,
Mtx * matrices )

Definition at line 20 of file WoodenCrate.c.

20 {
21 WoodenCrateData* data = entity->dataBuf.crate;
22 Matrix4f mtxFragment;
23 Matrix4f mtxTrans;
24 s32 i;
25 s32 rotationSpeed;
26
27 data->fragmentsGfx = ENTITY_ADDR(entity, Gfx**, dlists);
29 entity->alpha = 255;
30 entity->pos.y = data->basePosY;
31 guTranslateF(mtxTrans, entity->pos.x, entity->pos.y, entity->pos.z);
32
33 for (i = 0; i < 35; i++) {
34 guMtxL2F(mtxFragment, ENTITY_ADDR(entity, Mtx*, matrices++));
35 guMtxCatF(mtxTrans, mtxFragment, mtxFragment);
36 data->fragmentPosX[i] = mtxFragment[3][0];
37 data->fragmentPosY[i] = mtxFragment[3][1];
38 data->fragmentPosZ[i] = mtxFragment[3][2];
39 data->fragmentMoveAngle[i] = -rand_int(255);
40 data->fragmentLateralSpeed[i] = 20;
41
42 rotationSpeed = rand_int(5);
43 if (i % 2 != 0) {
44 data->fragmentRotSpeed[i] = rotationSpeed + 10;
45 } else {
46 data->fragmentRotSpeed[i] = -10 - rotationSpeed;
47 }
48
49 data->fragmentFallSpeed[i] = 10.0f;
50 data->fragmentRebounds[i] = 0;
51 data->fragmentRotX[i] = 0;
52 data->fragmentRotY[i] = 0;
53 }
54}
void entity_WoodenCrate_setupGfx(s32)
#define rand_int
f32 fragmentFallSpeed[36]
Definition entity.h:188
u8 fragmentLateralSpeed[36]
Definition entity.h:183
f32 fragmentRotSpeed[36]
Definition entity.h:184
void(* renderSetupFunc)(s32)

Referenced by entity_WoodenCrate_reset_fragments().

◆ entity_WoodenCrate_init()

void entity_WoodenCrate_init ( Entity * entity)

Definition at line 56 of file WoodenCrate.c.

56 {
57 WoodenCrateData* data = entity->dataBuf.crate;
58
59 entity->scale.y = 0.85714287f;
61 data->globalFlagIndex = 0xFFFF;
62}
s32 CreateEntityVarArgBuffer[]
Definition entity.c:35
u16 globalFlagIndex
Definition entity.h:175
Vec3f scale

◆ entity_WoodenCrate_reset_fragments()

void entity_WoodenCrate_reset_fragments ( Entity * entity)

Definition at line 64 of file WoodenCrate.c.

64 {
65 WoodenCrateData* data = entity->dataBuf.crate;
66
67 data->basePosY = entity->pos.y;
69}
Mtx Entity_WoodenCrate_FragmentsMatrices[]
Definition WoodenCrate.c:36
Gfx * Entity_WoodenCrate_FragmentsRender[]
void entity_WoodenCrate_init_fragments(Entity *entity, Gfx **dlists, Mtx *matrices)
Definition WoodenCrate.c:20

Referenced by entity_WoodenCrate_idle().

◆ entity_WoodenCrate_update_fragments()

void entity_WoodenCrate_update_fragments ( Entity * entity)

Definition at line 71 of file WoodenCrate.c.

71 {
72 WoodenCrateData* data = entity->dataBuf.crate;
73 f32 rotSpeed, lateralSpeed, reboundSpeed;
74 f32 moveAngle, yawRad;
75 s32 i;
76 s32 numFragmentsDisappeared;
77 f32 hitX, hitY, hitZ, hitDepth;
78
79 numFragmentsDisappeared = 0;
80 rotSpeed = 0.0f;
81 reboundSpeed = 0.0f;
82 lateralSpeed = 0.0f;
83
84 for (i = 0; i < 35; i++) {
85 switch (data->fragmentRebounds[i]) {
86 case 0:
87 reboundSpeed = 2.0f;
88 rotSpeed = data->fragmentRotSpeed[i];
89 lateralSpeed = data->fragmentLateralSpeed[i] / 10.0f;
90 if (rotSpeed >= 0.0f) {
91 data->fragmentRotSpeed[i] = rotSpeed - 0.4;
92 } else {
93 data->fragmentRotSpeed[i] = rotSpeed + 0.5;
94 }
95 break;
96 case 1:
97 lateralSpeed = 1.0f;
98 reboundSpeed = 0.0f;
99 rotSpeed = data->fragmentRotSpeed[i] * 0.25f;
100 break;
101 case 2:
102 data->fragmentRotSpeed[i] += 1.0f;
103 if (data->fragmentRotSpeed[i] > 20.0f) {
104 data->fragmentRotSpeed[i] = 20.0f;
105 }
106
107 data->fragmentPosY[i] -= data->fragmentRotSpeed[i] / 70.0f;
108
109 data->fragmentMoveAngle[i] -= 5;
110 if (data->fragmentMoveAngle[i] <= 5) {
111 data->fragmentMoveAngle[i] = 0;
112 data->fragmentRebounds[i]++;
113 }
114 break;
115 case 3:
116 numFragmentsDisappeared++;
117 break;
118 }
119
120 if (data->fragmentRebounds[i] < 2) {
121 if (data->fragmentFallSpeed[i] >= 0.0f) {
122 data->fragmentFallSpeed[i] -= 0.8;
123 if (data->fragmentFallSpeed[i] < -10.2) {
124 data->fragmentFallSpeed[i] = -10.2f;
125 }
126 } else {
127 data->fragmentFallSpeed[i] -= 1.6;
128 if (data->fragmentFallSpeed[i] < -10.2) {
129 data->fragmentFallSpeed[i] = -10.2f;
130 }
131 }
132
133 data->fragmentPosY[i] += data->fragmentFallSpeed[i];
134 yawRad = data->fragmentMoveAngle[i] * 360.0f / 256;
135 moveAngle = DEG_TO_RAD(yawRad);
136 data->fragmentPosX[i] += lateralSpeed * sin_rad(moveAngle);
137 data->fragmentPosZ[i] += lateralSpeed * cos_rad(moveAngle);
138
139 hitX = data->fragmentPosX[i];
140 hitY = data->fragmentPosY[i];
141 hitZ = data->fragmentPosZ[i];
142 if (npc_test_move_taller_with_slipping(COLLISION_IGNORE_ENTITIES, &hitX, &hitY, &hitZ, lateralSpeed, yawRad, 8.0f, 8.0f)) {
143 data->fragmentPosX[i] = hitX;
144 data->fragmentPosY[i] = hitY;
145 data->fragmentPosZ[i] = hitZ;
146 data->fragmentMoveAngle[i] += 0x80; // inverse yaw
147
148 moveAngle = DEG_TO_RAD(data->fragmentMoveAngle[i] * 360.0f / 256);
149 lateralSpeed = 8.0f;
150 data->fragmentPosX[i] += lateralSpeed * sin_rad(moveAngle);
151 data->fragmentPosZ[i] += lateralSpeed * cos_rad(moveAngle);
152
153 }
154
155 hitX = data->fragmentPosX[i];
156 hitY = data->fragmentPosY[i] + 8.0f;
157 hitZ = data->fragmentPosZ[i];
158 hitDepth = fabsf(data->fragmentFallSpeed[i]);
159 if (npc_raycast_down_sides(COLLISION_IGNORE_ENTITIES, &hitX, &hitY, &hitZ, &hitDepth) || hitY < data->basePosY - 200.0f) {
160 data->fragmentRebounds[i]++;
161 data->fragmentPosY[i] = hitY + fabsf(data->fragmentFallSpeed[i]);
162 data->fragmentFallSpeed[i] = reboundSpeed;
163 if (data->fragmentRebounds[i] == 2) {
164 data->fragmentMoveAngle[i] = 254;
165 data->fragmentRotSpeed[i] = 0.0f;
166 }
167 }
168
169 data->fragmentRotX[i] += rotSpeed;
170 data->fragmentRotY[i] -= rotSpeed;
171 }
172 }
173
174 if (numFragmentsDisappeared >= 35) {
176 }
177}
#define npc_raycast_down_sides
@ COLLISION_IGNORE_ENTITIES
Definition enums.h:4698
f32 fabsf(f32 f)
f32 cos_rad(f32 x)
Definition 43F0.c:717
b32 npc_test_move_taller_with_slipping(s32, f32 *, f32 *, f32 *, f32, f32, f32, f32)
void exec_entity_commandlist(Entity *entity)
Definition entity.c:313
f32 sin_rad(f32 x)
Definition 43F0.c:713
#define DEG_TO_RAD(deg)
Definition macros.h:134

◆ entity_WoodenCrate_idle()

s32 entity_WoodenCrate_idle ( Entity * entity)

Definition at line 225 of file WoodenCrate.c.

225 {
226 PlayerStatus* playerStatus = &gPlayerStatus;
227 s32 shouldBreak = FALSE;
228
230 if ((playerStatus->actionState == ACTION_STATE_SPIN_POUND)
231 || (playerStatus->actionState == ACTION_STATE_TORNADO_POUND)) {
233 shouldBreak = TRUE;
234 }
235 }
236
237 if (shouldBreak) {
240 entity_start_script(entity);
243 }
244}
void entity_WoodenCrate_reset_fragments(Entity *entity)
Definition WoodenCrate.c:64
s32 Entity_WoodenCrate_RenderShatteredScript[]
void entity_set_render_script(Entity *entity, EntityModelScript *cmdList)
Definition entity.c:761
@ ENTITY_COLLISION_PLAYER_TOUCH_FLOOR
Definition enums.h:2648
@ SOUND_BREAK_CRATE
Definition enums.h:1463
@ ACTION_STATE_SPIN_POUND
Definition enums.h:2442
@ ACTION_STATE_TORNADO_POUND
Definition enums.h:2444
@ ACTION_STATE_FALLING
Definition enums.h:2435
s32 entity_start_script(Entity *entity)
Definition entity.c:560
void set_action_state(s32 actionState)
Definition 7E9D0.c:209
void sfx_play_sound(s32 soundID)
Definition sfx.c:517
u8 collisionFlags
PlayerStatus gPlayerStatus
Definition 77480.c:39

◆ player_get_camera_facing_angle()

f32 player_get_camera_facing_angle ( void )

Definition at line 1191 of file 7BB60.c.

1191 {
1192 f32 angle = 0.0f;
1193
1195 angle = 180.0f;
1196 }
1197
1198 angle = angle + gCameras[CAM_DEFAULT].curYaw + 90.0f;
1199
1200 return clamp_angle(angle);
1201}
#define clamp_angle
@ CAM_DEFAULT
Definition enums.h:1800
Camera gCameras[4]
Definition cam_main.c:17

Referenced by entity_WoodenCrate_shatter().

◆ entity_WoodenCrate_shatter()

void entity_WoodenCrate_shatter ( Entity * entity,
f32 arg1 )

Definition at line 248 of file WoodenCrate.c.

248 {
249 WoodenCrateData* data = entity->dataBuf.crate;
250
251 if (data->itemID != -1) {
252 s32 flag = FALSE;
253
254 if (data->globalFlagIndex == 0xFFFF) {
255 flag = TRUE;
256 } else if (!get_global_flag(data->globalFlagIndex)) {
257 flag = TRUE;
258 }
259
260 if (flag) {
261 make_item_entity(data->itemID, entity->pos.x, entity->pos.y + 33.0, entity->pos.z,
263 }
264 }
265}
f32 player_get_camera_facing_angle(void)
Definition 7BB60.c:1191
@ ITEM_SPAWN_MODE_ITEM_BLOCK_ITEM
Definition enums.h:2301
s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 angle, s32 pickupVar)
s32 get_global_flag(s32 index)
Definition vars_access.c:89

Variable Documentation

◆ Entity_RenderNone

Gfx Entity_RenderNone[]
extern

Definition at line 69 of file Shadow.c.

69 {
70 gsSPEndDisplayList(),
71};

◆ Entity_WoodenCrate_Render

Gfx Entity_WoodenCrate_Render[]
extern

Definition at line 1386 of file WoodenCrate.c.

1386 {
1387 gsSPDisplayList(D_0A004268_E558A8),
1388 gsSPDisplayList(D_0A004140_E55780),
1389 gsSPEndDisplayList(),
1390};
Gfx D_0A004140_E55780[]
Gfx D_0A004268_E558A8[]

◆ Entity_WoodenCrate_FragmentsRender

Gfx* Entity_WoodenCrate_FragmentsRender[]
extern

Definition at line 1392 of file WoodenCrate.c.

1392 {
1435};
Gfx D_0A003488_E54AC8[]
Gfx D_0A003590_E54BD0[]
Gfx D_0A003A80_E550C0[]
Gfx D_0A003D68_E553A8[]
Gfx D_0A003F70_E555B0[]
Gfx D_0A0036B0_E54CF0[]
Gfx D_0A003700_E54D40[]
Gfx D_0A003600_E54C40[]
Gfx D_0A003750_E54D90[]
Gfx D_0A003878_E54EB8[]
Gfx D_0A0037A0_E54DE0[]
Gfx D_0A003BF0_E55230[]
Gfx D_0A003978_E54FB8[]
Gfx D_0A003658_E54C98[]
Gfx D_0A003E18_E55458[]
Gfx D_0A003CF8_E55338[]
Gfx D_0A0040E0_E55720[]
Gfx D_0A004090_E556D0[]
Gfx D_0A0039C8_E55008[]
Gfx D_0A003AF0_E55130[]
Gfx D_0A003A18_E55058[]
Gfx D_0A003928_E54F68[]
Gfx D_0A003E68_E554A8[]
Gfx D_0A003F08_E55548[]
Gfx D_0A003B48_E55188[]
Gfx D_0A003EB8_E554F8[]
Gfx D_0A0038D0_E54F10[]
Gfx D_0A003528_E54B68[]
Gfx D_0A003DC0_E55400[]
Gfx D_0A004130_E55770[]
Gfx D_0A004038_E55678[]
Gfx D_0A003438_E54A78[]
Gfx D_0A003C90_E552D0[]
Gfx D_0A003808_E54E48[]
Gfx D_0A003388_E549C8[]
Gfx D_0A003C40_E55280[]
Gfx D_0A003BA0_E551E0[]
Gfx D_0A0033E0_E54A20[]
Gfx D_0A0034D8_E54B18[]
Gfx D_0A003318_E54958[]
Gfx D_0A003FE0_E55620[]
Gfx D_0A0032B0_E548F0[]

Referenced by entity_WoodenCrate_reset_fragments().

◆ Entity_WoodenCrate_FragmentsMatrices

Mtx Entity_WoodenCrate_FragmentsMatrices[]
extern

Definition at line 36 of file WoodenCrate.c.

36 {
37 {
38 .m = {
39 { 0x00010000, 0x00000000,
40 0x00000001, 0x00000000 },
41 { 0x00000000, 0x00010000,
42 0xFFF5001E, 0x000F0001 },
43 { 0x00000000, 0x00000000,
44 0x00000000, 0x00000000 },
45 { 0x00000000, 0x00000000,
46 0xC000A000, 0x00000000 }
47 }
48 },
49 {
50 .m = {
51 { 0x00010000, 0x00000000,
52 0x00000001, 0x00000000 },
53 { 0x00000000, 0x00010000,
54 0x0006001E, 0x000F0001 },
55 { 0x00000000, 0x00000000,
56 0x00000000, 0x00000000 },
57 { 0x00000000, 0x00000000,
58 0x4000A000, 0x00000000 }
59 }
60 },
61 {
62 .m = {
63 { 0x00010000, 0x00000000,
64 0x00000001, 0x00000000 },
65 { 0x00000000, 0x00010000,
66 0xFFF40015, 0x000F0001 },
67 { 0x00000000, 0x00000000,
68 0x00000000, 0x00000000 },
69 { 0x00000000, 0x00000000,
70 0xC71CE000, 0x00000000 }
71 }
72 },
73 {
74 .m = {
75 { 0x00010000, 0x00000000,
76 0x00000001, 0x00000000 },
77 { 0x00000000, 0x00010000,
78 0x00050015, 0x000F0001 },
79 { 0x00000000, 0x00000000,
80 0x00000000, 0x00000000 },
81 { 0x00000000, 0x00000000,
82 0x471CE000, 0x00000000 }
83 }
84 },
85 {
86 .m = {
87 { 0x00010000, 0x00000000,
88 0x00000001, 0x00000000 },
89 { 0x00000000, 0x00010000,
90 0xFFF6000A, 0x000F0001 },
91 { 0x00000000, 0x00000000,
92 0x00000000, 0x00000000 },
93 { 0x00000000, 0x00000000,
94 0xEAABD555, 0x00000000 }
95 }
96 },
97 {
98 .m = {
99 { 0x00010000, 0x00000000,
100 0x00000001, 0x00000000 },
101 { 0x00000000, 0x00010000,
102 0x0006000B, 0x000F0001 },
103 { 0x00000000, 0x00000000,
104 0x00000000, 0x00000000 },
105 { 0x00000000, 0x00000000,
106 0x92F7F1C7, 0x00000000 }
107 }
108 },
109 {
110 .m = {
111 { 0x00010000, 0x00000000,
112 0x00000001, 0x00000000 },
113 { 0x00000000, 0x00010000,
114 0xFFFE0002, 0x000F0001 },
115 { 0x00000000, 0x00000000,
116 0x00000000, 0x00000000 },
117 { 0x00000000, 0x00000000,
118 0x80008000, 0x00000000 }
119 }
120 },
121 {
122 .m = {
123 { 0x00010000, 0x00000000,
124 0x00000001, 0x00000000 },
125 { 0x00000000, 0x00010000,
126 0xFFF50023, 0xFFF10001 },
127 { 0x00000000, 0x00000000,
128 0x00000000, 0x00000000 },
129 { 0x00000000, 0x00000000,
130 0xC0000000, 0x60000000 }
131 }
132 },
133 {
134 .m = {
135 { 0x00010000, 0x00000000,
136 0x00000001, 0x00000000 },
137 { 0x00000000, 0x00010000,
138 0x00060023, 0xFFF10001 },
139 { 0x00000000, 0x00000000,
140 0x00000000, 0x00000000 },
141 { 0x00000000, 0x00000000,
142 0x40000000, 0x60000000 }
143 }
144 },
145 {
146 .m = {
147 { 0x00010000, 0x00000000,
148 0x00000001, 0x00000000 },
149 { 0x00000000, 0x00010000,
150 0xFFF40023, 0xFFFA0001 },
151 { 0x00000000, 0x00000000,
152 0x00000000, 0x00000000 },
153 { 0x00000000, 0x00000000,
154 0xC71C0000, 0x20000000 }
155 }
156 },
157 {
158 .m = {
159 { 0x00010000, 0x00000000,
160 0x00000001, 0x00000000 },
161 { 0x00000000, 0x00010000,
162 0x00050023, 0xFFFA0001 },
163 { 0x00000000, 0x00000000,
164 0x00000000, 0x00000000 },
165 { 0x00000000, 0x00000000,
166 0x471C0000, 0x20000000 }
167 }
168 },
169 {
170 .m = {
171 { 0x00010000, 0x00000000,
172 0x00000001, 0x00000000 },
173 { 0x00000000, 0x00010000,
174 0xFFF60023, 0x00040001 },
175 { 0x00000000, 0x00000000,
176 0x00000000, 0x00000000 },
177 { 0x00000000, 0x00000000,
178 0xEAAB0000, 0x2AAB0000 }
179 }
180 },
181 {
182 .m = {
183 { 0x00010000, 0x00000000,
184 0x00000001, 0x00000000 },
185 { 0x00000000, 0x00010000,
186 0x00060023, 0x00030001 },
187 { 0x00000000, 0x00000000,
188 0x00000000, 0x00000000 },
189 { 0x00000000, 0x00000000,
190 0x92F70000, 0x0E390000 }
191 }
192 },
193 {
194 .m = {
195 { 0x00010000, 0x00000000,
196 0x00000001, 0x00000000 },
197 { 0x00000000, 0x00010000,
198 0xFFFE0023, 0x000C0001 },
199 { 0x00000000, 0x00000000,
200 0x00000000, 0x00000000 },
201 { 0x00000000, 0x00000000,
202 0x80000000, 0x80000000 }
203 }
204 },
205 {
206 .m = {
207 { 0x00010000, 0x00000000,
208 0x00000001, 0x00000000 },
209 { 0x00000000, 0x00010000,
210 0xFFEC001E, 0xFFF50001 },
211 { 0x00000000, 0x00000000,
212 0x00000000, 0x00000000 },
213 { 0x00000000, 0x00000000,
214 0x0000A000, 0xC0000000 }
215 }
216 },
217 {
218 .m = {
219 { 0x00010000, 0x00000000,
220 0x00000001, 0x00000000 },
221 { 0x00000000, 0x00010000,
222 0xFFEC001E, 0x00060001 },
223 { 0x00000000, 0x00000000,
224 0x00000000, 0x00000000 },
225 { 0x00000000, 0x00000000,
226 0x0000A000, 0x40000000 }
227 }
228 },
229 {
230 .m = {
231 { 0x00010000, 0x00000000,
232 0x00000001, 0x00000000 },
233 { 0x00000000, 0x00010000,
234 0xFFEC0015, 0xFFF40001 },
235 { 0x00000000, 0x00000000,
236 0x00000000, 0x00000000 },
237 { 0x00000000, 0x00000000,
238 0x0000E000, 0xC71C0000 }
239 }
240 },
241 {
242 .m = {
243 { 0x00010000, 0x00000000,
244 0x00000001, 0x00000000 },
245 { 0x00000000, 0x00010000,
246 0xFFEC0015, 0x00050001 },
247 { 0x00000000, 0x00000000,
248 0x00000000, 0x00000000 },
249 { 0x00000000, 0x00000000,
250 0x0000E000, 0x471C0000 }
251 }
252 },
253 {
254 .m = {
255 { 0x00010000, 0x00000000,
256 0x00000001, 0x00000000 },
257 { 0x00000000, 0x00010000,
258 0xFFEC000A, 0xFFF60001 },
259 { 0x00000000, 0x00000000,
260 0x00000000, 0x00000000 },
261 { 0x00000000, 0x00000000,
262 0x0000D555, 0xEAAB0000 }
263 }
264 },
265 {
266 .m = {
267 { 0x00010000, 0x00000000,
268 0x00000001, 0x00000000 },
269 { 0x00000000, 0x00010000,
270 0xFFEC000B, 0x00060001 },
271 { 0x00000000, 0x00000000,
272 0x00000000, 0x00000000 },
273 { 0x00000000, 0x00000000,
274 0x0000F1C7, 0x92F70000 }
275 }
276 },
277 {
278 .m = {
279 { 0x00010000, 0x00000000,
280 0x00000001, 0x00000000 },
281 { 0x00000000, 0x00010000,
282 0xFFEC0002, 0xFFFE0001 },
283 { 0x00000000, 0x00000000,
284 0x00000000, 0x00000000 },
285 { 0x00000000, 0x00000000,
286 0x00008000, 0x80000000 }
287 }
288 },
289 {
290 .m = {
291 { 0x00010000, 0x00000000,
292 0x00000001, 0x00000000 },
293 { 0x00000000, 0x00010000,
294 0x000F001E, 0xFFF50001 },
295 { 0x00000000, 0x00000000,
296 0x00000000, 0x00000000 },
297 { 0x00000000, 0x00000000,
298 0x0000A000, 0xC0000000 }
299 }
300 },
301 {
302 .m = {
303 { 0x00010000, 0x00000000,
304 0x00000001, 0x00000000 },
305 { 0x00000000, 0x00010000,
306 0x000F001E, 0x00060001 },
307 { 0x00000000, 0x00000000,
308 0x00000000, 0x00000000 },
309 { 0x00000000, 0x00000000,
310 0x0000A000, 0x40000000 }
311 }
312 },
313 {
314 .m = {
315 { 0x00010000, 0x00000000,
316 0x00000001, 0x00000000 },
317 { 0x00000000, 0x00010000,
318 0x000F0015, 0xFFF40001 },
319 { 0x00000000, 0x00000000,
320 0x00000000, 0x00000000 },
321 { 0x00000000, 0x00000000,
322 0x0000E000, 0xC71C0000 }
323 }
324 },
325 {
326 .m = {
327 { 0x00010000, 0x00000000,
328 0x00000001, 0x00000000 },
329 { 0x00000000, 0x00010000,
330 0x000F0015, 0x00050001 },
331 { 0x00000000, 0x00000000,
332 0x00000000, 0x00000000 },
333 { 0x00000000, 0x00000000,
334 0x0000E000, 0x471C0000 }
335 }
336 },
337 {
338 .m = {
339 { 0x00010000, 0x00000000,
340 0x00000001, 0x00000000 },
341 { 0x00000000, 0x00010000,
342 0x000F000A, 0xFFF60001 },
343 { 0x00000000, 0x00000000,
344 0x00000000, 0x00000000 },
345 { 0x00000000, 0x00000000,
346 0x0000D555, 0xEAAB0000 }
347 }
348 },
349 {
350 .m = {
351 { 0x00010000, 0x00000000,
352 0x00000001, 0x00000000 },
353 { 0x00000000, 0x00010000,
354 0x000F000B, 0x00060001 },
355 { 0x00000000, 0x00000000,
356 0x00000000, 0x00000000 },
357 { 0x00000000, 0x00000000,
358 0x0000F1C7, 0x92F70000 }
359 }
360 },
361 {
362 .m = {
363 { 0x00010000, 0x00000000,
364 0x00000001, 0x00000000 },
365 { 0x00000000, 0x00010000,
366 0x000F0002, 0xFFFE0001 },
367 { 0x00000000, 0x00000000,
368 0x00000000, 0x00000000 },
369 { 0x00000000, 0x00000000,
370 0x00008000, 0x80000000 }
371 }
372 },
373 {
374 .m = {
375 { 0x00010000, 0x00000000,
376 0x00000001, 0x00000000 },
377 { 0x00000000, 0x00010000,
378 0xFFF5001E, 0xFFEC0001 },
379 { 0x00000000, 0x00000000,
380 0x00000000, 0x00000000 },
381 { 0x00000000, 0x00000000,
382 0xC000A000, 0x00000000 }
383 }
384 },
385 {
386 .m = {
387 { 0x00010000, 0x00000000,
388 0x00000001, 0x00000000 },
389 { 0x00000000, 0x00010000,
390 0x0006001E, 0xFFEC0001 },
391 { 0x00000000, 0x00000000,
392 0x00000000, 0x00000000 },
393 { 0x00000000, 0x00000000,
394 0x4000A000, 0x00000000 }
395 }
396 },
397 {
398 .m = {
399 { 0x00010000, 0x00000000,
400 0x00000001, 0x00000000 },
401 { 0x00000000, 0x00010000,
402 0xFFF40015, 0xFFEC0001 },
403 { 0x00000000, 0x00000000,
404 0x00000000, 0x00000000 },
405 { 0x00000000, 0x00000000,
406 0xC71CE000, 0x00000000 }
407 }
408 },
409 {
410 .m = {
411 { 0x00010000, 0x00000000,
412 0x00000001, 0x00000000 },
413 { 0x00000000, 0x00010000,
414 0x00050015, 0xFFEC0001 },
415 { 0x00000000, 0x00000000,
416 0x00000000, 0x00000000 },
417 { 0x00000000, 0x00000000,
418 0x471CE000, 0x00000000 }
419 }
420 },
421 {
422 .m = {
423 { 0x00010000, 0x00000000,
424 0x00000001, 0x00000000 },
425 { 0x00000000, 0x00010000,
426 0xFFF6000A, 0xFFEC0001 },
427 { 0x00000000, 0x00000000,
428 0x00000000, 0x00000000 },
429 { 0x00000000, 0x00000000,
430 0xEAABD555, 0x00000000 }
431 }
432 },
433 {
434 .m = {
435 { 0x00010000, 0x00000000,
436 0x00000001, 0x00000000 },
437 { 0x00000000, 0x00010000,
438 0x0006000B, 0xFFEC0001 },
439 { 0x00000000, 0x00000000,
440 0x00000000, 0x00000000 },
441 { 0x00000000, 0x00000000,
442 0x92F7F1C7, 0x00000000 }
443 }
444 },
445 {
446 .m = {
447 { 0x00010000, 0x00000000,
448 0x00000001, 0x00000000 },
449 { 0x00000000, 0x00010000,
450 0xFFFE0002, 0xFFEC0001 },
451 { 0x00000000, 0x00000000,
452 0x00000000, 0x00000000 },
453 { 0x00000000, 0x00000000,
454 0x80008000, 0x00000000 }
455 }
456 },
457 {
458 .m = {
459 { 0x00010000, 0x00000000,
460 0x00000001, 0x00000000 },
461 { 0x00000000, 0x00010000,
462 0xFFF50000, 0xFFF10001 },
463 { 0x00000000, 0x00000000,
464 0x00000000, 0x00000000 },
465 { 0x00000000, 0x00000000,
466 0xC0000000, 0x60000000 }
467 }
468 },
469 {
470 .m = {
471 { 0x00010000, 0x00000000,
472 0x00000001, 0x00000000 },
473 { 0x00000000, 0x00010000,
474 0x00060000, 0xFFF10001 },
475 { 0x00000000, 0x00000000,
476 0x00000000, 0x00000000 },
477 { 0x00000000, 0x00000000,
478 0x40000000, 0x60000000 }
479 }
480 },
481 {
482 .m = {
483 { 0x00010000, 0x00000000,
484 0x00000001, 0x00000000 },
485 { 0x00000000, 0x00010000,
486 0xFFF40000, 0xFFFA0001 },
487 { 0x00000000, 0x00000000,
488 0x00000000, 0x00000000 },
489 { 0x00000000, 0x00000000,
490 0xC71C0000, 0x20000000 }
491 }
492 },
493 {
494 .m = {
495 { 0x00010000, 0x00000000,
496 0x00000001, 0x00000000 },
497 { 0x00000000, 0x00010000,
498 0x00050000, 0xFFFA0001 },
499 { 0x00000000, 0x00000000,
500 0x00000000, 0x00000000 },
501 { 0x00000000, 0x00000000,
502 0x471C0000, 0x20000000 }
503 }
504 },
505 {
506 .m = {
507 { 0x00010000, 0x00000000,
508 0x00000001, 0x00000000 },
509 { 0x00000000, 0x00010000,
510 0xFFF60000, 0x00040001 },
511 { 0x00000000, 0x00000000,
512 0x00000000, 0x00000000 },
513 { 0x00000000, 0x00000000,
514 0xEAAB0000, 0x2AAB0000 }
515 }
516 },
517 {
518 .m = {
519 { 0x00010000, 0x00000000,
520 0x00000001, 0x00000000 },
521 { 0x00000000, 0x00010000,
522 0x00060000, 0x00030001 },
523 { 0x00000000, 0x00000000,
524 0x00000000, 0x00000000 },
525 { 0x00000000, 0x00000000,
526 0x92F70000, 0x0E390000 }
527 }
528 },
529 {
530 .m = {
531 { 0x00010000, 0x00000000,
532 0x00000001, 0x00000000 },
533 { 0x00000000, 0x00010000,
534 0xFFFE0000, 0x000C0001 },
535 { 0x00000000, 0x00000000,
536 0x00000000, 0x00000000 },
537 { 0x00000000, 0x00000000,
538 0x80000000, 0x80000000 }
539 }
540 },
541 {
542 .m = {
543 { 0x00010000, 0x00000000,
544 0x00000001, 0x00000000 },
545 { 0x00000000, 0x00010000,
546 0xFFEC0011, 0x000F0001 },
547 { 0x00000000, 0x00000000,
548 0x00000000, 0x00000000 },
549 { 0x00000000, 0x00000000,
550 0xC7B18000, 0x384F0000 }
551 }
552 },
553 {
554 .m = {
555 { 0x00010000, 0x00000000,
556 0x00000001, 0x00000000 },
557 { 0x00000000, 0x00010000,
558 0x000F0011, 0x000F0001 },
559 { 0x00000000, 0x00000000,
560 0x00000000, 0x00000000 },
561 { 0x00000000, 0x00000000,
562 0x384F8000, 0x384F0000 }
563 }
564 },
565 {
566 .m = {
567 { 0x00010000, 0x00000000,
568 0x00000001, 0x00000000 },
569 { 0x00000000, 0x00010000,
570 0x000F0011, 0xFFEC0001 },
571 { 0x00000000, 0x00000000,
572 0x00000000, 0x00000000 },
573 { 0x00000000, 0x00000000,
574 0x384F8000, 0xC7B10000 }
575 }
576 },
577 {
578 .m = {
579 { 0x00010000, 0x00000000,
580 0x00000001, 0x00000000 },
581 { 0x00000000, 0x00010000,
582 0xFFEC0011, 0xFFEC0001 },
583 { 0x00000000, 0x00000000,
584 0x00000000, 0x00000000 },
585 { 0x00000000, 0x00000000,
586 0xC7B18000, 0xC7B10000 }
587 }
588 },
589};

Referenced by entity_WoodenCrate_reset_fragments().

◆ Entity_WoodenCrate_RenderShatteredScript

Definition at line 268 of file WoodenCrate.c.

Referenced by entity_WoodenCrate_idle().

◆ Entity_WoodenCrate_RenderScript

◆ Entity_WoodenCrate_Script

EntityScript Entity_WoodenCrate_Script
Initial value:
= {
}
void entity_WoodenCrate_shatter(Entity *entity, f32 arg1)
s32 entity_WoodenCrate_idle(Entity *entity)
void entity_WoodenCrate_update_fragments(Entity *entity)
Definition WoodenCrate.c:71
#define es_Call(func)
Definition entity.h:37
#define es_SetCallback(func, time)
Definition entity.h:38
#define es_SetFlags(flags)
Definition entity.h:43
#define es_End
Definition entity.h:35
@ ENTITY_FLAG_HIDDEN
Definition enums.h:2613
@ ENTITY_FLAG_PENDING_INSTANCE_DELETE
Definition enums.h:2642
@ ENTITY_FLAG_DISABLE_COLLISION
Definition enums.h:2618

Definition at line 270 of file WoodenCrate.c.

◆ Entity_WoodenCrate

EntityBlueprint Entity_WoodenCrate
Initial value:
= {
.typeDataSize = sizeof(WoodenCrateData),
.renderCommandList = Entity_WoodenCrate_RenderScript,
.modelAnimationNodes = 0,
.updateEntityScript = Entity_WoodenCrate_Script,
.fpHandleCollision = NULL,
{ .dma = ENTITY_ROM(WoodenCrate) },
.entityType = ENTITY_TYPE_WOODEN_CRATE,
.aabbSize = { 35, 30, 35 }
}
EntityModelScript Entity_WoodenCrate_RenderScript
EntityScript Entity_WoodenCrate_Script
void entity_WoodenCrate_init(Entity *entity)
Definition WoodenCrate.c:56
#define ENTITY_ROM(name)
Definition entity.h:65
@ ENTITY_TYPE_WOODEN_CRATE
Definition enums.h:2579
@ ENTITY_FLAG_FIXED_SHADOW_SIZE
Definition enums.h:2622
@ ENTITY_FLAG_4000
Definition enums.h:2627

Definition at line 280 of file WoodenCrate.c.

280 {
282 .typeDataSize = sizeof(WoodenCrateData),
283 .renderCommandList = Entity_WoodenCrate_RenderScript,
284 .modelAnimationNodes = 0,
285 .fpInit = entity_WoodenCrate_init,
286 .updateEntityScript = Entity_WoodenCrate_Script,
287 .fpHandleCollision = NULL,
288 { .dma = ENTITY_ROM(WoodenCrate) },
289 .entityType = ENTITY_TYPE_WOODEN_CRATE,
290 .aabbSize = { 35, 30, 35 }
291};