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

Method AnimStart

src/SB/Game/zNPCTypeCommon.cpp:2694–2735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2692}
2693
2694S32 zNPCCommon::AnimStart(U32 animID, S32 forceRestart)
2695{
2696 static S32 dumptable = 0;
2697 if (dumptable)
2698 {
2699 dumptable = 0;
2700 this->AnimGetTable();
2701 }
2702
2703 xAnimState* state = this->AnimCurState();
2704 if (state && state->ID == animID && !forceRestart)
2705 {
2706 return state->ID;
2707 }
2708
2709 xAnimTransition* da_tran = this->AnimGetTable()->TransitionList;
2710
2711 while (da_tran)
2712 {
2713 if (da_tran->Dest->ID == animID)
2714 {
2715 break;
2716 }
2717 da_tran = da_tran->Next;
2718 }
2719
2720 if (da_tran)
2721 {
2722 xAnimPlayStartTransition(this->model->Anim, da_tran);
2723 }
2724 else
2725 {
2726 xSceneID2Name(globals.sceneCur, this->id);
2727 }
2728
2729 if (da_tran)
2730 {
2731 return da_tran->Dest->ID;
2732 }
2733
2734 return 0;
2735}
2736
2737void zNPCCommon::AnimSetState(U32 animID, F32 time)
2738{

Callers 1

DoExplicitAnimMethod · 0.80

Calls 4

AnimGetTableMethod · 0.95
AnimCurStateMethod · 0.95
xSceneID2NameFunction · 0.85
xAnimPlayStartTransitionFunction · 0.50

Tested by

no test coverage detected