summaryrefslogtreecommitdiffstats
path: root/scene/animation/animation_mixer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/animation/animation_mixer.cpp')
-rw-r--r--scene/animation/animation_mixer.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp
index 522fc2db32..f375b2eb83 100644
--- a/scene/animation/animation_mixer.cpp
+++ b/scene/animation/animation_mixer.cpp
@@ -2166,8 +2166,7 @@ AnimationMixer::TrackCache *AnimatedValuesBackup::get_cache_copy(AnimationMixer:
switch (p_cache->type) {
case Animation::TYPE_VALUE: {
AnimationMixer::TrackCacheValue *src = static_cast<AnimationMixer::TrackCacheValue *>(p_cache);
- AnimationMixer::TrackCacheValue *tc = memnew(AnimationMixer::TrackCacheValue);
- memcpy((void *)tc, (void *)src, sizeof(AnimationMixer::TrackCacheValue));
+ AnimationMixer::TrackCacheValue *tc = memnew(AnimationMixer::TrackCacheValue(*src));
return tc;
}
@@ -2175,29 +2174,25 @@ AnimationMixer::TrackCache *AnimatedValuesBackup::get_cache_copy(AnimationMixer:
case Animation::TYPE_ROTATION_3D:
case Animation::TYPE_SCALE_3D: {
AnimationMixer::TrackCacheTransform *src = static_cast<AnimationMixer::TrackCacheTransform *>(p_cache);
- AnimationMixer::TrackCacheTransform *tc = memnew(AnimationMixer::TrackCacheTransform);
- memcpy((void *)tc, (void *)src, sizeof(AnimationMixer::TrackCacheTransform));
+ AnimationMixer::TrackCacheTransform *tc = memnew(AnimationMixer::TrackCacheTransform(*src));
return tc;
}
case Animation::TYPE_BLEND_SHAPE: {
AnimationMixer::TrackCacheBlendShape *src = static_cast<AnimationMixer::TrackCacheBlendShape *>(p_cache);
- AnimationMixer::TrackCacheBlendShape *tc = memnew(AnimationMixer::TrackCacheBlendShape);
- memcpy((void *)tc, (void *)src, sizeof(AnimationMixer::TrackCacheBlendShape));
+ AnimationMixer::TrackCacheBlendShape *tc = memnew(AnimationMixer::TrackCacheBlendShape(*src));
return tc;
}
case Animation::TYPE_BEZIER: {
AnimationMixer::TrackCacheBezier *src = static_cast<AnimationMixer::TrackCacheBezier *>(p_cache);
- AnimationMixer::TrackCacheBezier *tc = memnew(AnimationMixer::TrackCacheBezier);
- memcpy((void *)tc, (void *)src, sizeof(AnimationMixer::TrackCacheBezier));
+ AnimationMixer::TrackCacheBezier *tc = memnew(AnimationMixer::TrackCacheBezier(*src));
return tc;
}
case Animation::TYPE_AUDIO: {
AnimationMixer::TrackCacheAudio *src = static_cast<AnimationMixer::TrackCacheAudio *>(p_cache);
- AnimationMixer::TrackCacheAudio *tc = memnew(AnimationMixer::TrackCacheAudio);
- memcpy((void *)tc, (void *)src, sizeof(AnimationMixer::TrackCacheAudio));
+ AnimationMixer::TrackCacheAudio *tc = memnew(AnimationMixer::TrackCacheAudio(*src));
return tc;
}