| 22 | } |
| 23 | |
| 24 | bool 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 | |
| 54 | bool CheckIfSlotExists(GAME_OBJECT_ID requiredObj, const std::string& baseName) |
| 55 | { |
no test coverage detected