summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--methods.py19
-rw-r--r--scene/animation/animation_player.cpp14
-rw-r--r--scene/animation/animation_player.h1
3 files changed, 22 insertions, 12 deletions
diff --git a/methods.py b/methods.py
index 7a7758e24b..83fb0445f0 100644
--- a/methods.py
+++ b/methods.py
@@ -708,25 +708,28 @@ def detect_visual_c_compiler_version(tools_env):
def find_visual_c_batch_file(env):
- from SCons.Tool.MSCommon.vc import (
- get_default_version,
- get_host_target,
- find_batch_file,
- )
+ from SCons.Tool.MSCommon.vc import get_default_version, get_host_target, find_batch_file, find_vc_pdir
# Syntax changed in SCons 4.4.0.
from SCons import __version__ as scons_raw_version
scons_ver = env._get_major_minor_revision(scons_raw_version)
- version = get_default_version(env)
+ msvc_version = get_default_version(env)
if scons_ver >= (4, 4, 0):
- (host_platform, target_platform, _) = get_host_target(env, version)
+ (host_platform, target_platform, _) = get_host_target(env, msvc_version)
else:
(host_platform, target_platform, _) = get_host_target(env)
- return find_batch_file(env, version, host_platform, target_platform)[0]
+ if scons_ver < (4, 6, 0):
+ return find_batch_file(env, msvc_version, host_platform, target_platform)[0]
+
+ # Scons 4.6.0+ removed passing env, so we need to get the product_dir ourselves first,
+ # then pass that as the last param instead of env as the first param as before.
+ # We should investigate if we can avoid relying on SCons internals here.
+ product_dir = find_vc_pdir(env, msvc_version)
+ return find_batch_file(msvc_version, host_platform, target_platform, product_dir)[0]
def generate_cpp_hint_file(filename):
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index a89bf8c8c1..6e7aec379b 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -151,7 +151,7 @@ void AnimationPlayer::_notification(int p_what) {
if (!Engine::get_singleton()->is_editor_hint() && animation_set.has(autoplay)) {
set_active(true);
play(autoplay);
- seek(0, true);
+ _check_immediately_after_start();
}
} break;
}
@@ -522,8 +522,9 @@ void AnimationPlayer::seek(double p_time, bool p_update, bool p_update_only) {
return;
}
- playback.current.pos = p_time;
+ _check_immediately_after_start();
+ playback.current.pos = p_time;
if (!playback.current.from) {
if (playback.assigned) {
ERR_FAIL_COND_MSG(!animation_set.has(playback.assigned), vformat("Animation not found: %s.", playback.assigned));
@@ -534,7 +535,6 @@ void AnimationPlayer::seek(double p_time, bool p_update, bool p_update_only) {
}
}
- playback.started = false; // Start has already gone by seeking, delta does not need to be 0 in the internal process.
playback.seeked = true;
if (p_update) {
_process_animation(0, p_update_only);
@@ -543,10 +543,16 @@ void AnimationPlayer::seek(double p_time, bool p_update, bool p_update_only) {
}
void AnimationPlayer::advance(double p_time) {
- playback.started = false; // Start has already gone by advancing, delta does not need to be 0 in the internal process.
+ _check_immediately_after_start();
AnimationMixer::advance(p_time);
}
+void AnimationPlayer::_check_immediately_after_start() {
+ if (playback.started) {
+ _process_animation(0); // Force process current key for Discrete/Method/Audio/AnimationPlayback. Then, started flag is cleared.
+ }
+}
+
bool AnimationPlayer::is_valid() const {
return (playback.current.from);
}
diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h
index 0bab586088..74f9323e2b 100644
--- a/scene/animation/animation_player.h
+++ b/scene/animation/animation_player.h
@@ -111,6 +111,7 @@ private:
void _process_playback_data(PlaybackData &cd, double p_delta, float p_blend, bool p_seeked, bool p_started, bool p_is_current = false);
void _blend_playback_data(double p_delta, bool p_started);
void _stop_internal(bool p_reset, bool p_keep_state);
+ void _check_immediately_after_start();
bool playing = false;