| 19 | #include <PowerPC_EABI_Support\MSL_C\MSL_Common\stdlib.h> |
| 20 | |
| 21 | void 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 | { |
no test coverage detected