MCPcopy Create free account
hub / github.com/crossuo/crossuo / ProcessAnimation

Method ProcessAnimation

src/GameObjects/GameWorld.cpp:91–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void CGameWorld::ProcessAnimation()
92{
93 int delay =
94 (g_ConfigManager.StandartCharactersAnimationDelay ? ORIGINAL_CHARACTERS_ANIMATION_DELAY :
95 XUO_CHARACTERS_ANIMATION_DELAY);
96 g_AnimCharactersDelayValue = (float)delay;
97 std::deque<CGameObject *> toRemove;
98 QFOR(obj, m_Items, CGameObject *)
99 {
100 if (obj->NPC) // Mobile
101 {
102 CGameCharacter *gc = obj->GameCharacterPtr();
103 uint8_t dir = 0;
104 gc->UpdateAnimationInfo_ProcessSteps(dir, true);
105 ProcessFootstepsSound(g_Ticks, gc);
106 if (gc->LastAnimationChangeTime < g_Ticks && !gc->NoIterateAnimIndex())
107 {
108 char frameIndex = gc->AnimIndex;
109 if (gc->AnimationFromServer && !gc->AnimationDirection)
110 {
111 frameIndex--;
112 }
113 else
114 {
115 frameIndex++;
116 }
117
118 auto graphic = gc->GetGraphicForAnimation();
119 auto group = gc->GetGroupForAnimation(graphic, true);
120
121 /* CHECK */
122 gc->ProcessGargoyleAnims(group);
123 CGameItem *mount = gc->FindLayer(OL_MOUNT);
124 if (mount != nullptr)
125 {
126 switch (group)
127 {
128 case PAG_FIDGET_1:
129 case PAG_FIDGET_2:
130 case PAG_FIDGET_3:
131 {
132 graphic = mount->GetGraphicForAnimation();
133 group = gc->GetGroupForAnimation(graphic, true);
134 break;
135 }
136 default:
137 break;
138 }
139 }
140 /* CHECK */
141
142 bool mirror = false;
143 g_AnimationManager.GetAnimDirection(dir, mirror);
144 int currentDelay = delay;
145 if (graphic < MAX_ANIMATIONS_DATA_INDEX_COUNT && dir < MAX_MOBILE_DIRECTIONS)
146 {
147 const auto anim =
148 g_AnimationManager.ExecuteAnimation({ graphic, group, dir }, g_Ticks);

Callers 1

ProcessMethod · 0.80

Calls 2

emptyMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected