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

Function xAnimTableNewState

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

Source from the content-addressed store, hash-verified

760}
761
762xAnimState* xAnimTableNewState(xAnimTable* table, const char* name, U32 flags, U32 userFlags,
763 F32 speed, F32* boneBlend, F32* timeSnap, F32 fadeRecip,
764 U16* fadeOffset, void* callbackData,
765 xAnimStateBeforeEnterCallback beforeEnter,
766 xAnimStateCallback stateCallback,
767 xAnimStateBeforeAnimMatricesCallback beforeAnimMatrices)
768{
769 xAnimState* state;
770
771 state = (gxAnimUseGrowAlloc ? (xAnimState*)xMemGrowAllocSize(sizeof(xAnimState)) :
772 (xAnimState*)xMemAllocSize(sizeof(xAnimState)));
773
774 if (!table->StateList)
775 {
776 state->Next = NULL;
777 table->StateList = state;
778 }
779 else
780 {
781 state->Next = table->StateList->Next;
782 table->StateList->Next = state;
783 }
784
785 state->Name = name;
786 state->ID = xStrHash(name);
787 state->Flags = flags;
788 state->UserFlags = userFlags;
789 state->Speed = speed;
790 state->Data = NULL;
791 state->Effects = NULL;
792 state->Default = NULL;
793 state->List = NULL;
794 state->BoneBlend = boneBlend;
795 state->TimeSnap = timeSnap;
796 state->FadeRecip = (fadeOffset ? CalcRecipBlendMax(fadeOffset) : fadeRecip);
797 state->FadeOffset = fadeOffset;
798 state->MultiFile = NULL;
799 state->CallbackData = callbackData;
800 state->BeforeEnter = beforeEnter;
801 state->StateCallback = stateCallback;
802 state->BeforeAnimMatrices = beforeAnimMatrices;
803
804 return state;
805}
806
807static void _xAnimTableAddTransitionHelper(xAnimState* state, xAnimTransition* tran,
808 U32& stateCount, U32& allocCount, xAnimState** stateList)

Callers 15

XHUD_AnimTable_IdleFunction · 0.70
ZNPC_AnimTable_DutchmanFunction · 0.50
ZNPC_AnimTable_TestFunction · 0.50
ZNPC_AnimTable_BossSandyFunction · 0.50
ZNPC_AnimTable_TikiFunction · 0.50
zSandy_AnimTableFunction · 0.50
zPatrick_AnimTableFunction · 0.50
zEntPlayer_AnimTableFunction · 0.50

Calls 2

CalcRecipBlendMaxFunction · 0.85
xStrHashFunction · 0.70

Tested by 1

ZNPC_AnimTable_TestFunction · 0.40