| 46 | } |
| 47 | |
| 48 | void xModelPoolInit(U32 count, U32 numMatrices) |
| 49 | { |
| 50 | S32 i; |
| 51 | U8* buffer; |
| 52 | RwMatrix* mat; |
| 53 | xModelPool *pool, *curr, **prev; |
| 54 | xModelInstance* inst; |
| 55 | |
| 56 | if (numMatrices < 1) |
| 57 | numMatrices = 1; |
| 58 | |
| 59 | buffer = (U8*)xMemAllocSizeAlign(count * numMatrices * sizeof(RwMatrix) + sizeof(xModelPool) + |
| 60 | count * sizeof(xModelInstance), |
| 61 | 16); |
| 62 | |
| 63 | mat = (RwMatrix*)buffer; |
| 64 | buffer += count * numMatrices * sizeof(RwMatrix); |
| 65 | |
| 66 | pool = (xModelPool*)buffer; |
| 67 | buffer += sizeof(xModelPool); |
| 68 | |
| 69 | inst = (xModelInstance*)buffer; |
| 70 | |
| 71 | for (i = 0; i < (S32)count; i++) |
| 72 | { |
| 73 | inst[i].Next = &inst[i + 1]; |
| 74 | inst[i].Pool = pool; |
| 75 | inst[i].Mat = mat; |
| 76 | mat += numMatrices; |
| 77 | } |
| 78 | inst[count - 1].Next = NULL; |
| 79 | |
| 80 | pool->NumMatrices = numMatrices; |
| 81 | pool->List = inst; |
| 82 | |
| 83 | curr = sxModelPoolList; |
| 84 | prev = &sxModelPoolList; |
| 85 | while (curr && numMatrices < curr->NumMatrices) |
| 86 | { |
| 87 | prev = &curr->Next; |
| 88 | curr = curr->Next; |
| 89 | } |
| 90 | pool->Next = curr; |
| 91 | *prev = pool; |
| 92 | } |
| 93 | |
| 94 | xModelInstance* xModelInstanceAlloc(RpAtomic* data, void* object, U16 flags, U8 boneIndex, |
| 95 | U8* boneRemap) |
no outgoing calls
no test coverage detected