MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / zEntInit

Function zEntInit

src/SB/Game/zEnt.cpp:21–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19#include <PowerPC_EABI_Support\MSL_C\MSL_Common\stdlib.h>
20
21void zEntInit(zEnt* ent, xEntAsset* asset, U32 type)
22{
23 xEntInit(ent, asset);
24 ent->update = (xEntUpdateCallback)zEntUpdate;
25
26 // Surprisingly, this is not a switch statement.
27 if (type == 0x504c5952)
28 {
29 ent->collType = 0x10;
30 ent->collLev = 0x4;
31 ent->bound.type = 0x1;
32 zEntParseModelInfo(ent, asset->modelInfoID);
33 }
34 else if (type == 0x56494c20)
35 {
36 ent->collType = 0x8;
37 ent->collLev = 0x4;
38 ent->bound.type = 0x1;
39 ent->moreFlags = ent->moreFlags | 0x10;
40 zEntParseModelInfo(ent, asset->modelInfoID);
41 }
42 else if (type == 0x4954454d)
43 {
44 ent->collType = 0x2;
45 ent->collLev = 0x4;
46 ent->bound.type = 0x1;
47 ent->eventFunc = NULL;
48 zEntParseModelInfo(ent, asset->modelInfoID);
49 }
50 else if (type == 0x504b5550)
51 {
52 ent->collType = 0;
53 ent->bound.type = 0;
54 }
55 else if (type == 0x504c4154)
56 {
57 ent->collType = 0x4;
58 if (asset->moreFlags & 2)
59 {
60 ent->collLev = 0x5;
61 }
62 else
63 {
64 ent->collLev = 0x4;
65 }
66 zEntParseModelInfo(ent, asset->modelInfoID);
67 ent->bound.type = 0x4;
68 ent->bound.mat = (xMat4x3*)ent->model->Mat;
69 }
70 else if (type == 0x50454e44)
71 {
72 ent->collType = 0x4;
73 if (asset->moreFlags & 2)
74 {
75 ent->collLev = 0x5;
76 }
77 else
78 {

Callers 10

zPendulum_InitFunction · 0.70
zEntTriggerInitFunction · 0.70
zEntSimpleObj_InitFunction · 0.70
zEntButton_InitFunction · 0.70
zEntPlayer_InitFunction · 0.70
zEGenerator_InitFunction · 0.70
zEntPickupInitFunction · 0.70
zEntHangable_InitFunction · 0.70
zEntDestructObj_InitFunction · 0.70
zPlatform_InitFunction · 0.70

Calls 8

xEntInitFunction · 0.85
xAnimTableGetStateFunction · 0.85
xModelEvalFunction · 0.85
xEntInitForTypeFunction · 0.85
zEntParseModelInfoFunction · 0.70
zAnimListGetNumUsedFunction · 0.70
zAnimListGetTableFunction · 0.70
xAnimPoolAllocFunction · 0.50

Tested by

no test coverage detected