summaryrefslogtreecommitdiff
path: root/modules/gltf
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2022-05-19 17:00:06 +0200
committerreduz <reduzio@gmail.com>2022-05-20 22:40:38 +0200
commit45af29da8095af16729955117a165d23e77cd740 (patch)
tree0436c59187702466a73d05caf9688a58e5935afd /modules/gltf
parent410893ad0fb6f0d7d774b6529581d886defd6cf0 (diff)
Add a new HashSet template
* Intended to replace RBSet in most cases. * Optimized for iteration speed
Diffstat (limited to 'modules/gltf')
-rw-r--r--modules/gltf/gltf_document.h10
-rw-r--r--modules/gltf/gltf_skeleton.h2
-rw-r--r--modules/gltf/gltf_state.h4
3 files changed, 8 insertions, 8 deletions
diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h
index 61a82e4bbc..2f61210ff9 100644
--- a/modules/gltf/gltf_document.h
+++ b/modules/gltf/gltf_document.h
@@ -128,12 +128,12 @@ private:
}
template <class T>
- static Array to_array(const RBSet<T> &p_inp) {
+ static Array to_array(const HashSet<T> &p_inp) {
Array ret;
- typename RBSet<T>::Element *elem = p_inp.front();
+ typename HashSet<T>::Iterator elem = p_inp.begin();
while (elem) {
- ret.push_back(elem->get());
- elem = elem->next();
+ ret.push_back(*elem);
+ ++elem;
}
return ret;
}
@@ -147,7 +147,7 @@ private:
}
template <class T>
- static void set_from_array(RBSet<T> &r_out, const Array &p_inp) {
+ static void set_from_array(HashSet<T> &r_out, const Array &p_inp) {
r_out.clear();
for (int i = 0; i < p_inp.size(); i++) {
r_out.insert(p_inp[i]);
diff --git a/modules/gltf/gltf_skeleton.h b/modules/gltf/gltf_skeleton.h
index 4dcee41465..92ee6e6234 100644
--- a/modules/gltf/gltf_skeleton.h
+++ b/modules/gltf/gltf_skeleton.h
@@ -50,7 +50,7 @@ private:
Skeleton3D *godot_skeleton = nullptr;
// Set of unique bone names for the skeleton
- RBSet<String> unique_names;
+ HashSet<String> unique_names;
HashMap<int32_t, GLTFNodeIndex> godot_bone_node;
diff --git a/modules/gltf/gltf_state.h b/modules/gltf/gltf_state.h
index 5e3402b9a1..2fdef19038 100644
--- a/modules/gltf/gltf_state.h
+++ b/modules/gltf/gltf_state.h
@@ -81,8 +81,8 @@ class GLTFState : public Resource {
Vector<Ref<GLTFSkin>> skins;
Vector<Ref<GLTFCamera>> cameras;
Vector<Ref<GLTFLight>> lights;
- RBSet<String> unique_names;
- RBSet<String> unique_animation_names;
+ HashSet<String> unique_names;
+ HashSet<String> unique_animation_names;
Vector<Ref<GLTFSkeleton>> skeletons;
HashMap<GLTFSkeletonIndex, GLTFNodeIndex> skeleton_to_node;