summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik 'dreamsComeTrue' Jasiński <dominikjasinski@o2.pl>2020-03-24 00:43:59 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-06-19 15:21:52 +0200
commit6e6e296502ab2a72e1879fb23e076a0956f1aabd (patch)
treefeccd471869681f6810bbe2b5a5309fda374db16
parentc79183817df84faaa7a67a32c00c5a2bd46dc632 (diff)
downloadredot-engine-6e6e296502ab2a72e1879fb23e076a0956f1aabd.tar.gz
Set correct RW locks in AnimatedTexture
-rw-r--r--scene/resources/texture.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 4fdb7ca7fd..837aa39ce1 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -2692,7 +2692,7 @@ Ref<Texture2D> AnimatedTexture::get_frame_texture(int p_frame) const {
void AnimatedTexture::set_frame_duration(int p_frame, float p_duration) {
ERR_FAIL_INDEX(p_frame, MAX_FRAMES);
- RWLockRead r(rw_lock);
+ RWLockWrite r(rw_lock);
frames[p_frame].duration = p_duration;
}
@@ -2708,6 +2708,8 @@ float AnimatedTexture::get_frame_duration(int p_frame) const {
void AnimatedTexture::set_speed_scale(float p_scale) {
ERR_FAIL_COND(p_scale < -1000 || p_scale >= 1000);
+ RWLockWrite r(rw_lock);
+
speed_scale = p_scale;
}