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

Function xAnimTableAddFileID

src/SB/Core/x/xAnim.cpp:1098–1143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1096xAnimState* xAnimTableGetStateID(xAnimTable* table, U32 ID);
1097
1098xAnimState* xAnimTableAddFileID(xAnimTable* table, xAnimFile* file, U32 stateID, U32 subStateID,
1099 U32 subStateCount)
1100{
1101 xAnimState* state;
1102
1103 state = xAnimTableGetStateID(table, stateID);
1104
1105 if (state)
1106 {
1107 if (subStateID)
1108 {
1109 if (!state->MultiFile)
1110 {
1111 state->MultiFile =
1112 (gxAnimUseGrowAlloc ? (xAnimMultiFile*)xMemGrowAllocSize(
1113 subStateCount * sizeof(xAnimMultiFileEntry) +
1114 sizeof(xAnimMultiFileBase)) :
1115 (xAnimMultiFile*)xMemAllocSize(
1116 subStateCount * sizeof(xAnimMultiFileEntry) +
1117 sizeof(xAnimMultiFileBase)));
1118
1119 state->MultiFile->Count = 0;
1120 }
1121
1122 U32 count = state->MultiFile->Count;
1123
1124 state->MultiFile->Files[count].ID = subStateID;
1125 state->MultiFile->Files[count].File = file;
1126
1127 state->MultiFile->Count++;
1128 }
1129
1130 state->Data = file;
1131
1132 if (file->FileFlags & 0x8000)
1133 {
1134 table->MorphIndex |= (1 << (state->Flags & 0xF));
1135 }
1136 else
1137 {
1138 table->AnimIndex |= (1 << (state->Flags & 0xF));
1139 }
1140 }
1141
1142 return state;
1143}
1144
1145xAnimState* xAnimTableGetStateID(xAnimTable* table, U32 ID)
1146{

Callers 2

ATBL_ReadFunction · 0.85
xAnimTableAddFileFunction · 0.85

Calls 1

xAnimTableGetStateIDFunction · 0.70

Tested by

no test coverage detected