diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-14 22:34:37 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-14 22:34:37 +0100 |
commit | 453485aede521b3c6d2d960bad94acc2eb90f177 (patch) | |
tree | dd7aa8b68791c8b20bce11906810b88a84293d5c /modules/gltf | |
parent | 31acb61c16945244c2c2b61f6b3d663b40dce016 (diff) | |
parent | 9d7215e6affce6917601fd4059062a413d69a252 (diff) | |
download | redot-engine-453485aede521b3c6d2d960bad94acc2eb90f177.tar.gz |
Merge pull request #89270 from Repiteo/enforce-typename-in-templates
Enforce template syntax `typename` over `class`
Diffstat (limited to 'modules/gltf')
-rw-r--r-- | modules/gltf/gltf_document.cpp | 4 | ||||
-rw-r--r-- | modules/gltf/gltf_document.h | 2 | ||||
-rw-r--r-- | modules/gltf/gltf_template_convert.h | 12 | ||||
-rw-r--r-- | modules/gltf/structures/gltf_animation.h | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index b53be7f855..b8152749d3 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -5517,7 +5517,7 @@ void GLTFDocument::_generate_skeleton_bone_node(Ref<GLTFState> p_state, const GL } } -template <class T> +template <typename T> struct SceneFormatImporterGLTFInterpolate { T lerp(const T &a, const T &b, float c) const { return a + (b - a) * c; @@ -5567,7 +5567,7 @@ struct SceneFormatImporterGLTFInterpolate<Quaternion> { } }; -template <class T> +template <typename T> T GLTFDocument::_interpolate_track(const Vector<real_t> &p_times, const Vector<T> &p_values, const float p_time, const GLTFAnimation::Interpolation p_interp) { ERR_FAIL_COND_V(p_values.is_empty(), T()); if (p_times.size() != (p_values.size() / (p_interp == GLTFAnimation::INTERP_CUBIC_SPLINE ? 3 : 1))) { diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h index 1682e9eeb7..11b29e7268 100644 --- a/modules/gltf/gltf_document.h +++ b/modules/gltf/gltf_document.h @@ -217,7 +217,7 @@ private: Light3D *_generate_light(Ref<GLTFState> p_state, const GLTFNodeIndex p_node_index); Node3D *_generate_spatial(Ref<GLTFState> p_state, const GLTFNodeIndex p_node_index); void _assign_node_names(Ref<GLTFState> p_state); - template <class T> + template <typename T> T _interpolate_track(const Vector<real_t> &p_times, const Vector<T> &p_values, const float p_time, const GLTFAnimation::Interpolation p_interp); diff --git a/modules/gltf/gltf_template_convert.h b/modules/gltf/gltf_template_convert.h index 2743cd8a9b..46f185867a 100644 --- a/modules/gltf/gltf_template_convert.h +++ b/modules/gltf/gltf_template_convert.h @@ -37,7 +37,7 @@ #include "core/variant/typed_array.h" namespace GLTFTemplateConvert { -template <class T> +template <typename T> static Array to_array(const Vector<T> &p_inp) { Array ret; for (int i = 0; i < p_inp.size(); i++) { @@ -46,7 +46,7 @@ static Array to_array(const Vector<T> &p_inp) { return ret; } -template <class T> +template <typename T> static TypedArray<T> to_array(const HashSet<T> &p_inp) { TypedArray<T> ret; typename HashSet<T>::Iterator elem = p_inp.begin(); @@ -57,7 +57,7 @@ static TypedArray<T> to_array(const HashSet<T> &p_inp) { return ret; } -template <class T> +template <typename T> static void set_from_array(Vector<T> &r_out, const Array &p_inp) { r_out.clear(); for (int i = 0; i < p_inp.size(); i++) { @@ -65,7 +65,7 @@ static void set_from_array(Vector<T> &r_out, const Array &p_inp) { } } -template <class T> +template <typename T> static void set_from_array(HashSet<T> &r_out, const TypedArray<T> &p_inp) { r_out.clear(); for (int i = 0; i < p_inp.size(); i++) { @@ -73,7 +73,7 @@ static void set_from_array(HashSet<T> &r_out, const TypedArray<T> &p_inp) { } } -template <class K, class V> +template <typename K, typename V> static Dictionary to_dictionary(const HashMap<K, V> &p_inp) { Dictionary ret; for (const KeyValue<K, V> &E : p_inp) { @@ -82,7 +82,7 @@ static Dictionary to_dictionary(const HashMap<K, V> &p_inp) { return ret; } -template <class K, class V> +template <typename K, typename V> static void set_from_dictionary(HashMap<K, V> &r_out, const Dictionary &p_inp) { r_out.clear(); Array keys = p_inp.keys(); diff --git a/modules/gltf/structures/gltf_animation.h b/modules/gltf/structures/gltf_animation.h index 7f769752c2..afc9784895 100644 --- a/modules/gltf/structures/gltf_animation.h +++ b/modules/gltf/structures/gltf_animation.h @@ -47,7 +47,7 @@ public: INTERP_CUBIC_SPLINE, }; - template <class T> + template <typename T> struct Channel { Interpolation interpolation = INTERP_LINEAR; Vector<real_t> times; |