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

Function CalculateFrameInformation

src/Managers/AnimationManager.cpp:49–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47};
48
49void CalculateFrameInformation(
50 FRAME_OUTPUT_INFO &info, CGameObject *obj, bool mirror, uint8_t animIndex)
51{
52 const auto dir = g_AnimationManager.Anim.Direction;
53 const auto grp = g_AnimationManager.Anim.Group;
54 const AnimationState anim = { obj->GetGraphicForAnimation(), grp, dir };
55 const auto dim = g_AnimationManager.GetAnimationDimensions(
56 obj->AnimIndex, anim, obj->IsMounted(), obj->IsCorpse());
57 int y = -(dim.Height + dim.CenterY + 3);
58 int x = -dim.CenterX;
59 if (mirror)
60 {
61 x = -(dim.Width - dim.CenterX);
62 }
63
64 if (x < info.StartX)
65 {
66 info.StartX = x;
67 }
68
69 if (y < info.StartY)
70 {
71 info.StartY = y;
72 }
73
74 if (info.EndX < x + dim.Width)
75 {
76 info.EndX = x + dim.Width;
77 }
78
79 if (info.EndY < y + dim.Height)
80 {
81 info.EndY = y + dim.Height;
82 }
83}
84
85const int CAnimationManager::m_UsedLayers[MAX_LAYER_DIRECTIONS][USED_LAYER_COUNT] = {
86 {

Callers 1

Calls 4

IsMountedMethod · 0.80
IsCorpseMethod · 0.80

Tested by

no test coverage detected