mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Merge commit godotengine/godot@bdf625bd54
This commit is contained in:
@@ -222,7 +222,7 @@ Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
|
||||
Ref<AudioStream> stream = object->call("get_stream");
|
||||
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
return AnimationTrackEdit::get_key_rect(p_index, p_pixels_sec);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
|
||||
|
||||
Ref<AudioStream> stream = object->call("get_stream");
|
||||
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right);
|
||||
return;
|
||||
}
|
||||
@@ -381,7 +381,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
|
||||
|
||||
if (Object::cast_to<Sprite2D>(object) || Object::cast_to<Sprite3D>(object)) {
|
||||
Ref<Texture2D> texture = object->call("get_texture");
|
||||
if (!texture.is_valid()) {
|
||||
if (texture.is_null()) {
|
||||
return AnimationTrackEdit::get_key_rect(p_index, p_pixels_sec);
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
|
||||
}
|
||||
|
||||
Ref<Texture2D> texture = sf->get_frame_texture(animation_name, frame);
|
||||
if (!texture.is_valid()) {
|
||||
if (texture.is_null()) {
|
||||
return AnimationTrackEdit::get_key_rect(p_index, p_pixels_sec);
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
|
||||
|
||||
if (Object::cast_to<Sprite2D>(object) || Object::cast_to<Sprite3D>(object)) {
|
||||
texture = object->call("get_texture");
|
||||
if (!texture.is_valid()) {
|
||||
if (texture.is_null()) {
|
||||
AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right);
|
||||
return;
|
||||
}
|
||||
@@ -516,7 +516,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
|
||||
}
|
||||
|
||||
texture = sf->get_frame_texture(animation_name, frame);
|
||||
if (!texture.is_valid()) {
|
||||
if (texture.is_null()) {
|
||||
AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right);
|
||||
return;
|
||||
}
|
||||
@@ -810,7 +810,7 @@ int AnimationTrackEditTypeAudio::get_key_height() const {
|
||||
Rect2 AnimationTrackEditTypeAudio::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Ref<AudioStream> stream = get_animation()->audio_track_get_key_stream(get_track(), p_index);
|
||||
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
return AnimationTrackEdit::get_key_rect(p_index, p_pixels_sec);
|
||||
}
|
||||
|
||||
@@ -843,7 +843,7 @@ bool AnimationTrackEditTypeAudio::is_key_selectable_by_distance() const {
|
||||
|
||||
void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
|
||||
Ref<AudioStream> stream = get_animation()->audio_track_get_key_stream(get_track(), p_index);
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
AnimationTrackEdit::draw_key(p_index, p_pixels_sec, p_x, p_selected, p_clip_left, p_clip_right); // Draw diamond.
|
||||
return;
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ void AnimationTrackEditTypeAudio::gui_input(const Ref<InputEvent> &p_event) {
|
||||
for (int i = 0; i < get_animation()->track_get_key_count(get_track()); i++) {
|
||||
Ref<AudioStream> stream = get_animation()->audio_track_get_key_stream(get_track(), i);
|
||||
|
||||
if (!stream.is_valid()) {
|
||||
if (stream.is_null()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user