diff options
| -rw-r--r-- | doc/classes/AnimatedSprite.xml | 14 | ||||
| -rw-r--r-- | drivers/gles3/shaders/scene.glsl | 8 | ||||
| -rw-r--r-- | editor/editor_autoload_settings.cpp | 2 | ||||
| -rw-r--r-- | modules/gdscript/gd_function.cpp | 2 | ||||
| -rw-r--r-- | scene/audio/audio_player.cpp | 9 |
5 files changed, 22 insertions, 13 deletions
diff --git a/doc/classes/AnimatedSprite.xml b/doc/classes/AnimatedSprite.xml index f8663e90e0..809890bea1 100644 --- a/doc/classes/AnimatedSprite.xml +++ b/doc/classes/AnimatedSprite.xml @@ -4,7 +4,7 @@ Sprite node that can use multiple textures for animation. </brief_description> <description> - Sprite node that can use multiple textures for animation. + Sprite node that can use multiple textures for animation. Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel. </description> <tutorials> </tutorials> @@ -149,31 +149,39 @@ </methods> <members> <member name="animation" type="String" setter="set_animation" getter="get_animation"> + The current animation from the [code]frames[/code] resource. If this value is changed, the [code]frame[/code] counter is reset. </member> <member name="centered" type="bool" setter="set_centered" getter="is_centered"> + If [code]true[/code] texture will be centered. Default value: [code]true[/code]. </member> <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h"> + If [code]true[/code] texture is flipped horizontally. Default value: [code]false[/code]. </member> <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v"> + If [code]true[/code] texture is flipped vertically. Default value: [code]false[/code]. </member> <member name="frame" type="int" setter="set_frame" getter="get_frame"> + The current frame index. </member> <member name="frames" type="SpriteFrames" setter="set_sprite_frames" getter="get_sprite_frames"> + The [SpriteFrames] resource containing the animation(s). </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset"> + The texture's drawing offset. </member> <member name="playing" type="bool" setter="_set_playing" getter="_is_playing"> + If [code]true[/code] the [code]animation[/code] is currently playing. </member> </members> <signals> <signal name="animation_finished"> <description> - Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn, before looping. + Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted every time the last frame is drawn. </description> </signal> <signal name="frame_changed"> <description> - Emitted when frame is changed. + Emitted when [code]frame[/code] changes. </description> </signal> </signals> diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 25115bc18a..7692a0932a 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -941,12 +941,12 @@ LIGHT_SHADER_CODE vec3 H = normalize(V + L); float NoL = max(0.0,dot(N, L)); - float VoH = max(0.0,dot(L, H)); + float LoH = max(0.0,dot(L, H)); float NoV = max(0.0,dot(N, V)); - float FD90 = 0.5 + 2.0 * VoH * VoH * roughness; - float FdV = 1.0 + (FD90 - 1.0) * pow( 1.0 - NoV, 5.0 ); - float FdL = 1.0 + (FD90 - 1.0) * pow( 1.0 - NoL, 5.0 ); + float FD90 = 0.5 + 2.0 * LoH * LoH * roughness; + float FdV = 1.0 + (FD90 - 1.0) * SchlickFresnel(NoV); + float FdL = 1.0 + (FD90 - 1.0) * SchlickFresnel(NoL); light_amount = ( (1.0 / M_PI) * FdV * FdL ); /* float energyBias = mix(roughness, 0.0, 0.5); diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index ee537f4228..efa9572bf5 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -364,7 +364,7 @@ void EditorAutoloadSettings::update_autoload() { item->add_button(3, get_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP); item->add_button(3, get_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN); - item->add_button(3, get_icon("Del", "EditorIcons"), BUTTON_DELETE); + item->add_button(3, get_icon("Remove", "EditorIcons"), BUTTON_DELETE); item->set_selectable(3, false); } diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index d39e967ac9..767ea29f3c 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -909,7 +909,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a gds = gds->base.ptr(); E = gds->member_functions.find(*methodname); if (E) - OPCODE_BREAK; + break; } Variant::CallError err; diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp index 14dd39a491..058b162e83 100644 --- a/scene/audio/audio_player.cpp +++ b/scene/audio/audio_player.cpp @@ -122,7 +122,6 @@ void AudioStreamPlayer::_notification(int p_what) { void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) { - ERR_FAIL_COND(!p_stream.is_valid()); AudioServer::get_singleton()->lock(); mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size()); @@ -134,12 +133,14 @@ void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) { setseek = -1; } - stream = p_stream; - stream_playback = p_stream->instance_playback(); + if (p_stream.is_valid()) { + stream = p_stream; + stream_playback = p_stream->instance_playback(); + } AudioServer::get_singleton()->unlock(); - if (stream_playback.is_null()) { + if (p_stream.is_valid() && stream_playback.is_null()) { stream.unref(); ERR_FAIL_COND(stream_playback.is_null()); } |