MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / AssignObjectAnimations

Function AssignObjectAnimations

TombEngine/Objects/Utils/object_helper.cpp:24–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24bool AssignObjectAnimations(ObjectInfo& object, int requiredObjectID, const std::string& baseName, const std::string& requiredName)
25{
26 // Check if object has at least 1 animation with more than 1 frame.
27 const auto& anim = GetAnimData(object, 0);
28 if (anim.Keyframes.size() > 1)
29 return true;
30
31 // Use slot if loaded.
32 const auto& requiredObject = Objects[requiredObjectID];
33 if (requiredObject.loaded)
34 {
35 // Check if required object has more than 1 animation.
36 if (requiredObject.Animations.size() > 1)
37 {
38 object.Animations = requiredObject.Animations;
39 return true;
40 }
41 else
42 {
43 TENLog("Slot " + requiredName + " has no animation data. " + baseName + " will have no animations.", LogLevel::Warning);
44 }
45 }
46 else
47 {
48 TENLog("Slot " + requiredName + " not loaded. " + baseName + " will have no animations.", LogLevel::Warning);
49 }
50
51 return false;
52}
53
54bool CheckIfSlotExists(GAME_OBJECT_ID requiredObj, const std::string& baseName)
55{

Callers 3

StartEntityFunction · 0.85
StartEntityFunction · 0.85
StartEntityFunction · 0.85

Calls 2

TENLogFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected