Fix AnimatedSprite play() don't redraw immediately
This commit is contained in:
parent
218bef90af
commit
fa198c482e
4 changed files with 9 additions and 5 deletions
|
@ -475,8 +475,9 @@ void AnimatedSprite2D::play(const StringName &p_name, float p_custom_scale, bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notify_property_list_changed();
|
|
||||||
set_process_internal(true);
|
set_process_internal(true);
|
||||||
|
notify_property_list_changed();
|
||||||
|
queue_redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimatedSprite2D::play_backwards(const StringName &p_name) {
|
void AnimatedSprite2D::play_backwards(const StringName &p_name) {
|
||||||
|
|
|
@ -1182,8 +1182,9 @@ void AnimatedSprite3D::play(const StringName &p_name, float p_custom_scale, bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notify_property_list_changed();
|
|
||||||
set_process_internal(true);
|
set_process_internal(true);
|
||||||
|
notify_property_list_changed();
|
||||||
|
_queue_redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimatedSprite3D::play_backwards(const StringName &p_name) {
|
void AnimatedSprite3D::play_backwards(const StringName &p_name) {
|
||||||
|
|
|
@ -149,7 +149,7 @@ private:
|
||||||
HashMap<StringName, BezierAnim> bezier_anim;
|
HashMap<StringName, BezierAnim> bezier_anim;
|
||||||
|
|
||||||
struct PlayingAudioStreamInfo {
|
struct PlayingAudioStreamInfo {
|
||||||
int64_t index = -1;
|
AudioStreamPlaybackPolyphonic::ID index = -1;
|
||||||
double start = 0.0;
|
double start = 0.0;
|
||||||
double len = 0.0;
|
double len = 0.0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -253,12 +253,14 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Audio stream information for each audio stream placed on the track.
|
||||||
struct PlayingAudioStreamInfo {
|
struct PlayingAudioStreamInfo {
|
||||||
int64_t index = -1;
|
AudioStreamPlaybackPolyphonic::ID index = -1; // ID retrieved from AudioStreamPlaybackPolyphonic.
|
||||||
double start = 0.0;
|
double start = 0.0;
|
||||||
double len = 0.0;
|
double len = 0.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Audio track information for mixng and ending.
|
||||||
struct PlayingAudioTrackInfo {
|
struct PlayingAudioTrackInfo {
|
||||||
HashMap<int, PlayingAudioStreamInfo> stream_info;
|
HashMap<int, PlayingAudioStreamInfo> stream_info;
|
||||||
double length = 0.0;
|
double length = 0.0;
|
||||||
|
@ -272,7 +274,7 @@ private:
|
||||||
struct TrackCacheAudio : public TrackCache {
|
struct TrackCacheAudio : public TrackCache {
|
||||||
Ref<AudioStreamPolyphonic> audio_stream;
|
Ref<AudioStreamPolyphonic> audio_stream;
|
||||||
Ref<AudioStreamPlaybackPolyphonic> audio_stream_playback;
|
Ref<AudioStreamPlaybackPolyphonic> audio_stream_playback;
|
||||||
HashMap<ObjectID, PlayingAudioTrackInfo> playing_streams; // Animation resource RID & AudioTrack key index: PlayingAudioStreamInfo.
|
HashMap<ObjectID, PlayingAudioTrackInfo> playing_streams; // Key is Animation resource ObjectID.
|
||||||
|
|
||||||
TrackCacheAudio() {
|
TrackCacheAudio() {
|
||||||
type = Animation::TYPE_AUDIO;
|
type = Animation::TYPE_AUDIO;
|
||||||
|
|
Loading…
Reference in a new issue