MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / SetAnimation

Method SetAnimation

Source/Graphics/animationclient.cpp:90–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void AnimationClient::SetAnimation(const std::string &path,
91 float fade_speed,
92 char flags) {
93 if (flags & _ANM_FROM_START) {
94 current_anim.clear();
95 }
96 if (current_anim == path) {
97 return;
98 }
99
100 AnimationAssetRef new_ref;
101 if (animation_config.kForceIdleAnim) {
102 new_ref = ReturnAnimationAssetRef("Data/Animations/r_actionidle.xml");
103 } else {
104 Path new_path = FindFilePath(path);
105 if (new_path.isValid()) {
106 new_ref = ReturnAnimationAssetRef(path);
107 if (new_ref.valid() == false) {
108 new_ref = ReturnAnimationAssetRef("Data/Animations/r_actionidle.xml");
109 }
110 }
111 }
112
113 if (new_ref.valid()) {
114 if (reader.valid()) {
115 fade_out.AddFadingAnimation(reader, blendmap, fade_speed);
116 }
117 ApplyAnimationFlags(reader, new_ref, flags);
118 current_anim = path;
119 }
120}
121
122std::queue<AnimationEvent> AnimationClient::GetActiveEvents() {
123 std::queue<AnimationEvent> total_events;

Callers

nothing calls this directly

Calls 6

ReturnAnimationAssetRefFunction · 0.85
FindFilePathFunction · 0.85
AddFadingAnimationMethod · 0.80
clearMethod · 0.45
isValidMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected