From 4e4697b1c481094949165fa9edbe6aeebcfcf3b4 Mon Sep 17 00:00:00 2001 From: Ibrahn Sahir Date: Fri, 5 Jul 2019 18:08:43 +0100 Subject: Added release function to PoolVector::Access. For clarity, assign-to-release idiom for PoolVector::Read/Write replaced with a function call. Existing uses replaced (or removed if already handled by scope) --- scene/resources/animation.cpp | 20 ++++++++++---------- scene/resources/dynamic_font_stb.cpp | 2 +- scene/resources/mesh.cpp | 8 ++++---- scene/resources/surface_tool.cpp | 14 +++++++------- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'scene/resources') diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 1ca643cd7a..89cbf0becd 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -403,7 +403,7 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { w[idx++] = scale.z; } - w = PoolVector::Write(); + w.release(); r_ret = keys; return true; @@ -438,8 +438,8 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { idx++; } - wti = PoolVector::Write(); - wtr = PoolVector::Write(); + wti.release(); + wtr.release(); d["times"] = key_times; d["transitions"] = key_transitions; @@ -478,8 +478,8 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { idx++; } - wti = PoolVector::Write(); - wtr = PoolVector::Write(); + wti.release(); + wtr.release(); d["times"] = key_times; d["transitions"] = key_transitions; @@ -523,8 +523,8 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { idx++; } - wti = PoolVector::Write(); - wpo = PoolVector::Write(); + wti.release(); + wpo.release(); d["times"] = key_times; d["points"] = key_points; @@ -562,7 +562,7 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { idx++; } - wti = PoolVector::Write(); + wti.release(); d["times"] = key_times; d["clips"] = clips; @@ -595,8 +595,8 @@ bool Animation::_get(const StringName &p_name, Variant &r_ret) const { wcl[i] = vls[i].value; } - wti = PoolVector::Write(); - wcl = PoolVector::Write(); + wti.release(); + wcl.release(); d["times"] = key_times; d["clips"] = clips; diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp index 3b44f05b94..ccff617a16 100644 --- a/scene/resources/dynamic_font_stb.cpp +++ b/scene/resources/dynamic_font_stb.cpp @@ -55,7 +55,7 @@ void DynamicFontData::lock() { void DynamicFontData::unlock() { - fr = PoolVector::Read(); + fr.release(); } void DynamicFontData::set_font_data(const PoolVector &p_font) { diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 6443b44bb6..aff274cd21 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -98,7 +98,7 @@ Ref Mesh::generate_triangle_mesh() const { } } - facesw = PoolVector::Write(); + facesw.release(); triangle_mesh = Ref(memnew(TriangleMesh)); triangle_mesh->create(faces); @@ -436,7 +436,7 @@ Ref Mesh::create_outline(float p_margin) const { r[i] = t; } - r = PoolVector::Write(); + r.release(); arrays[ARRAY_VERTEX] = vertices; if (!has_indices) { @@ -452,7 +452,7 @@ Ref Mesh::create_outline(float p_margin) const { iw[j + 2] = j + 1; } - iw = PoolVector::Write(); + iw.release(); arrays[ARRAY_INDEX] = new_indices; } else { @@ -461,7 +461,7 @@ Ref Mesh::create_outline(float p_margin) const { SWAP(ir[j + 1], ir[j + 2]); } - ir = PoolVector::Write(); + ir.release(); arrays[ARRAY_INDEX] = indices; } } diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 496b1b2bdc..2588e41951 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -307,7 +307,7 @@ Array SurfaceTool::commit_to_arrays() { } } - w = PoolVector::Write(); + w.release(); a[i] = array; } break; @@ -335,7 +335,7 @@ Array SurfaceTool::commit_to_arrays() { } } - w = PoolVector::Write(); + w.release(); a[i] = array; } break; case Mesh::ARRAY_TANGENT: { @@ -358,7 +358,7 @@ Array SurfaceTool::commit_to_arrays() { w[idx + 3] = d < 0 ? -1 : 1; } - w = PoolVector::Write(); + w.release(); a[i] = array; } break; @@ -375,7 +375,7 @@ Array SurfaceTool::commit_to_arrays() { w[idx] = v.color; } - w = PoolVector::Write(); + w.release(); a[i] = array; } break; case Mesh::ARRAY_BONES: { @@ -396,7 +396,7 @@ Array SurfaceTool::commit_to_arrays() { } } - w = PoolVector::Write(); + w.release(); a[i] = array; } break; @@ -418,7 +418,7 @@ Array SurfaceTool::commit_to_arrays() { } } - w = PoolVector::Write(); + w.release(); a[i] = array; } break; @@ -436,7 +436,7 @@ Array SurfaceTool::commit_to_arrays() { w[idx] = E->get(); } - w = PoolVector::Write(); + w.release(); a[i] = array; } break; -- cgit v1.2.3