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

Method CharacterPixelsInXY

src/Managers/AnimationManager.cpp:1384–1434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1382}
1383
1384bool CAnimationManager::CharacterPixelsInXY(CGameCharacter *obj, int x, int y)
1385{
1386 y -= 3;
1387 m_Sitting = obj->IsSitting();
1388 Anim.Direction = 0;
1389 obj->UpdateAnimationInfo_ProcessSteps(Anim.Direction);
1390
1391 bool mirror = false;
1392 uint8_t layerDir = Anim.Direction;
1393
1394 GetAnimDirection(Anim.Direction, mirror);
1395
1396 uint8_t animIndex = obj->AnimIndex;
1397 uint8_t animGroup = obj->GetGroupForAnimation(0, true);
1398
1399 CGameItem *goi = obj->FindLayer(OL_MOUNT);
1400
1401 int drawX = x - obj->OffsetX;
1402 int drawY = y - obj->OffsetY - obj->OffsetZ;
1403
1404 if (obj->IsHuman() && goi != nullptr) //Check mount
1405 {
1406 uint16_t mountID = goi->GetGraphicForAnimation();
1407 Anim.Group = obj->GetGroupForAnimation(mountID, false);
1408 if (TestPixels(goi, drawX, drawY, mirror, animIndex, mountID))
1409 {
1410 return true;
1411 }
1412
1413 if (mountID < MAX_ANIMATIONS_DATA_INDEX_COUNT)
1414 {
1415 drawY += g_Index.m_Anim[mountID].MountedHeightOffset;
1416 }
1417 }
1418 else if (m_Sitting != 0)
1419 {
1420 animGroup = PAG_STAND;
1421 animIndex = 0;
1422 obj->UpdateAnimationInfo_ProcessSteps(Anim.Direction);
1423 FixSittingDirection(layerDir, mirror, drawX, drawY);
1424 if (Anim.Direction == 3)
1425 {
1426 animGroup = 25;
1427 }
1428 }
1429
1430 Anim.Group = animGroup;
1431
1432 return TestPixels(obj, drawX, drawY, mirror, animIndex) ||
1433 DrawEquippedLayers(true, obj, drawX, drawY, mirror, layerDir, animIndex, 0);
1434}
1435
1436void CAnimationManager::DrawCorpse(CGameItem *obj, int x, int y)
1437{

Callers 1

SelectMethod · 0.80

Calls 6

IsSittingMethod · 0.80
GetGroupForAnimationMethod · 0.80
FindLayerMethod · 0.80
IsHumanMethod · 0.45

Tested by

no test coverage detected