Renamed Set to RBSet.

This commit is contained in:
Relintai 2023-01-15 19:42:08 +01:00
parent 1b0aac6028
commit 2cd4e4d828
223 changed files with 736 additions and 1446 deletions

View File

@ -233,7 +233,7 @@ struct _VCSort {
void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const {
_THREAD_SAFE_METHOD_
Set<_VCSort> vclist;
RBSet<_VCSort> vclist;
for (RBMap<StringName, VariantContainer>::Element *E = props.front(); E; E = E->next()) {
const VariantContainer *v = &E->get();
@ -258,7 +258,7 @@ void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const {
vclist.insert(vc);
}
for (Set<_VCSort>::Element *E = vclist.front(); E; E = E->next()) {
for (RBSet<_VCSort>::Element *E = vclist.front(); E; E = E->next()) {
String prop_info_name = E->get().name;
int dot = prop_info_name.find(".");
if (dot != -1) {
@ -816,7 +816,7 @@ Error ProjectSettings::_save_custom_bnd(const String &p_file) { // add other par
Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_custom, const Vector<String> &p_custom_features, bool p_merge_with_current) {
ERR_FAIL_COND_V_MSG(p_path == "", ERR_INVALID_PARAMETER, "Project settings save path cannot be empty.");
Set<_VCSort> vclist;
RBSet<_VCSort> vclist;
if (p_merge_with_current) {
for (RBMap<StringName, VariantContainer>::Element *G = props.front(); G; G = G->next()) {
@ -857,7 +857,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust
RBMap<String, List<String>> props;
for (Set<_VCSort>::Element *E = vclist.front(); E; E = E->next()) {
for (RBSet<_VCSort>::Element *E = vclist.front(); E; E = E->next()) {
String category = E->get().name;
String name = E->get().name;

View File

@ -32,7 +32,7 @@
#include "core/object/object.h"
#include "core/os/thread_safe.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
// Querying ProjectSettings is usually done at startup.
// Additionally, in order to keep track of changes to ProjectSettings,
@ -114,7 +114,7 @@ protected:
bool using_datapack;
List<String> input_presets;
Set<String> custom_features;
RBSet<String> custom_features;
String project_data_dir_name;

View File

@ -1,5 +1,8 @@
#ifndef RB_SET_H
#define RB_SET_H
/*************************************************************************/
/* rb_set.h */
/* set.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,14 +31,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RB_SET_H
#define RB_SET_H
#include "core/os/memory.h"
#include "core/typedefs.h"
// based on the very nice implementation of rb-trees by:
// https://web.archive.org/web/20120507164830/https://web.mit.edu/~emin/www/source_code/red_black_tree/index.html
// https://web.archive.org/web/20120507164830/http://web.mit.edu/~emin/www/source_code/red_black_tree/index.html
template <class T, class C = Comparator<T>, class A = DefaultAllocator>
class RBSet {
@ -49,12 +49,12 @@ public:
class Element {
private:
friend class RBSet<T, C, A>;
int color = RED;
Element *right = nullptr;
Element *left = nullptr;
Element *parent = nullptr;
Element *_next = nullptr;
Element *_prev = nullptr;
int color;
Element *right;
Element *left;
Element *parent;
Element *_next;
Element *_prev;
T value;
//_Data *data;
@ -71,102 +71,24 @@ public:
Element *prev() {
return _prev;
}
T &get() {
return value;
}
const T &get() const {
return value;
};
Element() {}
Element() {
color = RED;
right = nullptr;
left = nullptr;
parent = nullptr;
_next = nullptr;
_prev = nullptr;
};
};
typedef T ValueType;
struct Iterator {
_FORCE_INLINE_ T &operator*() const {
return E->get();
}
_FORCE_INLINE_ T *operator->() const { return &E->get(); }
_FORCE_INLINE_ Iterator &operator++() {
E = E->next();
return *this;
}
_FORCE_INLINE_ Iterator &operator--() {
E = E->prev();
return *this;
}
_FORCE_INLINE_ bool operator==(const Iterator &b) const { return E == b.E; }
_FORCE_INLINE_ bool operator!=(const Iterator &b) const { return E != b.E; }
explicit operator bool() const { return E != nullptr; }
Iterator(Element *p_E) { E = p_E; }
Iterator() {}
Iterator(const Iterator &p_it) { E = p_it.E; }
private:
Element *E = nullptr;
};
struct ConstIterator {
_FORCE_INLINE_ const T &operator*() const {
return E->get();
}
_FORCE_INLINE_ const T *operator->() const { return &E->get(); }
_FORCE_INLINE_ ConstIterator &operator++() {
E = E->next();
return *this;
}
_FORCE_INLINE_ ConstIterator &operator--() {
E = E->prev();
return *this;
}
_FORCE_INLINE_ bool operator==(const ConstIterator &b) const { return E == b.E; }
_FORCE_INLINE_ bool operator!=(const ConstIterator &b) const { return E != b.E; }
_FORCE_INLINE_ ConstIterator(const Element *p_E) { E = p_E; }
_FORCE_INLINE_ ConstIterator() {}
_FORCE_INLINE_ ConstIterator(const ConstIterator &p_it) { E = p_it.E; }
explicit operator bool() const { return E != nullptr; }
private:
const Element *E = nullptr;
};
_FORCE_INLINE_ Iterator begin() {
return Iterator(front());
}
_FORCE_INLINE_ Iterator end() {
return Iterator(nullptr);
}
#if 0
//to use when replacing find()
_FORCE_INLINE_ Iterator find(const K &p_key) {
return Iterator(find(p_key));
}
#endif
_FORCE_INLINE_ ConstIterator begin() const {
return ConstIterator(front());
}
_FORCE_INLINE_ ConstIterator end() const {
return ConstIterator(nullptr);
}
#if 0
//to use when replacing find()
_FORCE_INLINE_ ConstIterator find(const K &p_key) const {
return ConstIterator(find(p_key));
}
#endif
private:
struct _Data {
Element *_root = nullptr;
Element *_nil = nullptr;
int size_cache = 0;
Element *_root;
Element *_nil;
int size_cache;
_FORCE_INLINE_ _Data() {
#ifdef GLOBALNIL_DISABLED
@ -176,6 +98,8 @@ private:
#else
_nil = (Element *)&_GlobalNilClass::_nil;
#endif
_root = nullptr;
size_cache = 0;
}
void _create_root() {
@ -331,7 +255,7 @@ private:
void _insert_rb_fix(Element *p_new_node) {
Element *node = p_new_node;
Element *nparent = node->parent;
Element *ngrand_parent = nullptr;
Element *ngrand_parent;
while (nparent->color == RED) {
ngrand_parent = nparent->parent;
@ -485,7 +409,7 @@ private:
Element *rp = ((p_node->left == _data._nil) || (p_node->right == _data._nil)) ? p_node : p_node->_next;
Element *node = (rp->left == _data._nil) ? rp->right : rp->left;
Element *sibling = nullptr;
Element *sibling;
if (rp == rp->parent->left) {
rp->parent->left = node;
sibling = rp->parent->right;
@ -664,12 +588,8 @@ public:
return e;
}
inline bool is_empty() const {
return _data.size_cache == 0;
}
inline int size() const {
return _data.size_cache;
}
inline bool empty() const { return _data.size_cache == 0; }
inline int size() const { return _data.size_cache; }
int calculate_depth() const {
// used for debug mostly
@ -701,11 +621,12 @@ public:
_copy_from(p_set);
}
_FORCE_INLINE_ RBSet() {}
_FORCE_INLINE_ RBSet() {
}
~RBSet() {
clear();
}
};
#endif // RB_SET_H
#endif

View File

@ -34,7 +34,7 @@
#include "core/os/memory.h"
#include "core/containers/rid_handle.h"
#include "core/os/safe_refcount.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/typedefs.h"
#ifndef RID_HANDLES_ENABLED
@ -120,7 +120,7 @@ template <class T>
class RID_Owner : public RID_OwnerBase {
public:
#ifdef DEBUG_ENABLED
mutable Set<RID_Data *> id_map;
mutable RBSet<RID_Data *> id_map;
#endif
public:
_FORCE_INLINE_ RID make_rid(T *p_data) {
@ -179,7 +179,7 @@ public:
void get_owned_list(List<RID> *p_owned) {
#ifdef DEBUG_ENABLED
for (typename Set<RID_Data *>::Element *E = id_map.front(); E; E = E->next()) {
for (typename RBSet<RID_Data *>::Element *E = id_map.front(); E; E = E->next()) {
RID r;
_set_data(r, static_cast<T *>(E->get()));
p_owned->push_back(r);

View File

@ -1,631 +0,0 @@
#ifndef SET_H
#define SET_H
/*************************************************************************/
/* set.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "core/os/memory.h"
#include "core/typedefs.h"
// based on the very nice implementation of rb-trees by:
// https://web.archive.org/web/20120507164830/http://web.mit.edu/~emin/www/source_code/red_black_tree/index.html
template <class T, class C = Comparator<T>, class A = DefaultAllocator>
class Set {
enum Color {
RED,
BLACK
};
struct _Data;
public:
class Element {
private:
friend class Set<T, C, A>;
int color;
Element *right;
Element *left;
Element *parent;
Element *_next;
Element *_prev;
T value;
//_Data *data;
public:
const Element *next() const {
return _next;
}
Element *next() {
return _next;
}
const Element *prev() const {
return _prev;
}
Element *prev() {
return _prev;
}
const T &get() const {
return value;
};
Element() {
color = RED;
right = nullptr;
left = nullptr;
parent = nullptr;
_next = nullptr;
_prev = nullptr;
};
};
private:
struct _Data {
Element *_root;
Element *_nil;
int size_cache;
_FORCE_INLINE_ _Data() {
#ifdef GLOBALNIL_DISABLED
_nil = memnew_allocator(Element, A);
_nil->parent = _nil->left = _nil->right = _nil;
_nil->color = BLACK;
#else
_nil = (Element *)&_GlobalNilClass::_nil;
#endif
_root = nullptr;
size_cache = 0;
}
void _create_root() {
_root = memnew_allocator(Element, A);
_root->parent = _root->left = _root->right = _nil;
_root->color = BLACK;
}
void _free_root() {
if (_root) {
memdelete_allocator<Element, A>(_root);
_root = nullptr;
}
}
~_Data() {
_free_root();
#ifdef GLOBALNIL_DISABLED
memdelete_allocator<Element, A>(_nil);
#endif
}
};
_Data _data;
inline void _set_color(Element *p_node, int p_color) {
ERR_FAIL_COND(p_node == _data._nil && p_color == RED);
p_node->color = p_color;
}
inline void _rotate_left(Element *p_node) {
Element *r = p_node->right;
p_node->right = r->left;
if (r->left != _data._nil) {
r->left->parent = p_node;
}
r->parent = p_node->parent;
if (p_node == p_node->parent->left) {
p_node->parent->left = r;
} else {
p_node->parent->right = r;
}
r->left = p_node;
p_node->parent = r;
}
inline void _rotate_right(Element *p_node) {
Element *l = p_node->left;
p_node->left = l->right;
if (l->right != _data._nil) {
l->right->parent = p_node;
}
l->parent = p_node->parent;
if (p_node == p_node->parent->right) {
p_node->parent->right = l;
} else {
p_node->parent->left = l;
}
l->right = p_node;
p_node->parent = l;
}
inline Element *_successor(Element *p_node) const {
Element *node = p_node;
if (node->right != _data._nil) {
node = node->right;
while (node->left != _data._nil) { /* returns the minimum of the right subtree of node */
node = node->left;
}
return node;
} else {
while (node == node->parent->right) {
node = node->parent;
}
if (node->parent == _data._root) {
return nullptr; // No successor, as p_node = last node
}
return node->parent;
}
}
inline Element *_predecessor(Element *p_node) const {
Element *node = p_node;
if (node->left != _data._nil) {
node = node->left;
while (node->right != _data._nil) { /* returns the minimum of the left subtree of node */
node = node->right;
}
return node;
} else {
while (node == node->parent->left) {
node = node->parent;
}
if (node == _data._root) {
return nullptr; // No predecessor, as p_node = first node.
}
return node->parent;
}
}
Element *_find(const T &p_value) const {
Element *node = _data._root->left;
C less;
while (node != _data._nil) {
if (less(p_value, node->value)) {
node = node->left;
} else if (less(node->value, p_value)) {
node = node->right;
} else {
return node; // found
}
}
return nullptr;
}
Element *_lower_bound(const T &p_value) const {
Element *node = _data._root->left;
Element *prev = nullptr;
C less;
while (node != _data._nil) {
prev = node;
if (less(p_value, node->value)) {
node = node->left;
} else if (less(node->value, p_value)) {
node = node->right;
} else {
return node; // found
}
}
if (prev == nullptr) {
return nullptr; // tree empty
}
if (less(prev->value, p_value)) {
prev = prev->_next;
}
return prev;
}
void _insert_rb_fix(Element *p_new_node) {
Element *node = p_new_node;
Element *nparent = node->parent;
Element *ngrand_parent;
while (nparent->color == RED) {
ngrand_parent = nparent->parent;
if (nparent == ngrand_parent->left) {
if (ngrand_parent->right->color == RED) {
_set_color(nparent, BLACK);
_set_color(ngrand_parent->right, BLACK);
_set_color(ngrand_parent, RED);
node = ngrand_parent;
nparent = node->parent;
} else {
if (node == nparent->right) {
_rotate_left(nparent);
node = nparent;
nparent = node->parent;
}
_set_color(nparent, BLACK);
_set_color(ngrand_parent, RED);
_rotate_right(ngrand_parent);
}
} else {
if (ngrand_parent->left->color == RED) {
_set_color(nparent, BLACK);
_set_color(ngrand_parent->left, BLACK);
_set_color(ngrand_parent, RED);
node = ngrand_parent;
nparent = node->parent;
} else {
if (node == nparent->left) {
_rotate_right(nparent);
node = nparent;
nparent = node->parent;
}
_set_color(nparent, BLACK);
_set_color(ngrand_parent, RED);
_rotate_left(ngrand_parent);
}
}
}
_set_color(_data._root->left, BLACK);
}
Element *_insert(const T &p_value) {
Element *new_parent = _data._root;
Element *node = _data._root->left;
C less;
while (node != _data._nil) {
new_parent = node;
if (less(p_value, node->value)) {
node = node->left;
} else if (less(node->value, p_value)) {
node = node->right;
} else {
return node; // Return existing node
}
}
Element *new_node = memnew_allocator(Element, A);
new_node->parent = new_parent;
new_node->right = _data._nil;
new_node->left = _data._nil;
new_node->value = p_value;
//new_node->data=_data;
if (new_parent == _data._root || less(p_value, new_parent->value)) {
new_parent->left = new_node;
} else {
new_parent->right = new_node;
}
new_node->_next = _successor(new_node);
new_node->_prev = _predecessor(new_node);
if (new_node->_next) {
new_node->_next->_prev = new_node;
}
if (new_node->_prev) {
new_node->_prev->_next = new_node;
}
_data.size_cache++;
_insert_rb_fix(new_node);
return new_node;
}
void _erase_fix_rb(Element *p_node) {
Element *root = _data._root->left;
Element *node = _data._nil;
Element *sibling = p_node;
Element *parent = sibling->parent;
while (node != root) { // If red node found, will exit at a break
if (sibling->color == RED) {
_set_color(sibling, BLACK);
_set_color(parent, RED);
if (sibling == parent->right) {
sibling = sibling->left;
_rotate_left(parent);
} else {
sibling = sibling->right;
_rotate_right(parent);
}
}
if ((sibling->left->color == BLACK) && (sibling->right->color == BLACK)) {
_set_color(sibling, RED);
if (parent->color == RED) {
_set_color(parent, BLACK);
break;
} else { // loop: haven't found any red nodes yet
node = parent;
parent = node->parent;
sibling = (node == parent->left) ? parent->right : parent->left;
}
} else {
if (sibling == parent->right) {
if (sibling->right->color == BLACK) {
_set_color(sibling->left, BLACK);
_set_color(sibling, RED);
_rotate_right(sibling);
sibling = sibling->parent;
}
_set_color(sibling, parent->color);
_set_color(parent, BLACK);
_set_color(sibling->right, BLACK);
_rotate_left(parent);
break;
} else {
if (sibling->left->color == BLACK) {
_set_color(sibling->right, BLACK);
_set_color(sibling, RED);
_rotate_left(sibling);
sibling = sibling->parent;
}
_set_color(sibling, parent->color);
_set_color(parent, BLACK);
_set_color(sibling->left, BLACK);
_rotate_right(parent);
break;
}
}
}
ERR_FAIL_COND(_data._nil->color != BLACK);
}
void _erase(Element *p_node) {
Element *rp = ((p_node->left == _data._nil) || (p_node->right == _data._nil)) ? p_node : p_node->_next;
Element *node = (rp->left == _data._nil) ? rp->right : rp->left;
Element *sibling;
if (rp == rp->parent->left) {
rp->parent->left = node;
sibling = rp->parent->right;
} else {
rp->parent->right = node;
sibling = rp->parent->left;
}
if (node->color == RED) {
node->parent = rp->parent;
_set_color(node, BLACK);
} else if (rp->color == BLACK && rp->parent != _data._root) {
_erase_fix_rb(sibling);
}
if (rp != p_node) {
ERR_FAIL_COND(rp == _data._nil);
rp->left = p_node->left;
rp->right = p_node->right;
rp->parent = p_node->parent;
rp->color = p_node->color;
if (p_node->left != _data._nil) {
p_node->left->parent = rp;
}
if (p_node->right != _data._nil) {
p_node->right->parent = rp;
}
if (p_node == p_node->parent->left) {
p_node->parent->left = rp;
} else {
p_node->parent->right = rp;
}
}
if (p_node->_next) {
p_node->_next->_prev = p_node->_prev;
}
if (p_node->_prev) {
p_node->_prev->_next = p_node->_next;
}
memdelete_allocator<Element, A>(p_node);
_data.size_cache--;
ERR_FAIL_COND(_data._nil->color == RED);
}
void _calculate_depth(Element *p_element, int &max_d, int d) const {
if (p_element == _data._nil) {
return;
}
_calculate_depth(p_element->left, max_d, d + 1);
_calculate_depth(p_element->right, max_d, d + 1);
if (d > max_d) {
max_d = d;
}
}
void _cleanup_tree(Element *p_element) {
if (p_element == _data._nil) {
return;
}
_cleanup_tree(p_element->left);
_cleanup_tree(p_element->right);
memdelete_allocator<Element, A>(p_element);
}
void _copy_from(const Set &p_set) {
clear();
// not the fastest way, but safeset to write.
for (Element *I = p_set.front(); I; I = I->next()) {
insert(I->get());
}
}
public:
const Element *find(const T &p_value) const {
if (!_data._root) {
return nullptr;
}
const Element *res = _find(p_value);
return res;
}
Element *find(const T &p_value) {
if (!_data._root) {
return nullptr;
}
Element *res = _find(p_value);
return res;
}
Element *lower_bound(const T &p_value) const {
if (!_data._root) {
return nullptr;
}
return _lower_bound(p_value);
}
bool has(const T &p_value) const {
return find(p_value) != nullptr;
}
Element *insert(const T &p_value) {
if (!_data._root) {
_data._create_root();
}
return _insert(p_value);
}
void erase(Element *p_element) {
if (!_data._root || !p_element) {
return;
}
_erase(p_element);
if (_data.size_cache == 0 && _data._root) {
_data._free_root();
}
}
bool erase(const T &p_value) {
if (!_data._root) {
return false;
}
Element *e = find(p_value);
if (!e) {
return false;
}
_erase(e);
if (_data.size_cache == 0 && _data._root) {
_data._free_root();
}
return true;
}
Element *front() const {
if (!_data._root) {
return nullptr;
}
Element *e = _data._root->left;
if (e == _data._nil) {
return nullptr;
}
while (e->left != _data._nil) {
e = e->left;
}
return e;
}
Element *back() const {
if (!_data._root) {
return nullptr;
}
Element *e = _data._root->left;
if (e == _data._nil) {
return nullptr;
}
while (e->right != _data._nil) {
e = e->right;
}
return e;
}
inline bool empty() const { return _data.size_cache == 0; }
inline int size() const { return _data.size_cache; }
int calculate_depth() const {
// used for debug mostly
if (!_data._root) {
return 0;
}
int max_d = 0;
_calculate_depth(_data._root->left, max_d, 0);
return max_d;
}
void clear() {
if (!_data._root) {
return;
}
_cleanup_tree(_data._root->left);
_data._root->left = _data._nil;
_data.size_cache = 0;
_data._free_root();
}
void operator=(const Set &p_set) {
_copy_from(p_set);
}
Set(const Set &p_set) {
_copy_from(p_set);
}
_FORCE_INLINE_ Set() {
}
~Set() {
clear();
}
};
#endif

View File

@ -382,7 +382,7 @@ Error DirAccessPack::list_dir_begin() {
list_dirs.push_back(E->key());
}
for (Set<String>::Element *E = current->files.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = current->files.front(); E; E = E->next()) {
list_files.push_back(E->get());
}

View File

@ -35,7 +35,7 @@
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/string/print_string.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/hashfuncs.h"
// Pandemonium's packed file magic header ("GDPC" in ASCII).
@ -64,7 +64,7 @@ private:
PackedDir *parent;
String name;
RBMap<String, PackedDir *> subdirs;
Set<String> files;
RBSet<String> files;
};
struct PathMD5 {

View File

@ -55,7 +55,7 @@ static String _make_indent(const String &p_indent, int p_size) {
return indent_text;
}
String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys, Set<const void *> &p_markers) {
String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys, RBSet<const void *> &p_markers) {
String colon = ":";
String end_statement = "";
@ -130,7 +130,7 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_
}
String JSON::print(const Variant &p_var, const String &p_indent, bool p_sort_keys) {
Set<const void *> markers;
RBSet<const void *> markers;
return _print_var(p_var, p_indent, 0, p_sort_keys, markers);
}

View File

@ -62,7 +62,7 @@ class JSON {
static const char *tk_name[TK_MAX];
static String _print_var(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys, Set<const void *> &p_markers);
static String _print_var(const Variant &p_var, const String &p_indent, int p_cur_indent, bool p_sort_keys, RBSet<const void *> &p_markers);
static Error _get_token(const CharType *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str);
static Error _parse_value(Variant &value, Token &token, const CharType *p_str, int &index, int p_len, int &line, String &r_err_str);

View File

@ -144,7 +144,7 @@ void RotatedFileLogger::clear_old_backups() {
da->list_dir_begin();
String f = da->get_next();
Set<String> backups;
RBSet<String> backups;
while (f != String()) {
if (!da->current_is_dir() && f.begins_with(basename) && f.get_extension() == extension && f != base_path.get_file()) {
backups.insert(f);
@ -157,7 +157,7 @@ void RotatedFileLogger::clear_old_backups() {
// since backups are appended with timestamp and Set iterates them in sorted order,
// first backups are the oldest
int to_delete = backups.size() - max_backups;
for (Set<String>::Element *E = backups.front(); E && to_delete > 0; E = E->next(), --to_delete) {
for (RBSet<String>::Element *E = backups.front(); E && to_delete > 0; E = E->next(), --to_delete) {
da->remove(E->get());
}
}

View File

@ -366,7 +366,7 @@ bool MultiplayerAPI::_send_confirm_path(NodePath p_path, PathSentCache *psc, int
bool has_all_peers = true;
List<int> peers_to_add; // If one is missing, take note to add it.
for (Set<int>::Element *E = connected_peers.front(); E; E = E->next()) {
for (RBSet<int>::Element *E = connected_peers.front(); E; E = E->next()) {
if (p_target < 0 && E->get() == -p_target) {
continue; // Continue, excluded.
}
@ -503,7 +503,7 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, const
MAKE_ROOM(ofs + path_len);
encode_cstring(pname.get_data(), &(packet_cache.write[ofs]));
for (Set<int>::Element *E = connected_peers.front(); E; E = E->next()) {
for (RBSet<int>::Element *E = connected_peers.front(); E; E = E->next()) {
if (p_to < 0 && E->get() == -p_to) {
continue; // Continue, excluded.
}
@ -663,7 +663,7 @@ Vector<int> MultiplayerAPI::get_network_connected_peers() const {
ERR_FAIL_COND_V_MSG(!network_peer.is_valid(), Vector<int>(), "No network peer is assigned. Assume no peers are connected.");
Vector<int> ret;
for (Set<int>::Element *E = connected_peers.front(); E; E = E->next()) {
for (RBSet<int>::Element *E = connected_peers.front(); E; E = E->next()) {
ret.push_back(E->get());
}

View File

@ -82,7 +82,7 @@ private:
Ref<NetworkedMultiplayerPeer> network_peer;
int rpc_sender_id;
Set<int> connected_peers;
RBSet<int> connected_peers;
HashMap<NodePath, PathSentCache> path_send_cache;
RBMap<int, PathGetCache> path_get_cache;
int last_send_cache_id;

View File

@ -1325,7 +1325,7 @@ void ResourceFormatSaverBinaryInstance::_write_variant(const Variant &p_property
write_variant(f, p_property, resource_set, external_resources, string_map, p_hint);
}
void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Variant &p_property, Set<RES> &resource_set, RBMap<RES, int> &external_resources, RBMap<StringName, int> &string_map, const PropertyInfo &p_hint) {
void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Variant &p_property, RBSet<RES> &resource_set, RBMap<RES, int> &external_resources, RBMap<StringName, int> &string_map, const PropertyInfo &p_hint) {
switch (p_property.get_type()) {
case Variant::NIL: {
f->store_32(VARIANT_NIL);
@ -1999,7 +1999,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p
// save internal resource table
f->store_32(saved_resources.size()); //amount of internal resources
Vector<uint64_t> ofs_pos;
Set<int> used_indices;
RBSet<int> used_indices;
for (List<RES>::Element *E = saved_resources.front(); E; E = E->next()) {
RES r = E->get();

View File

@ -119,7 +119,7 @@ class ResourceFormatSaverBinaryInstance {
bool takeover_paths;
FileAccess *f;
String magic;
Set<RES> resource_set;
RBSet<RES> resource_set;
struct NonPersistentKey { //for resource properties generated on the fly
RES base;
@ -153,7 +153,7 @@ class ResourceFormatSaverBinaryInstance {
public:
Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0);
static void write_variant(FileAccess *f, const Variant &p_property, Set<RES> &resource_set, RBMap<RES, int> &external_resources, RBMap<StringName, int> &string_map, const PropertyInfo &p_hint = PropertyInfo());
static void write_variant(FileAccess *f, const Variant &p_property, RBSet<RES> &resource_set, RBMap<RES, int> &external_resources, RBMap<StringName, int> &string_map, const PropertyInfo &p_hint = PropertyInfo());
};
class ResourceFormatSaverBinary : public ResourceFormatSaver {

View File

@ -141,7 +141,7 @@ RES ResourceFormatImporter::load(const String &p_path, const String &p_original_
}
void ResourceFormatImporter::get_recognized_extensions(List<String> *p_extensions) const {
Set<String> found;
RBSet<String> found;
for (int i = 0; i < importers.size(); i++) {
List<String> local_exts;
@ -161,7 +161,7 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_
return;
}
Set<String> found;
RBSet<String> found;
for (int i = 0; i < importers.size(); i++) {
String res_type = importers[i]->get_resource_type();

View File

@ -152,7 +152,7 @@ void AStar::connect_points(int p_id, int p_with_id, bool bidirectional) {
s.direction = Segment::BIDIRECTIONAL;
}
Set<Segment>::Element *element = segments.find(s);
RBSet<Segment>::Element *element = segments.find(s);
if (element != nullptr) {
s.direction |= element->get().direction;
if (s.direction == Segment::BIDIRECTIONAL) {
@ -178,7 +178,7 @@ void AStar::disconnect_points(int p_id, int p_with_id, bool bidirectional) {
Segment s(p_id, p_with_id);
int remove_direction = bidirectional ? (int)Segment::BIDIRECTIONAL : s.direction;
Set<Segment>::Element *element = segments.find(s);
RBSet<Segment>::Element *element = segments.find(s);
if (element != nullptr) {
// s is the new segment
// Erase the directions to be removed
@ -236,7 +236,7 @@ PoolVector<int> AStar::get_point_connections(int p_id) {
bool AStar::are_points_connected(int p_id, int p_with_id, bool bidirectional) const {
Segment s(p_id, p_with_id);
const Set<Segment>::Element *element = segments.find(s);
const RBSet<Segment>::Element *element = segments.find(s);
return element != nullptr &&
(bidirectional || (element->get().direction & s.direction) == s.direction);
@ -294,7 +294,7 @@ Vector3 AStar::get_closest_position_in_segment(const Vector3 &p_point) const {
real_t closest_dist = 1e20;
Vector3 closest_point;
for (const Set<Segment>::Element *E = segments.front(); E; E = E->next()) {
for (const RBSet<Segment>::Element *E = segments.front(); E; E = E->next()) {
Point *from_point = nullptr, *to_point = nullptr;
points.lookup(E->get().u, from_point);
points.lookup(E->get().v, to_point);

View File

@ -115,7 +115,7 @@ class AStar : public Reference {
uint64_t pass;
OAHashMap<int, Point *> points;
Set<Segment> segments;
RBSet<Segment> segments;
bool _solve(Point *begin_point, Point *end_point);

View File

@ -47,7 +47,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me
Vector<bool> valid_points;
valid_points.resize(p_points.size());
Set<Vector3> valid_cache;
RBSet<Vector3> valid_cache;
for (int i = 0; i < p_points.size(); i++) {
Vector3 sp = p_points[i].snapped(Vector3(0.0001, 0.0001, 0.0001));

View File

@ -33,7 +33,7 @@
#include "core/containers/list.h"
#include "core/math/aabb.h"
#include "core/math/geometry.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
class QuickHull {
public:

View File

@ -1338,7 +1338,7 @@ void ClassDB::get_extensions_for_type(const StringName &p_class, List<String> *p
}
HashMap<StringName, HashMap<StringName, Variant>> ClassDB::default_values;
Set<StringName> ClassDB::default_values_cached;
RBSet<StringName> ClassDB::default_values_cached;
Variant ClassDB::class_get_default_property_value(const StringName &p_class, const StringName &p_property, bool *r_valid) {
if (!default_values_cached.has(p_class)) {

View File

@ -119,7 +119,7 @@ public:
#ifdef DEBUG_METHODS_ENABLED
List<StringName> constant_order;
List<StringName> method_order;
Set<StringName> methods_in_properties;
RBSet<StringName> methods_in_properties;
List<MethodInfo> virtual_methods;
StringName category;
#endif
@ -155,7 +155,7 @@ public:
static void _add_class2(const StringName &p_class, const StringName &p_inherits);
static HashMap<StringName, HashMap<StringName, Variant>> default_values;
static Set<StringName> default_values_cached;
static RBSet<StringName> default_values_cached;
private:
// Non-locking variants of get_parent_class and is_parent_class.

View File

@ -36,7 +36,7 @@
#include "core/object/object_id.h"
#include "core/os/rw_lock.h"
#include "core/os/safe_refcount.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/variant/variant.h"
#include "core/containers/vmap.h"
@ -487,7 +487,7 @@ private:
#endif
bool _block_signals;
int _predelete_ok;
Set<Object *> change_receptors;
RBSet<Object *> change_receptors;
ObjectID _instance_id;
std::atomic<ObjectRC *> _rc;
bool _predelete();
@ -497,7 +497,7 @@ private:
#ifdef TOOLS_ENABLED
bool _edited;
uint32_t _edited_version;
Set<String> editor_section_folding;
RBSet<String> editor_section_folding;
#endif
ScriptInstance *script_instance;
RefPtr script;
@ -601,7 +601,7 @@ public:
#ifdef TOOLS_ENABLED
_FORCE_INLINE_ void _change_notify(const char *p_property = "") {
_edited = true;
for (Set<Object *>::Element *E = change_receptors.front(); E; E = E->next()) {
for (RBSet<Object *>::Element *E = change_receptors.front(); E; E = E->next()) {
((Object *)(E->get()))->_changed_callback(this, p_property);
}
}
@ -792,7 +792,7 @@ public:
#ifdef TOOLS_ENABLED
void editor_set_section_unfold(const String &p_section, bool p_unfolded);
bool editor_is_section_unfolded(const String &p_section);
const Set<String> &editor_get_section_folding() const {
const RBSet<String> &editor_get_section_folding() const {
return editor_section_folding;
}
void editor_clear_section_folding() {

View File

@ -251,7 +251,7 @@ void Resource::unregister_owner(Object *p_owner) {
}
void Resource::notify_change_to_owners() {
for (Set<ObjectID>::Element *E = owners.front(); E; E = E->next()) {
for (RBSet<ObjectID>::Element *E = owners.front(); E; E = E->next()) {
Object *obj = ObjectDB::get_instance(E->get());
ERR_CONTINUE_MSG(!obj, "Object was deleted, while still owning a resource."); //wtf
//TODO store string

View File

@ -49,7 +49,7 @@ class Resource : public Reference {
OBJ_CATEGORY("Resources");
RES_BASE_EXTENSION("res");
Set<ObjectID> owners;
RBSet<ObjectID> owners;
friend class ResBase;
friend class ResourceCache;

View File

@ -159,14 +159,14 @@ void ScriptDebuggerLocal::debug(ScriptLanguage *p_script, bool p_can_continue, b
} else if (line.begins_with("br") || line.begins_with("break")) {
if (line.get_slice_count(" ") <= 1) {
const RBMap<int, Set<StringName>> &breakpoints = get_breakpoints();
const RBMap<int, RBSet<StringName>> &breakpoints = get_breakpoints();
if (breakpoints.size() == 0) {
print_line("No Breakpoints.");
continue;
}
print_line("Breakpoint(s): " + itos(breakpoints.size()));
for (RBMap<int, Set<StringName>>::Element *E = breakpoints.front(); E; E = E->next()) {
for (RBMap<int, RBSet<StringName>>::Element *E = breakpoints.front(); E; E = E->next()) {
print_line("\t" + String(E->value().front()->get()) + ":" + itos(E->key()));
}

View File

@ -378,7 +378,7 @@ int ScriptDebugger::get_depth() const {
void ScriptDebugger::insert_breakpoint(int p_line, const StringName &p_source) {
if (!breakpoints.has(p_line)) {
breakpoints[p_line] = Set<StringName>();
breakpoints[p_line] = RBSet<StringName>();
}
breakpoints[p_line].insert(p_source);
}
@ -539,7 +539,7 @@ bool PlaceHolderScriptInstance::has_method(const StringName &p_method) const {
}
void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, const RBMap<StringName, Variant> &p_values) {
Set<StringName> new_values;
RBSet<StringName> new_values;
for (const List<PropertyInfo>::Element *E = p_properties.front(); E; E = E->next()) {
StringName n = E->get().name;
new_values.insert(n);

View File

@ -150,7 +150,7 @@ public:
virtual int get_member_line(const StringName &p_member) const { return -1; }
virtual void get_constants(RBMap<StringName, Variant> *p_constants) {}
virtual void get_members(Set<StringName> *p_constants) {}
virtual void get_members(RBSet<StringName> *p_constants) {}
virtual bool is_placeholder_fallback_enabled() const { return false; }
@ -269,7 +269,7 @@ public:
virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const = 0;
virtual void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) {}
virtual bool is_using_templates() { return false; }
virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = nullptr, List<Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const = 0;
virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = nullptr, List<Warning> *r_warnings = nullptr, RBSet<int> *r_safe_lines = nullptr) const = 0;
virtual String validate_path(const String &p_path) const { return ""; }
virtual Script *create_script() const = 0;
virtual bool has_named_classes() const = 0;
@ -416,7 +416,7 @@ class ScriptDebugger {
int depth;
static ScriptDebugger *singleton;
RBMap<int, Set<StringName>> breakpoints;
RBMap<int, RBSet<StringName>> breakpoints;
ScriptLanguage *break_lang;
@ -434,7 +434,7 @@ public:
bool is_breakpoint(int p_line, const StringName &p_source) const;
bool is_breakpoint_line(int p_line) const;
void clear_breakpoints();
const RBMap<int, Set<StringName>> &get_breakpoints() const { return breakpoints; }
const RBMap<int, RBSet<StringName>> &get_breakpoints() const { return breakpoints; }
virtual void debug(ScriptLanguage *p_script, bool p_can_continue = true, bool p_is_error_breakpoint = false) = 0;
virtual void idle_poll();

View File

@ -1006,7 +1006,7 @@ String TranslationServer::get_locale_name(const String &p_locale) const {
Array TranslationServer::get_loaded_locales() const {
Array locales;
for (const Set<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
for (const RBSet<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
const Ref<Translation> &t = E->get();
ERR_FAIL_COND_V(t.is_null(), Array());
String l = t->get_locale();
@ -1080,7 +1080,7 @@ StringName TranslationServer::translate(const StringName &p_message) const {
String lang = get_language_code(locale);
bool near_match = false;
for (const Set<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
for (const RBSet<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
const Ref<Translation> &t = E->get();
ERR_FAIL_COND_V(t.is_null(), p_message);
String l = t->get_locale();
@ -1113,7 +1113,7 @@ StringName TranslationServer::translate(const StringName &p_message) const {
String fallback_lang = get_language_code(fallback);
near_match = false;
for (const Set<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
for (const RBSet<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
const Ref<Translation> &t = E->get();
ERR_FAIL_COND_V(t.is_null(), p_message);
String l = t->get_locale();

View File

@ -68,7 +68,7 @@ class TranslationServer : public Object {
String locale;
String fallback;
Set<Ref<Translation>> translations;
RBSet<Ref<Translation>> translations;
Ref<Translation> tool_translation;
Ref<Translation> doc_translation;

View File

@ -3797,7 +3797,7 @@ bool RasterizerSceneGLES2::free(RID p_rid) {
LightInstance *light_instance = light_instance_owner.getptr(p_rid);
//remove from shadow atlases..
for (Set<RID>::Element *E = light_instance->shadow_atlases.front(); E; E = E->next()) {
for (RBSet<RID>::Element *E = light_instance->shadow_atlases.front(); E; E = E->next()) {
ShadowAtlas *shadow_atlas = shadow_atlas_owner.get(E->get());
ERR_CONTINUE(!shadow_atlas->shadow_owners.has(p_rid));
uint32_t key = shadow_atlas->shadow_owners[p_rid];

View File

@ -534,7 +534,7 @@ public:
// used for sorting lights for a consistent render
uint32_t light_counter;
Set<RID> shadow_atlases; // atlases where this light is registered
RBSet<RID> shadow_atlases; // atlases where this light is registered
};
mutable RID_Owner<LightInstance> light_instance_owner;

View File

@ -4112,7 +4112,7 @@ void RasterizerStorageGLES2::update_dirty_skeletons() {
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, skeleton->size * (skeleton->use_2d ? 2 : 3), 1, GL_RGBA, GL_FLOAT, skeleton->bone_data.ptr());
}
for (Set<RasterizerScene::InstanceBase *>::Element *E = skeleton->instances.front(); E; E = E->next()) {
for (RBSet<RasterizerScene::InstanceBase *>::Element *E = skeleton->instances.front(); E; E = E->next()) {
E->get()->base_changed(true, false);
}
@ -5621,7 +5621,7 @@ bool RasterizerStorageGLES2::free(RID p_rid) {
skeleton_update_list.remove(&s->update_list);
}
for (Set<RasterizerScene::InstanceBase *>::Element *E = s->instances.front(); E; E = E->next()) {
for (RBSet<RasterizerScene::InstanceBase *>::Element *E = s->instances.front(); E; E = E->next()) {
E->get()->skeleton = RID();
}

View File

@ -67,7 +67,7 @@ public:
// TODO implement wireframe in GLES2
// bool generate_wireframes;
Set<String> extensions;
RBSet<String> extensions;
bool float_texture_supported;
bool s3tc_supported;
@ -241,7 +241,7 @@ public:
struct Texture : RID_Data {
Texture *proxy;
Set<Texture *> proxy_owners;
RBSet<Texture *> proxy_owners;
String path;
uint32_t flags;
@ -329,7 +329,7 @@ public:
glDeleteTextures(1, &tex_id);
}
for (Set<Texture *>::Element *E = proxy_owners.front(); E; E = E->next()) {
for (RBSet<Texture *>::Element *E = proxy_owners.front(); E; E = E->next()) {
E->get()->proxy = nullptr;
}
@ -898,7 +898,7 @@ public:
GLuint tex_id;
SelfList<Skeleton> update_list;
Set<RasterizerScene::InstanceBase *> instances;
RBSet<RasterizerScene::InstanceBase *> instances;
Transform2D base_transform_2d;

View File

@ -217,7 +217,7 @@ static String get_constant_text(SL::DataType p_type, const Vector<SL::ConstantNo
}
}
void ShaderCompilerGLES2::_dump_function_deps(const SL::ShaderNode *p_node, const StringName &p_for_func, const RBMap<StringName, String> &p_func_code, StringBuilder &r_to_add, Set<StringName> &r_added) {
void ShaderCompilerGLES2::_dump_function_deps(const SL::ShaderNode *p_node, const StringName &p_for_func, const RBMap<StringName, String> &p_func_code, StringBuilder &r_to_add, RBSet<StringName> &r_added) {
int fidx = -1;
for (int i = 0; i < p_node->functions.size(); i++) {
@ -229,7 +229,7 @@ void ShaderCompilerGLES2::_dump_function_deps(const SL::ShaderNode *p_node, cons
ERR_FAIL_COND(fidx == -1);
for (Set<StringName>::Element *E = p_node->functions[fidx].uses_function.front(); E; E = E->next()) {
for (RBSet<StringName>::Element *E = p_node->functions[fidx].uses_function.front(); E; E = E->next()) {
if (r_added.has(E->get())) {
continue;
}
@ -461,8 +461,8 @@ String ShaderCompilerGLES2::_dump_node_code(const SL::Node *p_node, int p_level,
function = nullptr;
}
Set<StringName> added_vertex;
Set<StringName> added_fragment;
RBSet<StringName> added_vertex;
RBSet<StringName> added_fragment;
for (int i = 0; i < snode->functions.size(); i++) {
SL::FunctionNode *fnode = snode->functions[i].function;

View File

@ -72,7 +72,7 @@ private:
RBMap<StringName, String> usage_defines;
};
void _dump_function_deps(const ShaderLanguage::ShaderNode *p_node, const StringName &p_for_func, const RBMap<StringName, String> &p_func_code, StringBuilder &r_to_add, Set<StringName> &r_added);
void _dump_function_deps(const ShaderLanguage::ShaderNode *p_node, const StringName &p_for_func, const RBMap<StringName, String> &p_func_code, StringBuilder &r_to_add, RBSet<StringName> &r_added);
String _dump_node_code(const ShaderLanguage::Node *p_node, int p_level, GeneratedCode &r_gen_code, IdentifierActions &p_actions, const DefaultIdentifierActions &p_default_actions, bool p_assigning, bool p_use_scope = true);
const ShaderLanguage::ShaderNode *shader;
@ -83,11 +83,11 @@ private:
StringName light_name;
StringName time_name;
Set<StringName> used_name_defines;
Set<StringName> used_flag_pointers;
Set<StringName> used_rmode_defines;
Set<StringName> internal_functions;
Set<StringName> fragment_varyings;
RBSet<StringName> used_name_defines;
RBSet<StringName> used_flag_pointers;
RBSet<StringName> used_rmode_defines;
RBSet<StringName> internal_functions;
RBSet<StringName> fragment_varyings;
DefaultIdentifierActions actions[RS::SHADER_MAX];

View File

@ -634,7 +634,7 @@ void ShaderGLES2::free_custom_shader(uint32_t p_code_id) {
VersionKey key;
key.code_version = p_code_id;
for (Set<uint64_t>::Element *E = custom_code_map[p_code_id].versions.front(); E; E = E->next()) {
for (RBSet<uint64_t>::Element *E = custom_code_map[p_code_id].versions.front(); E; E = E->next()) {
key.version = E->get();
ERR_CONTINUE(!version_map.has(key));
Version &v = version_map[key];

View File

@ -98,7 +98,7 @@ private:
Vector<StringName> texture_uniforms;
Vector<StringName> custom_uniforms;
Vector<CharString> custom_defines;
Set<uint64_t> versions;
RBSet<uint64_t> versions;
};
struct Version {

View File

@ -860,11 +860,11 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
List<AnimMoveRestore> to_restore;
// 1-remove the keys
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
undo_redo->add_do_method(animation.ptr(), "track_remove_key", track, E->get());
}
// 2- remove overlapped keys
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
float newtime = editor->snap_time(animation->track_get_key_time(track, E->get()) + moving_selection_offset.x);
int idx = animation->track_find_key(track, newtime, true);
@ -887,7 +887,7 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
}
// 3-move the keys (re insert them)
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
float newpos = editor->snap_time(animation->track_get_key_time(track, E->get()) + moving_selection_offset.x);
/*
if (newpos<0)
@ -901,7 +901,7 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
}
// 4-(undo) remove inserted keys
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
float newpos = editor->snap_time(animation->track_get_key_time(track, E->get()) + moving_selection_offset.x);
/*
if (newpos<0)
@ -911,7 +911,7 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
}
// 5-(undo) reinsert keys
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
float oldpos = animation->track_get_key_time(track, E->get());
undo_redo->add_undo_method(animation.ptr(), "track_insert_key", track, oldpos, animation->track_get_key_value(track, E->get()), 1);
}
@ -927,7 +927,7 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
// 7-reselect
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
float oldpos = animation->track_get_key_time(track, E->get());
float newpos = editor->snap_time(oldpos + moving_selection_offset.x);
@ -1076,7 +1076,7 @@ void AnimationBezierTrackEdit::duplicate_selection() {
}
float top_time = 1e10;
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
float t = animation->track_get_key_time(track, E->get());
if (t < top_time) {
top_time = t;
@ -1087,7 +1087,7 @@ void AnimationBezierTrackEdit::duplicate_selection() {
List<Pair<int, float>> new_selection_values;
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
float t = animation->track_get_key_time(track, E->get());
float dst_time = t + (timeline->get_play_position() - top_time);
int existing_idx = animation->track_find_key(track, dst_time, true);
@ -1130,7 +1130,7 @@ void AnimationBezierTrackEdit::delete_selection() {
if (selection.size()) {
undo_redo->create_action(TTR("Anim Delete Keys"));
for (Set<int>::Element *E = selection.back(); E; E = E->prev()) {
for (RBSet<int>::Element *E = selection.back(); E; E = E->prev()) {
undo_redo->add_do_method(animation.ptr(), "track_remove_key", track, E->get());
undo_redo->add_undo_method(animation.ptr(), "track_insert_key", track, animation->track_get_key_time(track, E->get()), animation->track_get_key_value(track, E->get()), 1);
}

View File

@ -37,7 +37,7 @@
#include "core/math/vector2.h"
#include "core/object/object.h"
#include "core/object/reference.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
#include "core/containers/vector.h"
@ -148,7 +148,7 @@ class AnimationBezierTrackEdit : public Control {
Vector<EditPoint> edit_points;
Set<int> selection;
RBSet<int> selection;
bool panning_timeline;
float panning_timeline_from;

View File

@ -49,7 +49,7 @@
#include "core/containers/pair.h"
#include "core/object/resource.h"
#include "core/object/script_language.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"
#include "core/object/undo_redo.h"
@ -5720,7 +5720,7 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
undo_redo->create_action(TTR("Anim Add RESET Keys"));
Ref<Animation> reset = _create_and_get_reset_animation();
int reset_tracks = reset->get_track_count();
Set<int> tracks_added;
RBSet<int> tracks_added;
for (RBMap<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
const SelectedKey &sk = E->key();

View File

@ -338,7 +338,7 @@ void CreateDialog::_update_search() {
if (cpp_type) {
bool skip = false;
for (Set<StringName>::Element *E = type_blacklist.front(); E && !skip; E = E->next()) {
for (RBSet<StringName>::Element *E = type_blacklist.front(); E && !skip; E = E->next()) {
if (ClassDB::is_parent_class(type, E->get())) {
skip = true;
}

View File

@ -38,7 +38,7 @@
#include "core/object/object.h"
#include "core/object/reference.h"
#include "core/object/resource.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
@ -69,7 +69,7 @@ class CreateDialog : public ConfirmationDialog {
String preferred_search_result_type;
EditorHelpBit *help_bit;
List<StringName> type_list;
Set<StringName> type_blacklist;
RBSet<StringName> type_blacklist;
void _item_selected();

View File

@ -50,7 +50,7 @@
#include "core/os/memory.h"
#include "core/containers/pair.h"
#include "core/string/print_string.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"
#include "core/variant/variant.h"
@ -283,7 +283,7 @@ void DocData::generate(bool p_basic_types) {
bool skip_setter_getter_methods = true;
while (classes.size()) {
Set<StringName> setters_getters;
RBSet<StringName> setters_getters;
String name = classes.front()->get();
if (!ClassDB::is_class_exposed(name)) {

View File

@ -559,7 +559,7 @@ void EditorData::remove_scene(int p_idx) {
edited_scene.remove(p_idx);
}
bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, Set<String> &checked_paths) {
bool EditorData::_find_updated_instances(Node *p_root, Node *p_node, RBSet<String> &checked_paths) {
/*
if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner()))
return false;
@ -602,7 +602,7 @@ bool EditorData::check_and_update_scene(int p_idx) {
return false;
}
Set<String> checked_scenes;
RBSet<String> checked_scenes;
bool must_reload = _find_updated_instances(edited_scene[p_idx].root, edited_scene[p_idx].root, checked_scenes);

View File

@ -46,7 +46,7 @@
#include "core/object/object_id.h"
#include "core/object/reference.h"
#include "core/object/script_language.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"
#include "core/string/ustring.h"
@ -157,7 +157,7 @@ private:
Vector<EditedScene> edited_scene;
int current_edited_scene;
bool _find_updated_instances(Node *p_root, Node *p_node, Set<String> &checked_paths);
bool _find_updated_instances(Node *p_root, Node *p_node, RBSet<String> &checked_paths);
HashMap<StringName, String> _script_class_icon_paths;
HashMap<String, StringName> _script_class_file_to_path;

View File

@ -34,7 +34,7 @@
#include "core/os/dir_access.h"
#include "core/object/object.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/ustring.h"
class Button;
@ -51,7 +51,7 @@ class EditorDirDialog : public ConfirmationDialog {
AcceptDialog *mkdirerr;
Button *makedir;
Set<String> opened_paths;
RBSet<String> opened_paths;
Tree *tree;
bool updating;

View File

@ -106,7 +106,7 @@ Ref<EditorExportPlatform> EditorExportPreset::get_platform() const {
void EditorExportPreset::update_files_to_export() {
Vector<String> to_remove;
for (Set<String>::Element *E = selected_files.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = selected_files.front(); E; E = E->next()) {
if (!FileAccess::exists(E->get())) {
to_remove.push_back(E->get());
}
@ -118,7 +118,7 @@ void EditorExportPreset::update_files_to_export() {
Vector<String> EditorExportPreset::get_files_to_export() const {
Vector<String> files;
for (Set<String>::Element *E = selected_files.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = selected_files.front(); E; E = E->next()) {
files.push_back(E->get());
}
return files;
@ -470,7 +470,7 @@ Ref<EditorExportPreset> EditorExportPlatform::create_preset() {
return preset;
}
void EditorExportPlatform::_export_find_resources(EditorFileSystemDirectory *p_dir, Set<String> &p_paths) {
void EditorExportPlatform::_export_find_resources(EditorFileSystemDirectory *p_dir, RBSet<String> &p_paths) {
for (int i = 0; i < p_dir->get_subdir_count(); i++) {
_export_find_resources(p_dir->get_subdir(i), p_paths);
}
@ -480,7 +480,7 @@ void EditorExportPlatform::_export_find_resources(EditorFileSystemDirectory *p_d
}
}
void EditorExportPlatform::_export_find_dependencies(const String &p_path, Set<String> &p_paths) {
void EditorExportPlatform::_export_find_dependencies(const String &p_path, RBSet<String> &p_paths) {
if (p_paths.has(p_path)) {
return;
}
@ -501,7 +501,7 @@ void EditorExportPlatform::_export_find_dependencies(const String &p_path, Set<S
}
}
void EditorExportPlatform::_edit_files_with_filter(DirAccess *da, const Vector<String> &p_filters, Set<String> &r_list, bool exclude) {
void EditorExportPlatform::_edit_files_with_filter(DirAccess *da, const Vector<String> &p_filters, RBSet<String> &r_list, bool exclude) {
da->list_dir_begin();
String cur_dir = da->get_current_dir().replace("\\", "/");
if (!cur_dir.ends_with("/")) {
@ -549,7 +549,7 @@ void EditorExportPlatform::_edit_files_with_filter(DirAccess *da, const Vector<S
}
}
void EditorExportPlatform::_edit_filter_list(Set<String> &r_list, const String &p_filter, bool exclude) {
void EditorExportPlatform::_edit_filter_list(RBSet<String> &r_list, const String &p_filter, bool exclude) {
if (p_filter == "") {
return;
}
@ -676,10 +676,10 @@ void EditorExportPlugin::_export_end_script() {
}
}
void EditorExportPlugin::_export_file(const String &p_path, const String &p_type, const Set<String> &p_features) {
void EditorExportPlugin::_export_file(const String &p_path, const String &p_type, const RBSet<String> &p_features) {
}
void EditorExportPlugin::_export_begin(const Set<String> &p_features, bool p_debug, const String &p_path, int p_flags) {
void EditorExportPlugin::_export_begin(const RBSet<String> &p_features, bool p_debug, const String &p_path, int p_flags) {
}
void EditorExportPlugin::skip() {
@ -760,7 +760,7 @@ EditorExportPlatform::ExportNotifier::~ExportNotifier() {
Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func) {
//figure out paths of files that will be exported
Set<String> paths;
RBSet<String> paths;
Vector<String> path_remaps;
if (p_preset->get_export_filter() == EditorExportPreset::EXPORT_ALL_RESOURCES) {
@ -834,14 +834,14 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
}
FeatureContainers feature_containers = get_feature_containers(p_preset);
Set<String> &features = feature_containers.features;
RBSet<String> &features = feature_containers.features;
PoolVector<String> &features_pv = feature_containers.features_pv;
//store everything in the export medium
int idx = 0;
int total = paths.size();
for (Set<String>::Element *E = paths.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = paths.front(); E; E = E->next()) {
String path = E->get();
String type = ResourceLoader::get_resource_type(path);
@ -872,7 +872,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
List<String> remaps;
config->get_section_keys("remap", &remaps);
Set<String> remap_features;
RBSet<String> remap_features;
for (List<String>::Element *F = remaps.front(); F; F = F->next()) {
String remap = F->get();
@ -1886,12 +1886,12 @@ void EditorExportPlatformPC::get_platform_features(List<String> *r_features) {
r_features->push_back("pc"); //all pcs support "pc"
r_features->push_back("s3tc"); //all pcs support "s3tc" compression
r_features->push_back(get_os_name()); //OS name is a feature
for (Set<String>::Element *E = extra_features.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = extra_features.front(); E; E = E->next()) {
r_features->push_back(E->get());
}
}
void EditorExportPlatformPC::resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, Set<String> &p_features) {
void EditorExportPlatformPC::resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, RBSet<String> &p_features) {
if (p_features.has("bptc")) {
if (p_preset->has("texture_format/no_bptc_fallbacks")) {
p_features.erase("s3tc");
@ -1913,7 +1913,7 @@ EditorExportPlatformPC::EditorExportPlatformPC() {
///////////////////////
void EditorExportTextSceneToBinaryPlugin::_export_file(const String &p_path, const String &p_type, const Set<String> &p_features) {
void EditorExportTextSceneToBinaryPlugin::_export_file(const String &p_path, const String &p_type, const RBSet<String> &p_features) {
String extension = p_path.get_extension().to_lower();
if (extension != "tres" && extension != "tscn") {
return;

View File

@ -40,7 +40,7 @@
#include "core/containers/list.h"
#include "core/containers/rb_map.h"
#include "core/containers/pool_vector.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/vector.h"
#include "core/error/error_list.h"
#include "core/object/object.h"
@ -82,7 +82,7 @@ private:
String export_path;
String exporter;
Set<String> selected_files;
RBSet<String> selected_files;
bool runnable;
friend class EditorExport;
@ -206,21 +206,21 @@ private:
};
struct FeatureContainers {
Set<String> features;
RBSet<String> features;
PoolVector<String> features_pv;
};
Vector<ExportMessage> messages;
void _export_find_resources(EditorFileSystemDirectory *p_dir, Set<String> &p_paths);
void _export_find_dependencies(const String &p_path, Set<String> &p_paths);
void _export_find_resources(EditorFileSystemDirectory *p_dir, RBSet<String> &p_paths);
void _export_find_dependencies(const String &p_path, RBSet<String> &p_paths);
void gen_debug_flags(Vector<String> &r_flags, int p_flags);
static Error _save_pack_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total);
static Error _save_zip_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total);
void _edit_files_with_filter(DirAccess *da, const Vector<String> &p_filters, Set<String> &r_list, bool exclude);
void _edit_filter_list(Set<String> &r_list, const String &p_filter, bool exclude);
void _edit_files_with_filter(DirAccess *da, const Vector<String> &p_filters, RBSet<String> &r_list, bool exclude);
void _edit_filter_list(RBSet<String> &r_list, const String &p_filter, bool exclude);
static Error _add_shared_object(void *p_userdata, const SharedObject &p_so);
@ -338,7 +338,7 @@ public:
virtual Error export_pack(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
virtual Error export_zip(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
virtual void get_platform_features(List<String> *r_features) = 0;
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, Set<String> &p_features) = 0;
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, RBSet<String> &p_features) = 0;
EditorExportPlatform();
};
@ -408,8 +408,8 @@ protected:
void skip();
virtual void _export_file(const String &p_path, const String &p_type, const Set<String> &p_features);
virtual void _export_begin(const Set<String> &p_features, bool p_debug, const String &p_path, int p_flags);
virtual void _export_file(const String &p_path, const String &p_type, const RBSet<String> &p_features);
virtual void _export_begin(const RBSet<String> &p_features, bool p_debug, const String &p_path, int p_flags);
static void _bind_methods();
@ -488,7 +488,7 @@ private:
String debug_file_32;
String debug_file_64;
Set<String> extra_features;
RBSet<String> extra_features;
int chmod_flags;
@ -525,7 +525,7 @@ public:
void add_platform_feature(const String &p_feature);
virtual void get_platform_features(List<String> *r_features);
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, Set<String> &p_features);
virtual void resolve_platform_feature_priorities(const Ref<EditorExportPreset> &p_preset, RBSet<String> &p_features);
int get_chmod_flags() const;
void set_chmod_flags(int p_flags);
@ -537,7 +537,7 @@ class EditorExportTextSceneToBinaryPlugin : public EditorExportPlugin {
GDCLASS(EditorExportTextSceneToBinaryPlugin, EditorExportPlugin);
public:
virtual void _export_file(const String &p_path, const String &p_type, const Set<String> &p_features);
virtual void _export_file(const String &p_path, const String &p_type, const RBSet<String> &p_features);
EditorExportTextSceneToBinaryPlugin();
};

View File

@ -1356,7 +1356,7 @@ void EditorFileSystem::_save_late_updated_files() {
String fscache = EditorSettings::get_singleton()->get_project_settings_dir().plus_file("filesystem_update4");
FileAccessRef f = FileAccess::open(fscache, FileAccess::WRITE);
ERR_FAIL_COND_MSG(!f, "Cannot create file '" + fscache + "'. Check user write permissions.");
for (Set<String>::Element *E = late_update_files.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = late_update_files.front(); E; E = E->next()) {
f->store_line(E->get());
}
}
@ -1517,7 +1517,7 @@ void EditorFileSystem::update_file(const String &p_file) {
_queue_update_script_classes();
}
Set<String> EditorFileSystem::get_valid_extensions() const {
RBSet<String> EditorFileSystem::get_valid_extensions() const {
return valid_extensions;
}
@ -1893,7 +1893,7 @@ void EditorFileSystem::_reimport_file(const String &p_file) {
EditorResourcePreview::get_singleton()->check_for_invalidation(p_file);
}
void EditorFileSystem::_find_group_files(EditorFileSystemDirectory *efd, RBMap<String, Vector<String>> &group_files, Set<String> &groups_to_reimport) {
void EditorFileSystem::_find_group_files(EditorFileSystemDirectory *efd, RBMap<String, Vector<String>> &group_files, RBSet<String> &groups_to_reimport) {
int fc = efd->files.size();
const EditorFileSystemDirectory::FileInfo *const *files = efd->files.ptr();
for (int i = 0; i < fc; i++) {
@ -1944,7 +1944,7 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
EditorProgress pr("reimport", TTR("(Re)Importing Assets"), p_files.size());
Vector<ImportFile> files;
Set<String> groups_to_reimport;
RBSet<String> groups_to_reimport;
for (int i = 0; i < p_files.size(); i++) {
String group_file = ResourceFormatImporter::get_singleton()->get_import_group_file(p_files[i]);

View File

@ -37,7 +37,7 @@
#include "core/os/thread.h"
#include "core/os/thread_safe.h"
#include "core/os/safe_refcount.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/error/error_list.h"
#include "core/containers/hash_map.h"
#include "core/containers/list.h"
@ -163,8 +163,8 @@ class EditorFileSystem : public Node {
void _scan_filesystem();
Set<String> late_added_files; //keep track of files that were added, these will be re-scanned
Set<String> late_update_files;
RBSet<String> late_added_files; //keep track of files that were added, these will be re-scanned
RBSet<String> late_update_files;
void _save_late_updated_files();
@ -205,8 +205,8 @@ class EditorFileSystem : public Node {
void _create_project_data_dir_if_necessary();
void _delete_internal_files(String p_file);
Set<String> valid_extensions;
Set<String> import_extensions;
RBSet<String> valid_extensions;
RBSet<String> import_extensions;
void _scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess *da, const ScanProgress &p_progress);
@ -250,11 +250,11 @@ class EditorFileSystem : public Node {
bool using_fat32_or_exfat; // Workaround for projects in FAT32 or exFAT filesystem (pendrives, most of the time)
void _find_group_files(EditorFileSystemDirectory *efd, RBMap<String, Vector<String>> &group_files, Set<String> &groups_to_reimport);
void _find_group_files(EditorFileSystemDirectory *efd, RBMap<String, Vector<String>> &group_files, RBSet<String> &groups_to_reimport);
void _move_group_files(EditorFileSystemDirectory *efd, const String &p_group_file, const String &p_new_location);
Set<String> group_file_cache;
RBSet<String> group_file_cache;
protected:
void _notification(int p_what);
@ -271,7 +271,7 @@ public:
void scan_changes();
void get_changed_sources(List<String> *r_changed);
void update_file(const String &p_file);
Set<String> get_valid_extensions() const;
RBSet<String> get_valid_extensions() const;
EditorFileSystemDirectory *get_filesystem_path(const String &p_path);
String get_file_type(const String &p_file) const;

View File

@ -50,7 +50,7 @@ PoolVector<String> EditorFolding::_get_unfolds(const Object *p_object) {
if (sections.size()) {
PoolVector<String>::Write w = sections.write();
int idx = 0;
for (const Set<String>::Element *E = p_object->editor_get_section_folding().front(); E; E = E->next()) {
for (const RBSet<String>::Element *E = p_object->editor_get_section_folding().front(); E; E = E->next()) {
w[idx++] = E->get();
}
}
@ -97,7 +97,7 @@ void EditorFolding::load_resource_folding(RES p_resource, const String &p_path)
_set_unfolds(p_resource.ptr(), unfolds);
}
void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array &nodes_folded, Set<RES> &resources) {
void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array &nodes_folded, RBSet<RES> &resources) {
if (p_root != p_node) {
if (!p_node->get_owner()) {
return; //not owned, bye
@ -149,7 +149,7 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path
config.instance();
Array unfolds, res_unfolds;
Set<RES> resources;
RBSet<RES> resources;
Array nodes_folded;
_fill_folds(p_scene, p_scene, unfolds, res_unfolds, nodes_folded, resources);
@ -228,13 +228,13 @@ bool EditorFolding::has_folding_data(const String &p_path) {
return FileAccess::exists(file);
}
void EditorFolding::_do_object_unfolds(Object *p_object, Set<RES> &resources) {
void EditorFolding::_do_object_unfolds(Object *p_object, RBSet<RES> &resources) {
List<PropertyInfo> plist;
p_object->get_property_list(&plist);
String group_base;
String group;
Set<String> unfold_group;
RBSet<String> unfold_group;
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
if (E->get().usage & PROPERTY_USAGE_CATEGORY) {
@ -278,12 +278,12 @@ void EditorFolding::_do_object_unfolds(Object *p_object, Set<RES> &resources) {
}
}
for (Set<String>::Element *E = unfold_group.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = unfold_group.front(); E; E = E->next()) {
p_object->editor_set_section_unfold(E->get(), true);
}
}
void EditorFolding::_do_node_unfolds(Node *p_root, Node *p_node, Set<RES> &resources) {
void EditorFolding::_do_node_unfolds(Node *p_root, Node *p_node, RBSet<RES> &resources) {
if (p_root != p_node) {
if (!p_node->get_owner()) {
return; //not owned, bye
@ -301,7 +301,7 @@ void EditorFolding::_do_node_unfolds(Node *p_root, Node *p_node, Set<RES> &resou
}
void EditorFolding::unfold_scene(Node *p_scene) {
Set<RES> resources;
RBSet<RES> resources;
_do_node_unfolds(p_scene, p_scene, resources);
}

View File

@ -34,7 +34,7 @@
#include "core/containers/pool_vector.h"
#include "core/object/resource.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/ustring.h"
class Array;
@ -45,10 +45,10 @@ class EditorFolding {
PoolVector<String> _get_unfolds(const Object *p_object);
void _set_unfolds(Object *p_object, const PoolVector<String> &p_unfolds);
void _fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array &nodes_folded, Set<RES> &resources);
void _fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array &nodes_folded, RBSet<RES> &resources);
void _do_object_unfolds(Object *p_object, Set<RES> &resources);
void _do_node_unfolds(Node *p_root, Node *p_node, Set<RES> &resources);
void _do_object_unfolds(Object *p_object, RBSet<RES> &resources);
void _do_node_unfolds(Node *p_root, Node *p_node, RBSet<RES> &resources);
public:
void save_resource_folding(const RES &p_resource, const String &p_path);

View File

@ -50,7 +50,7 @@
#include "core/os/memory.h"
#include "core/os/os.h"
#include "core/containers/pair.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/typedefs.h"
#include "core/variant/variant.h"
#include "scene/2d/canvas_item.h"
@ -553,7 +553,7 @@ void EditorHelp::_update_doc() {
}
// Properties overview
Set<String> skip_methods;
RBSet<String> skip_methods;
bool property_descr = false;
if (cd.properties.size()) {

View File

@ -700,7 +700,7 @@ void EditorProperty::_update_pin_flags() {
}
pin_hidden = false;
{
Set<StringName> storable_properties;
RBSet<StringName> storable_properties;
node->get_storable_properties(storable_properties);
if (storable_properties.has(node->get_property_store_alias(property))) {
can_pin = true;

View File

@ -43,7 +43,7 @@
#include "core/object/object.h"
#include "core/object/object_id.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/vector.h"
#include "core/object/resource.h"
#include "core/string/string_name.h"
@ -294,7 +294,7 @@ class EditorInspector : public ScrollContainer {
//map use to cache the instanced editors
RBMap<StringName, List<EditorProperty *>> editor_property_map;
List<EditorInspectorSection *> sections;
Set<StringName> pending;
RBSet<StringName> pending;
void _clear();
Object *object;
@ -324,7 +324,7 @@ class EditorInspector : public ScrollContainer {
RBMap<StringName, RBMap<StringName, String>> descr_cache;
RBMap<StringName, String> class_descr_cache;
Set<StringName> restart_request_props;
RBSet<StringName> restart_request_props;
RBMap<ObjectID, int> scroll_cache;

View File

@ -203,12 +203,12 @@ static const String META_TEXT_TO_COPY = "text_to_copy";
void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vector<String> &r_filenames) {
// Keep track of a list of "index sets," i.e. sets of indices
// within disambiguated_scene_names which contain the same name.
Vector<Set<int>> index_sets;
Vector<RBSet<int>> index_sets;
RBMap<String, int> scene_name_to_set_index;
for (int i = 0; i < r_filenames.size(); i++) {
String scene_name = r_filenames[i];
if (!scene_name_to_set_index.has(scene_name)) {
index_sets.push_back(Set<int>());
index_sets.push_back(RBSet<int>());
scene_name_to_set_index.insert(r_filenames[i], index_sets.size() - 1);
}
index_sets.write[scene_name_to_set_index[scene_name]].insert(i);
@ -216,10 +216,10 @@ void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vecto
// For each index set with a size > 1, we need to disambiguate
for (int i = 0; i < index_sets.size(); i++) {
Set<int> iset = index_sets[i];
RBSet<int> iset = index_sets[i];
while (iset.size() > 1) {
// Append the parent folder to each scene name
for (Set<int>::Element *E = iset.front(); E; E = E->next()) {
for (RBSet<int>::Element *E = iset.front(); E; E = E->next()) {
int set_idx = E->get();
String scene_name = r_filenames[set_idx];
String full_path = p_full_paths[set_idx];
@ -254,11 +254,11 @@ void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vecto
// Loop back through scene names and remove non-ambiguous names
bool can_proceed = false;
Set<int>::Element *E = iset.front();
RBSet<int>::Element *E = iset.front();
while (E) {
String scene_name = r_filenames[E->get()];
bool duplicate_found = false;
for (Set<int>::Element *F = iset.front(); F; F = F->next()) {
for (RBSet<int>::Element *F = iset.front(); F; F = F->next()) {
if (E->get() == F->get()) {
continue;
}
@ -269,7 +269,7 @@ void EditorNode::disambiguate_filenames(const Vector<String> p_full_paths, Vecto
}
}
Set<int>::Element *to_erase = duplicate_found ? nullptr : E;
RBSet<int>::Element *to_erase = duplicate_found ? nullptr : E;
// We need to check that we could actually append anymore names
// if we wanted to for disambiguation. If we can't, then we have
@ -736,11 +736,11 @@ void EditorNode::_resources_changed(const PoolVector<String> &p_resources) {
}
void EditorNode::_fs_changed() {
for (Set<FileDialog *>::Element *E = file_dialogs.front(); E; E = E->next()) {
for (RBSet<FileDialog *>::Element *E = file_dialogs.front(); E; E = E->next()) {
E->get()->invalidate();
}
for (Set<EditorFileDialog *>::Element *E = editor_file_dialogs.front(); E; E = E->next()) {
for (RBSet<EditorFileDialog *>::Element *E = editor_file_dialogs.front(); E; E = E->next()) {
E->get()->invalidate();
}
@ -1056,7 +1056,7 @@ Error EditorNode::load_resource(const String &p_resource, bool p_ignore_broken_d
if (!p_ignore_broken_deps && dependency_errors.has(p_resource)) {
//current_option = -1;
Vector<String> errors;
for (Set<String>::Element *E = dependency_errors[p_resource].front(); E; E = E->next()) {
for (RBSet<String>::Element *E = dependency_errors[p_resource].front(); E; E = E->next()) {
errors.push_back(E->get());
}
dependency_error->show(DependencyErrorDialog::MODE_RESOURCE, p_resource, errors);
@ -1503,7 +1503,7 @@ int EditorNode::_save_external_resources() {
}
flg |= ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS;
Set<String> edited_resources;
RBSet<String> edited_resources;
int saved = 0;
List<Ref<Resource>> cached;
ResourceCache::get_cached_resources(&cached);
@ -1527,7 +1527,7 @@ int EditorNode::_save_external_resources() {
res->set_edited(false);
}
for (Set<String>::Element *E = edited_resources.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = edited_resources.front(); E; E = E->next()) {
Ref<Resource> res = Ref<Resource>(ResourceCache::get(E->get()));
if (!res.is_valid()) {
continue; // Maybe it was erased in a thread, who knows.
@ -3599,7 +3599,7 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
if (!p_ignore_broken_deps && dependency_errors.has(lpath)) {
current_option = -1;
Vector<String> errors;
for (Set<String>::Element *E = dependency_errors[lpath].front(); E; E = E->next()) {
for (RBSet<String>::Element *E = dependency_errors[lpath].front(); E; E = E->next()) {
errors.push_back(E->get());
}
dependency_error->show(DependencyErrorDialog::MODE_SCENE, lpath, errors);
@ -3614,9 +3614,9 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
dependency_errors.erase(lpath); //at least not self path
for (RBMap<String, Set<String>>::Element *E = dependency_errors.front(); E; E = E->next()) {
for (RBMap<String, RBSet<String>>::Element *E = dependency_errors.front(); E; E = E->next()) {
String txt = vformat(TTR("Scene '%s' has broken dependencies:"), E->key()) + "\n";
for (Set<String>::Element *F = E->get().front(); F; F = F->next()) {
for (RBSet<String>::Element *F = E->get().front(); F; F = F->next()) {
txt += "\t" + F->get() + "\n";
}
add_io_error(txt);

View File

@ -43,7 +43,7 @@
#include "core/containers/list.h"
#include "core/containers/rb_map.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/vector.h"
#include "core/error/error_list.h"
#include "core/math/rect2.h"
@ -819,8 +819,8 @@ private:
String import_reload_fn;
Set<FileDialog *> file_dialogs;
Set<EditorFileDialog *> editor_file_dialogs;
RBSet<FileDialog *> file_dialogs;
RBSet<EditorFileDialog *> editor_file_dialogs;
RBMap<String, Ref<Texture>> icon_type_cache;
RBMap<Ref<Script>, Ref<Texture>> script_icon_cache;
@ -845,12 +845,12 @@ private:
void _find_node_types(Node *p_node, int &count_2d, int &count_3d);
void _save_scene_with_preview(String p_file, int p_idx = -1);
RBMap<String, Set<String>> dependency_errors;
RBMap<String, RBSet<String>> dependency_errors;
static void _dependency_error_report(void *ud, const String &p_path, const String &p_dep, const String &p_type) {
EditorNode *en = (EditorNode *)ud;
if (!en->dependency_errors.has(p_path)) {
en->dependency_errors[p_path] = Set<String>();
en->dependency_errors[p_path] = RBSet<String>();
}
en->dependency_errors[p_path].insert(p_dep + "::" + p_type);
}

View File

@ -210,7 +210,7 @@ void EditorProfiler::_update_plot() {
continue;
}
for (Set<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
for (RBSet<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
const RBMap<StringName, Metric::Category *>::Element *F = m.category_ptrs.find(E->get());
if (F) {
highest = MAX(F->get()->total_time, highest);
@ -254,7 +254,7 @@ void EditorProfiler::_update_plot() {
next = current + 1; //just because for loop must work
}
for (Set<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
for (RBSet<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
int plot_pos = -1;
for (int j = current; j < next; j++) {
@ -631,7 +631,7 @@ Vector<Vector<String>> EditorProfiler::get_data_as_csv() const {
}
// Different metrics may contain different number of categories.
Set<StringName> possible_signatures;
RBSet<StringName> possible_signatures;
for (int i = 0; i < frame_metrics.size(); i++) {
const Metric &m = frame_metrics[i];
if (!m.valid) {
@ -650,7 +650,7 @@ Vector<Vector<String>> EditorProfiler::get_data_as_csv() const {
Vector<String> signatures;
signatures.resize(possible_signatures.size());
int sig_index = 0;
for (const Set<StringName>::Element *E = possible_signatures.front(); E; E = E->next()) {
for (const RBSet<StringName>::Element *E = possible_signatures.front(); E; E = E->next()) {
signatures.write[sig_index] = E->get();
sig_map[E->get()] = sig_index;
sig_index++;

View File

@ -37,7 +37,7 @@
#include "core/object/object.h"
#include "core/containers/pool_vector.h"
#include "core/object/reference.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"
#include "core/string/ustring.h"
@ -117,7 +117,7 @@ private:
Tree *variables;
HSplitContainer *h_split;
Set<StringName> plot_sigs;
RBSet<StringName> plot_sigs;
OptionButton *display_mode;
OptionButton *display_time;

View File

@ -268,7 +268,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
ResourceLoader::get_recognized_extensions_for_type(base, &extensions);
}
Set<String> valid_extensions;
RBSet<String> valid_extensions;
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
valid_extensions.insert(E->get());
}
@ -281,7 +281,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
}
file_dialog->clear_filters();
for (Set<String>::Element *E = valid_extensions.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = valid_extensions.front(); E; E = E->next()) {
file_dialog->add_filter("*." + E->get() + " ; " + E->get().to_upper());
}
@ -430,7 +430,7 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) {
if (base_type != "") {
int idx = 0;
Set<String> allowed_types;
RBSet<String> allowed_types;
_get_allowed_types(false, &allowed_types);
Vector<EditorData::CustomType> custom_resources;
@ -438,7 +438,7 @@ void EditorResourcePicker::set_create_options(Object *p_menu_node) {
custom_resources = EditorNode::get_editor_data().get_custom_types()["Resource"];
}
for (Set<String>::Element *E = allowed_types.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = allowed_types.front(); E; E = E->next()) {
const String &t = E->get();
bool is_custom_resource = false;
@ -511,7 +511,7 @@ void EditorResourcePicker::_button_input(const Ref<InputEvent> &p_event) {
}
}
void EditorResourcePicker::_get_allowed_types(bool p_with_convert, Set<String> *p_vector) const {
void EditorResourcePicker::_get_allowed_types(bool p_with_convert, RBSet<String> *p_vector) const {
Vector<String> allowed_types = base_type.split(",");
int size = allowed_types.size();
@ -586,7 +586,7 @@ bool EditorResourcePicker::_is_drop_valid(const Dictionary &p_drag_data) const {
res = drag_data["resource"];
}
Set<String> allowed_types;
RBSet<String> allowed_types;
_get_allowed_types(true, &allowed_types);
if (res.is_valid() && _is_type_valid(res->get_class(), allowed_types)) {
@ -617,8 +617,8 @@ bool EditorResourcePicker::_is_drop_valid(const Dictionary &p_drag_data) const {
return false;
}
bool EditorResourcePicker::_is_type_valid(const String p_type_name, Set<String> p_allowed_types) const {
for (Set<String>::Element *E = p_allowed_types.front(); E; E = E->next()) {
bool EditorResourcePicker::_is_type_valid(const String p_type_name, RBSet<String> p_allowed_types) const {
for (RBSet<String>::Element *E = p_allowed_types.front(); E; E = E->next()) {
String at = E->get().strip_edges();
if (p_type_name == at || (ClassDB::class_exists(p_type_name) && ClassDB::is_parent_class(p_type_name, at)) || EditorNode::get_editor_data().script_class_is_parent(p_type_name, at)) {
return true;
@ -665,12 +665,12 @@ void EditorResourcePicker::drop_data_fw(const Point2 &p_point, const Variant &p_
}
if (dropped_resource.is_valid()) {
Set<String> allowed_types;
RBSet<String> allowed_types;
_get_allowed_types(false, &allowed_types);
// If the accepted dropped resource is from the extended list, it requires conversion.
if (!_is_type_valid(dropped_resource->get_class(), allowed_types)) {
for (Set<String>::Element *E = allowed_types.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = allowed_types.front(); E; E = E->next()) {
String at = E->get().strip_edges();
if (at == "SpatialMaterial" && ClassDB::is_parent_class(dropped_resource->get_class(), "Texture")) {
@ -787,7 +787,7 @@ void EditorResourcePicker::set_base_type(const String &p_base_type) {
// There is a possibility that the new base type is conflicting with the existing value.
// Keep the value, but warn the user that there is a potential mistake.
if (!base_type.empty() && edited_resource.is_valid()) {
Set<String> allowed_types;
RBSet<String> allowed_types;
_get_allowed_types(true, &allowed_types);
StringName custom_class;
@ -804,7 +804,7 @@ void EditorResourcePicker::set_base_type(const String &p_base_type) {
}
} else {
// Call the method to build the cache immediately.
Set<String> allowed_types;
RBSet<String> allowed_types;
_get_allowed_types(false, &allowed_types);
}
}
@ -814,7 +814,7 @@ String EditorResourcePicker::get_base_type() const {
}
Vector<String> EditorResourcePicker::get_allowed_types() const {
Set<String> allowed_types;
RBSet<String> allowed_types;
_get_allowed_types(false, &allowed_types);
Vector<String> types;
@ -822,7 +822,7 @@ Vector<String> EditorResourcePicker::get_allowed_types() const {
int i = 0;
String *w = types.ptrw();
for (Set<String>::Element *E = allowed_types.front(); E; E = E->next(), i++) {
for (RBSet<String>::Element *E = allowed_types.front(); E; E = E->next(), i++) {
w[i] = E->get();
}
@ -837,7 +837,7 @@ void EditorResourcePicker::set_edited_resource(RES p_resource) {
}
if (!base_type.empty()) {
Set<String> allowed_types;
RBSet<String> allowed_types;
_get_allowed_types(true, &allowed_types);
StringName custom_class;

View File

@ -39,7 +39,7 @@
#include "core/object/object_id.h"
#include "core/object/reference.h"
#include "core/object/resource.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
#include "core/containers/vector.h"
@ -106,9 +106,9 @@ class EditorResourcePicker : public HBoxContainer {
void _button_draw();
void _button_input(const Ref<InputEvent> &p_event);
void _get_allowed_types(bool p_with_convert, Set<String> *p_vector) const;
void _get_allowed_types(bool p_with_convert, RBSet<String> *p_vector) const;
bool _is_drop_valid(const Dictionary &p_drag_data) const;
bool _is_type_valid(const String p_type_name, Set<String> p_allowed_types) const;
bool _is_type_valid(const String p_type_name, RBSet<String> p_allowed_types) const;
Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;

View File

@ -53,7 +53,7 @@
#include "core/os/os.h"
#include "core/string/print_string.h"
#include "core/config/project_settings.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/translation.h"
#include "core/typedefs.h"
#include "core/version_generated.gen.h"
@ -181,7 +181,7 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const {
_THREAD_SAFE_METHOD_
const String *k = nullptr;
Set<_EVCSort> vclist;
RBSet<_EVCSort> vclist;
while ((k = props.next(k))) {
const VariantContainer *v = props.getptr(*k);
@ -205,7 +205,7 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const {
vclist.insert(vc);
}
for (Set<_EVCSort>::Element *E = vclist.front(); E; E = E->next()) {
for (RBSet<_EVCSort>::Element *E = vclist.front(); E; E = E->next()) {
int pinfo = 0;
if (E->get().save || !optimize_save) {
pinfo |= PROPERTY_USAGE_STORAGE;

View File

@ -46,7 +46,7 @@
#include "core/math/math_funcs.h"
#include "core/math/vector2.h"
#include "core/os/memory.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"
#include "core/string/ustring.h"
@ -159,7 +159,7 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme =
// The names of the icons to never convert, even if one of their colors
// are contained in the dictionary above.
Set<StringName> exceptions;
RBSet<StringName> exceptions;
if (!p_dark_theme) {
// convert color: FROM TO

View File

@ -43,7 +43,7 @@
#include "core/os/memory.h"
#include "core/os/os.h"
#include "core/containers/pool_vector.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/vector.h"
#include "core/version.h"
#include "core/version_generated.gen.h"
@ -77,7 +77,7 @@ void ExportTemplateManager::_update_template_status() {
Error err = da->change_dir(templates_dir);
ERR_FAIL_COND_MSG(err != OK, "Could not access templates directory at '" + templates_dir + "'.");
Set<String> templates;
RBSet<String> templates;
da->list_dir_begin();
if (err == OK) {
String c = da->get_next();
@ -119,7 +119,7 @@ void ExportTemplateManager::_update_template_status() {
installed_table->clear();
TreeItem *installed_root = installed_table->create_item();
for (Set<String>::Element *E = templates.back(); E; E = E->prev()) {
for (RBSet<String>::Element *E = templates.back(); E; E = E->prev()) {
String version_string = E->get();
if (version_string == current_version) {
continue;
@ -418,7 +418,7 @@ Error ExportTemplateManager::install_android_template_from_file(const String &p_
ProgressDialog::get_singleton()->add_task("uncompress_src", TTR("Uncompressing Android Build Sources"), total_files);
Set<String> dirs_tested;
RBSet<String> dirs_tested;
int idx = 0;
while (ret == UNZ_OK) {
// Get file path.

View File

@ -54,7 +54,7 @@ class EditorFileServer : public Object {
};
Ref<TCP_Server> server;
Set<Thread *> to_wait;
RBSet<Thread *> to_wait;
static void _close_client(ClientData *cd);
static void _subthread_start(void *s);

View File

@ -699,7 +699,7 @@ void FileSystemDock::_sort_file_info_list(List<FileSystemDock::FileInfo> &r_file
void FileSystemDock::_update_file_list(bool p_keep_selection) {
// Register the previously selected items.
Set<String> cselection;
RBSet<String> cselection;
if (p_keep_selection) {
for (int i = 0; i < files->get_item_count(); i++) {
if (files->is_selected(i)) {

View File

@ -36,7 +36,7 @@
#include "core/containers/list.h"
#include "core/containers/rb_map.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/vector.h"
#include "core/math/vector2.h"
#include "core/object/object.h"
@ -128,7 +128,7 @@ private:
VBoxContainer *file_list_vb;
EditorNode *editor;
Set<String> favorites;
RBSet<String> favorites;
Button *button_toggle_display_mode;
Button *button_reload;

View File

@ -125,7 +125,7 @@ void FindInFiles::set_folder(String folder) {
_root_dir = folder;
}
void FindInFiles::set_filter(const Set<String> &exts) {
void FindInFiles::set_filter(const RBSet<String> &exts) {
_extension_filter = exts;
}
@ -468,9 +468,9 @@ String FindInFilesDialog::get_folder() const {
return text.strip_edges();
}
Set<String> FindInFilesDialog::get_filter() const {
RBSet<String> FindInFilesDialog::get_filter() const {
// could check the _filters_preferences but it might not have been generated yet.
Set<String> filters;
RBSet<String> filters;
for (int i = 0; i < _filters_container->get_child_count(); ++i) {
CheckBox *cb = (CheckBox *)_filters_container->get_child(i);
if (cb->is_pressed()) {

View File

@ -37,7 +37,7 @@
#include "core/containers/hash_map.h"
#include "core/containers/rb_map.h"
#include "core/object/object.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
#include "core/containers/vector.h"
@ -60,7 +60,7 @@ public:
void set_whole_words(bool p_whole_word);
void set_match_case(bool p_match_case);
void set_folder(String folder);
void set_filter(const Set<String> &exts);
void set_filter(const RBSet<String> &exts);
String get_search_text() const { return _pattern; }
@ -86,7 +86,7 @@ private:
// Config
String _pattern;
Set<String> _extension_filter;
RBSet<String> _extension_filter;
String _root_dir;
bool _whole_words;
bool _match_case;
@ -129,7 +129,7 @@ public:
bool is_match_case() const;
bool is_whole_words() const;
String get_folder() const;
Set<String> get_filter() const;
RBSet<String> get_filter() const;
protected:
static void _bind_methods();

View File

@ -161,7 +161,7 @@ String ResourceImporterScene::get_visible_name() const {
}
void ResourceImporterScene::get_recognized_extensions(List<String> *p_extensions) const {
for (Set<Ref<EditorSceneImporter>>::Element *E = importers.front(); E; E = E->next()) {
for (RBSet<Ref<EditorSceneImporter>>::Element *E = importers.front(); E; E = E->next()) {
E->get()->get_extensions(p_extensions);
}
}
@ -770,7 +770,7 @@ void ResourceImporterScene::_create_clips(Node *scene, const Array &p_clips, boo
anim->remove_animation("default"); //remove default (no longer needed)
}
void ResourceImporterScene::_filter_anim_tracks(Ref<Animation> anim, Set<String> &keep) {
void ResourceImporterScene::_filter_anim_tracks(Ref<Animation> anim, RBSet<String> &keep) {
Ref<Animation> a = anim;
ERR_FAIL_COND(!a.is_valid());
@ -805,13 +805,13 @@ void ResourceImporterScene::_filter_tracks(Node *scene, const String &p_text) {
bool valid_for_this = false;
bool valid = false;
Set<String> keep;
Set<String> keep_local;
RBSet<String> keep;
RBSet<String> keep_local;
for (int i = 0; i < strings.size(); i++) {
if (strings[i].begins_with("@")) {
valid_for_this = false;
for (Set<String>::Element *F = keep_local.front(); F; F = F->next()) {
for (RBSet<String>::Element *F = keep_local.front(); F; F = F->next()) {
keep.insert(F->get());
}
keep_local.clear();
@ -883,7 +883,7 @@ void ResourceImporterScene::_filter_tracks(Node *scene, const String &p_text) {
}
if (valid) {
for (Set<String>::Element *F = keep_local.front(); F; F = F->next()) {
for (RBSet<String>::Element *F = keep_local.front(); F; F = F->next()) {
keep.insert(F->get());
}
_filter_anim_tracks(anim->get_animation(name), keep);
@ -1195,7 +1195,7 @@ Node *ResourceImporterScene::import_scene_from_other_importer(EditorSceneImporte
Ref<EditorSceneImporter> importer;
String ext = p_path.get_extension().to_lower();
for (Set<Ref<EditorSceneImporter>>::Element *E = importers.front(); E; E = E->next()) {
for (RBSet<Ref<EditorSceneImporter>>::Element *E = importers.front(); E; E = E->next()) {
if (E->get().ptr() == p_exception) {
continue;
}
@ -1225,7 +1225,7 @@ Ref<Animation> ResourceImporterScene::import_animation_from_other_importer(Edito
Ref<EditorSceneImporter> importer;
String ext = p_path.get_extension().to_lower();
for (Set<Ref<EditorSceneImporter>>::Element *E = importers.front(); E; E = E->next()) {
for (RBSet<Ref<EditorSceneImporter>>::Element *E = importers.front(); E; E = E->next()) {
if (E->get().ptr() == p_exception) {
continue;
}
@ -1258,7 +1258,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
EditorProgress progress("import", TTR("Import Scene"), 104);
progress.step(TTR("Importing Scene..."), 0);
for (Set<Ref<EditorSceneImporter>>::Element *E = importers.front(); E; E = E->next()) {
for (RBSet<Ref<EditorSceneImporter>>::Element *E = importers.front(); E; E = E->next()) {
List<String> extensions;
E->get()->get_extensions(&extensions);

View File

@ -102,7 +102,7 @@ public:
class ResourceImporterScene : public ResourceImporter {
GDCLASS(ResourceImporterScene, ResourceImporter);
Set<Ref<EditorSceneImporter>> importers;
RBSet<Ref<EditorSceneImporter>> importers;
static ResourceImporterScene *singleton;
@ -129,7 +129,7 @@ class ResourceImporterScene : public ResourceImporter {
public:
static ResourceImporterScene *get_singleton() { return singleton; }
const Set<Ref<EditorSceneImporter>> &get_importers() const { return importers; }
const RBSet<Ref<EditorSceneImporter>> &get_importers() const { return importers; }
void add_importer(Ref<EditorSceneImporter> p_importer) { importers.insert(p_importer); }
void remove_importer(Ref<EditorSceneImporter> p_importer) { importers.erase(p_importer); }
@ -155,7 +155,7 @@ public:
Node *_fix_node(Node *p_node, Node *p_root, RBMap<Ref<Mesh>, List<Ref<Shape>>> &collision_map, List<Pair<NodePath, Node *>> &r_node_renames);
void _create_clips(Node *scene, const Array &p_clips, bool p_bake_all);
void _filter_anim_tracks(Ref<Animation> anim, Set<String> &keep);
void _filter_anim_tracks(Ref<Animation> anim, RBSet<String> &keep);
void _filter_tracks(Node *scene, const String &p_text);
void _optimize_animations(Node *scene, float p_max_lin_error, float p_max_ang_error, float p_max_angle);

View File

@ -42,7 +42,7 @@
#include "core/math/vector2.h"
#include "core/os/memory.h"
#include "core/containers/pair.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/typedefs.h"
#include "core/containers/vector.h"
#include "editor/editor_file_system.h"
@ -65,7 +65,7 @@ public:
List<PropertyInfo> properties;
Ref<ResourceImporter> importer;
Vector<String> paths;
Set<StringName> checked;
RBSet<StringName> checked;
bool checking;
bool _set(const StringName &p_name, const Variant &p_value) {

View File

@ -38,7 +38,7 @@
#include "core/object/method_bind.h"
#include "core/object/object_id.h"
#include "core/os/memory.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"
#include "core/object/undo_redo.h"
@ -254,7 +254,7 @@ void InspectorDock::_prepare_history() {
history_menu->get_popup()->clear();
Ref<Texture> base_icon = get_theme_icon("Object", "EditorIcons");
Set<ObjectID> already;
RBSet<ObjectID> already;
for (int i = editor_history->get_history_len() - 1; i >= history_to; i--) {
ObjectID id = editor_history->get_history_obj(i);
Object *obj = ObjectDB::get_instance(id);

View File

@ -32,7 +32,7 @@
#include "core/containers/hash_map.h"
#include "core/containers/list.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/error/error_macros.h"
#include "core/io/resource_loader.h"
#include "core/math/color.h"
@ -593,8 +593,8 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
updating = true;
Set<String> paths;
HashMap<String, Set<String>> types;
RBSet<String> paths;
HashMap<String, RBSet<String>> types;
{
List<StringName> animations;
player->get_animation_list(&animations);
@ -633,7 +633,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
RBMap<String, TreeItem *> parenthood;
for (Set<String>::Element *E = paths.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = paths.front(); E; E = E->next()) {
NodePath path = E->get();
TreeItem *ti = nullptr;
String accum;
@ -730,7 +730,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
//just a node, not a property track
String types_text = "[";
if (types.has(path)) {
Set<String>::Element *F = types[path].front();
RBSet<String>::Element *F = types[path].front();
types_text += F->get();
while (F->next()) {
F = F->next();

View File

@ -59,7 +59,7 @@
#include "core/containers/pool_vector.h"
#include "core/containers/rid_handle.h"
#include "core/object/script_language.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/typedefs.h"
#include "core/containers/vector.h"
#include "scene/resources/font.h"
@ -517,8 +517,8 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size2
List<String> kwors;
scr->get_language()->get_reserved_words(&kwors);
Set<String> control_flow_keywords;
Set<String> keywords;
RBSet<String> control_flow_keywords;
RBSet<String> keywords;
for (List<String>::Element *E = kwors.front(); E; E = E->next()) {
if (scr->get_language()->is_control_flow_keyword(E->get())) {

View File

@ -47,7 +47,7 @@
#include "core/os/memory.h"
#include "core/containers/pool_vector.h"
#include "core/object/reference.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/object/undo_redo.h"
#include "core/variant/variant.h"
#include "editor/editor_data.h"
@ -332,7 +332,7 @@ void MeshInstanceEditor::_create_uv_lines(int p_layer) {
Ref<Mesh> mesh = node->get_mesh();
ERR_FAIL_COND(!mesh.is_valid());
Set<MeshInstanceEditorEdgeSort> edges;
RBSet<MeshInstanceEditorEdgeSort> edges;
uv_lines.clear();
for (int i = 0; i < mesh->get_surface_count(); i++) {
if (mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) {

View File

@ -32,7 +32,7 @@
#include "core/containers/list.h"
#include "core/containers/rb_map.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/error/error_macros.h"
#include "core/object/class_db.h"
#include "core/object/reference.h"
@ -92,7 +92,7 @@ void EditorPropertyRootMotion::_node_assign() {
return;
}
Set<String> paths;
RBSet<String> paths;
{
List<StringName> animations;
player->get_animation_list(&animations);
@ -110,7 +110,7 @@ void EditorPropertyRootMotion::_node_assign() {
RBMap<String, TreeItem *> parenthood;
for (Set<String>::Element *E = paths.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = paths.front(); E; E = E->next()) {
NodePath path = E->get();
TreeItem *ti = nullptr;
String accum;

View File

@ -1642,7 +1642,7 @@ void ScriptEditor::ensure_select_current() {
_update_selected_editor_menu();
}
void ScriptEditor::_find_scripts(Node *p_base, Node *p_current, Set<Ref<Script>> &used) {
void ScriptEditor::_find_scripts(Node *p_base, Node *p_current, RBSet<Ref<Script>> &used) {
if (p_current != p_base && p_current->get_owner() != p_base) {
return;
}
@ -1825,7 +1825,7 @@ void ScriptEditor::_update_script_names() {
return;
}
Set<Ref<Script>> used;
RBSet<Ref<Script>> used;
Node *edited = EditorNode::get_singleton()->get_edited_scene();
if (edited) {
_find_scripts(edited, edited, used);

View File

@ -45,7 +45,7 @@
#include "core/object/object.h"
#include "core/object/reference.h"
#include "core/object/resource.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/typedefs.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
@ -386,7 +386,7 @@ class ScriptEditor : public PanelContainer {
void _update_help_overview();
void _help_overview_selected(int p_idx);
void _find_scripts(Node *p_base, Node *p_current, Set<Ref<Script>> &used);
void _find_scripts(Node *p_base, Node *p_current, RBSet<Ref<Script>> &used);
void _tree_changed();

View File

@ -47,7 +47,7 @@
#include "core/os/memory.h"
#include "core/config/project_settings.h"
#include "core/object/script_language.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"
#include "editor/editor_node.h"
@ -593,7 +593,7 @@ void ScriptTextEditor::_validate_script() {
String text = te->get_text();
List<String> fnc;
Set<int> safe_lines;
RBSet<int> safe_lines;
List<ScriptLanguage::Warning> warnings;
if (!script->get_language()->validate(text, line, col, errortxt, script->get_path(), &fnc, &warnings, &safe_lines)) {
@ -780,7 +780,7 @@ static Node *_find_node_for_script(Node *p_base, Node *p_current, const Ref<Scri
return nullptr;
}
static void _find_changed_scripts_for_external_editor(Node *p_base, Node *p_current, Set<Ref<Script>> &r_scripts) {
static void _find_changed_scripts_for_external_editor(Node *p_base, Node *p_current, RBSet<Ref<Script>> &r_scripts) {
if (p_current->get_owner() != p_base && p_base != p_current) {
return;
}
@ -802,14 +802,14 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo
ERR_FAIL_COND(!get_tree());
Set<Ref<Script>> scripts;
RBSet<Ref<Script>> scripts;
Node *base = get_tree()->get_edited_scene_root();
if (base) {
_find_changed_scripts_for_external_editor(base, base, scripts);
}
for (Set<Ref<Script>>::Element *E = scripts.front(); E; E = E->next()) {
for (RBSet<Ref<Script>>::Element *E = scripts.front(); E; E = E->next()) {
Ref<Script> script = E->get();
if (p_for_script.is_valid() && p_for_script != script) {
@ -1040,7 +1040,7 @@ void ScriptTextEditor::_update_connected_methods() {
}
Vector<Node *> nodes = _find_all_node_for_script(base, base, script);
Set<StringName> methods_found;
RBSet<StringName> methods_found;
for (int i = 0; i < nodes.size(); i++) {
List<Connection> connections;
nodes[i]->get_signals_connected_to_this(&connections);

View File

@ -35,7 +35,7 @@
#include "core/containers/rb_map.h"
#include "core/containers/pool_vector.h"
#include "core/containers/rid_handle.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/input/input.h"
#include "core/input/input_event.h"
#include "core/input/shortcut.h"
@ -572,7 +572,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos) {
Vector2 shrinked_pos = p_pos / viewport_container->get_stretch_shrink();
Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world_3d()->get_scenario());
Set<Ref<EditorSpatialGizmo>> found_gizmos;
RBSet<Ref<EditorSpatialGizmo>> found_gizmos;
Node *edited_scene = get_tree()->get_edited_scene_root();
ObjectID closest;
@ -635,7 +635,7 @@ void SpatialEditorViewport::_find_items_at_pos(const Point2 &p_pos, Vector<_RayR
Vector3 pos = _get_ray_pos(p_pos);
Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world_3d()->get_scenario());
Set<Spatial *> found_nodes;
RBSet<Spatial *> found_nodes;
for (int i = 0; i < instances.size(); i++) {
Spatial *spat = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i]));
@ -816,7 +816,7 @@ void SpatialEditorViewport::_select_region() {
}
Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world_3d()->get_scenario());
Set<Spatial *> found_nodes;
RBSet<Spatial *> found_nodes;
Vector<Node *> selected;
Node *edited_scene = get_tree()->get_edited_scene_root();
@ -4013,7 +4013,7 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const
Vector3 world_pos = _get_ray_pos(p_pos);
Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world_3d()->get_scenario());
Set<Ref<EditorSpatialGizmo>> found_gizmos;
RBSet<Ref<EditorSpatialGizmo>> found_gizmos;
float closest_dist = MAX_DISTANCE;
@ -6552,8 +6552,8 @@ void SpatialEditor::_refresh_menu_icons() {
}
template <typename T>
Set<T *> _get_child_nodes(Node *parent_node) {
Set<T *> nodes = Set<T *>();
RBSet<T *> _get_child_nodes(Node *parent_node) {
RBSet<T *> nodes = RBSet<T *>();
T *node = Node::cast_to<T>(parent_node);
if (node) {
nodes.insert(node);
@ -6561,8 +6561,8 @@ Set<T *> _get_child_nodes(Node *parent_node) {
for (int i = 0; i < parent_node->get_child_count(); i++) {
Node *child_node = parent_node->get_child(i);
Set<T *> child_nodes = _get_child_nodes<T>(child_node);
for (typename Set<T *>::Element *I = child_nodes.front(); I; I = I->next()) {
RBSet<T *> child_nodes = _get_child_nodes<T>(child_node);
for (typename RBSet<T *>::Element *I = child_nodes.front(); I; I = I->next()) {
nodes.insert(I->get());
}
}
@ -6570,14 +6570,14 @@ Set<T *> _get_child_nodes(Node *parent_node) {
return nodes;
}
Set<RID> _get_physics_bodies_rid(Node *node) {
Set<RID> rids = Set<RID>();
RBSet<RID> _get_physics_bodies_rid(Node *node) {
RBSet<RID> rids = RBSet<RID>();
PhysicsBody *pb = Node::cast_to<PhysicsBody>(node);
if (pb) {
rids.insert(pb->get_rid());
}
Set<PhysicsBody *> child_nodes = _get_child_nodes<PhysicsBody>(node);
for (Set<PhysicsBody *>::Element *I = child_nodes.front(); I; I = I->next()) {
RBSet<PhysicsBody *> child_nodes = _get_child_nodes<PhysicsBody>(node);
for (RBSet<PhysicsBody *>::Element *I = child_nodes.front(); I; I = I->next()) {
rids.insert(I->get()->get_rid());
}
@ -6595,13 +6595,13 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
Vector3 position_offset = Vector3();
// Priorities for snapping to floor are CollisionShapes, VisualInstances and then origin
Set<VisualInstance *> vi = _get_child_nodes<VisualInstance>(sp);
Set<CollisionShape *> cs = _get_child_nodes<CollisionShape>(sp);
RBSet<VisualInstance *> vi = _get_child_nodes<VisualInstance>(sp);
RBSet<CollisionShape *> cs = _get_child_nodes<CollisionShape>(sp);
bool found_valid_shape = false;
if (cs.size()) {
AABB aabb;
Set<CollisionShape *>::Element *I = cs.front();
RBSet<CollisionShape *>::Element *I = cs.front();
if (I->get()->get_shape().is_valid()) {
CollisionShape *collision_shape = cs.front()->get();
aabb = collision_shape->get_global_transform().xform(collision_shape->get_shape()->get_debug_mesh()->get_aabb());
@ -6622,7 +6622,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
}
if (!found_valid_shape && vi.size()) {
AABB aabb = vi.front()->get()->get_transformed_aabb();
for (Set<VisualInstance *>::Element *I = vi.front(); I; I = I->next()) {
for (RBSet<VisualInstance *>::Element *I = vi.front(); I; I = I->next()) {
aabb.merge_with(I->get()->get_transformed_aabb());
}
Vector3 size = aabb.size * Vector3(0.5, 0.0, 0.5);
@ -6665,7 +6665,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
Dictionary d = snap_data[node];
Vector3 from = d["from"];
Vector3 to = from - Vector3(0.0, max_snap_height, 0.0);
Set<RID> excluded = _get_physics_bodies_rid(sp);
RBSet<RID> excluded = _get_physics_bodies_rid(sp);
if (ss->intersect_ray(from, to, result, excluded)) {
snapped_to_floor = true;
@ -6682,7 +6682,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
Dictionary d = snap_data[node];
Vector3 from = d["from"];
Vector3 to = from - Vector3(0.0, max_snap_height, 0.0);
Set<RID> excluded = _get_physics_bodies_rid(sp);
RBSet<RID> excluded = _get_physics_bodies_rid(sp);
if (ss->intersect_ray(from, to, result, excluded)) {
Vector3 position_offset = d["position_offset"];

View File

@ -165,7 +165,7 @@ void SpriteFramesEditor::_sheet_preview_draw() {
Color accent = get_theme_color("accent_color", "Editor");
for (Set<int>::Element *E = frames_selected.front(); E; E = E->next()) {
for (RBSet<int>::Element *E = frames_selected.front(); E; E = E->next()) {
const int idx = E->get();
const int x = idx % frame_count.x;
const int y = idx / frame_count.x;
@ -280,7 +280,7 @@ void SpriteFramesEditor::_sheet_add_frames() {
int fc = frames->get_frame_count(edited_anim);
for (Set<int>::Element *E = frames_selected.front(); E; E = E->next()) {
for (RBSet<int>::Element *E = frames_selected.front(); E; E = E->next()) {
int idx = E->get();
const Point2 frame_coords(idx % frame_count.x, idx / frame_count.x);

View File

@ -37,7 +37,7 @@
#include "core/object/object.h"
#include "core/containers/pool_vector.h"
#include "core/object/reference.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
@ -119,8 +119,8 @@ class SpriteFramesEditor : public HSplitContainer {
ToolButton *split_sheet_zoom_reset;
ToolButton *split_sheet_zoom_in;
EditorFileDialog *file_split_sheet;
Set<int> frames_selected;
Set<int> frames_toggled_by_mouse_hover;
RBSet<int> frames_selected;
RBSet<int> frames_toggled_by_mouse_hover;
int last_frame_selected;
float scale_ratio;

View File

@ -32,7 +32,7 @@
#include "core/config/project_settings.h"
#include "core/containers/list.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/vector.h"
#include "core/error/error_list.h"
#include "core/error/error_macros.h"
@ -337,7 +337,7 @@ void ProjectExportDialog::_update_feature_list() {
Ref<EditorExportPreset> current = get_current_preset();
ERR_FAIL_COND(current.is_null());
Set<String> fset;
RBSet<String> fset;
List<String> features;
current->get_platform()->get_platform_features(&features);
@ -357,7 +357,7 @@ void ProjectExportDialog::_update_feature_list() {
}
custom_feature_display->clear();
for (Set<String>::Element *E = fset.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = fset.front(); E; E = E->next()) {
String f = E->get();
if (E->next()) {
f += ", ";

View File

@ -33,7 +33,7 @@
#include "core/config/engine.h"
#include "core/config/project_settings.h"
#include "core/containers/pool_vector.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/sort_array.h"
#include "core/containers/vector.h"
#include "core/error/error_list.h"
@ -1050,7 +1050,7 @@ public:
void select_project(int p_index);
void erase_selected_projects(bool p_delete_project_contents);
Vector<Item> get_selected_projects() const;
const Set<String> &get_selected_project_keys() const;
const RBSet<String> &get_selected_project_keys() const;
void ensure_project_visible(int p_index);
int get_single_selected_index() const;
bool is_any_project_missing() const;
@ -1077,7 +1077,7 @@ private:
String _search_term;
ProjectListFilter::FilterOption _order_option;
Set<String> _selected_project_keys;
RBSet<String> _selected_project_keys;
String _last_clicked; // Project key
VBoxContainer *_scroll_children;
int _icon_load_index;
@ -1237,7 +1237,7 @@ void ProjectList::load_projects() {
List<PropertyInfo> properties;
EditorSettings::get_singleton()->get_property_list(&properties);
Set<String> favorites;
RBSet<String> favorites;
// Find favourites...
for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
String property_key = E->get().name;
@ -1438,7 +1438,7 @@ void ProjectList::sort_projects() {
update_dock_menu();
}
const Set<String> &ProjectList::get_selected_project_keys() const {
const RBSet<String> &ProjectList::get_selected_project_keys() const {
// Faster if that's all you need
return _selected_project_keys;
}
@ -2000,9 +2000,9 @@ void ProjectManager::_open_selected_projects() {
// This is especially important for the HTML5 project manager.
loading_label->show();
const Set<String> &selected_list = _project_list->get_selected_project_keys();
const RBSet<String> &selected_list = _project_list->get_selected_project_keys();
for (const Set<String>::Element *E = selected_list.front(); E; E = E->next()) {
for (const RBSet<String>::Element *E = selected_list.front(); E; E = E->next()) {
const String &selected = E->get();
String path = EditorSettings::get_singleton()->get("projects/" + selected);
String conf = path.plus_file("project.pandemonium");
@ -2048,7 +2048,7 @@ void ProjectManager::_open_selected_projects() {
}
void ProjectManager::_open_selected_projects_ask() {
const Set<String> &selected_list = _project_list->get_selected_project_keys();
const RBSet<String> &selected_list = _project_list->get_selected_project_keys();
if (selected_list.size() < 1) {
return;
@ -2134,7 +2134,7 @@ void ProjectManager::_run_project_confirm() {
// When you press the "Run" button
void ProjectManager::_run_project() {
const Set<String> &selected_list = _project_list->get_selected_project_keys();
const RBSet<String> &selected_list = _project_list->get_selected_project_keys();
if (selected_list.size() < 1) {
return;
@ -2194,13 +2194,13 @@ void ProjectManager::_import_project() {
}
void ProjectManager::_rename_project() {
const Set<String> &selected_list = _project_list->get_selected_project_keys();
const RBSet<String> &selected_list = _project_list->get_selected_project_keys();
if (selected_list.size() == 0) {
return;
}
for (Set<String>::Element *E = selected_list.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = selected_list.front(); E; E = E->next()) {
const String &selected = E->get();
String path = EditorSettings::get_singleton()->get("projects/" + selected);
npdialog->set_project_path(path);
@ -2220,7 +2220,7 @@ void ProjectManager::_erase_missing_projects_confirm() {
}
void ProjectManager::_erase_project() {
const Set<String> &selected_list = _project_list->get_selected_project_keys();
const RBSet<String> &selected_list = _project_list->get_selected_project_keys();
if (selected_list.size() == 0) {
return;
@ -2281,7 +2281,7 @@ void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
_install_project(p_files[0], file.substr(0, file.length() - 4).capitalize());
return;
}
Set<String> folders_set;
RBSet<String> folders_set;
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
for (int i = 0; i < p_files.size(); i++) {
String file = p_files[i];
@ -2290,7 +2290,7 @@ void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
memdelete(da);
if (folders_set.size() > 0) {
PoolStringArray folders;
for (Set<String>::Element *E = folders_set.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = folders_set.front(); E; E = E->next()) {
folders.append(E->get());
}

View File

@ -51,7 +51,7 @@
#include "core/math/rect2.h"
#include "core/os/memory.h"
#include "core/containers/pool_vector.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/typedefs.h"
#include "core/object/undo_redo.h"
#include "editor/editor_autoload_settings.h"
@ -1071,7 +1071,7 @@ void ProjectSettingsEditor::queue_save() {
}
void ProjectSettingsEditor::_copy_to_platform_about_to_show() {
Set<String> presets;
RBSet<String> presets;
presets.insert("bptc");
presets.insert("s3tc");
@ -1114,7 +1114,7 @@ void ProjectSettingsEditor::_copy_to_platform_about_to_show() {
popup_copy_to_feature->get_popup()->clear();
int id = 0;
for (Set<String>::Element *E = presets.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = presets.front(); E; E = E->next()) {
popup_copy_to_feature->get_popup()->add_item(E->get(), id++);
}
}

View File

@ -59,7 +59,7 @@
#include "core/object/resource.h"
#include "core/containers/rid.h"
#include "core/object/script_language.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/typedefs.h"
#include "editor/array_property_edit.h"
@ -187,13 +187,13 @@ void CustomPropertyEditor::_menu_option(int p_which) {
ResourceLoader::get_recognized_extensions_for_type(type.get_slice(",", i), &extensions);
}
Set<String> valid_extensions;
RBSet<String> valid_extensions;
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
valid_extensions.insert(E->get());
}
file->clear_filters();
for (Set<String>::Element *E = valid_extensions.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = valid_extensions.front(); E; E = E->next()) {
file->add_filter("*." + E->get() + " ; " + E->get().to_upper());
}
@ -911,7 +911,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
for (int i = 0; i < hint_text.get_slice_count(","); i++) {
String base = hint_text.get_slice(",", i);
Set<String> valid_inheritors;
RBSet<String> valid_inheritors;
valid_inheritors.insert(base);
List<StringName> inheritors;
ClassDB::get_inheriters_from_class(base.strip_edges(), &inheritors);
@ -926,7 +926,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
E = E->next();
}
for (Set<String>::Element *j = valid_inheritors.front(); j; j = j->next()) {
for (RBSet<String>::Element *j = valid_inheritors.front(); j; j = j->next()) {
const String &t = j->get();
bool is_custom_resource = false;

View File

@ -67,7 +67,7 @@ void ReparentDialog::_reparent() {
}
}
void ReparentDialog::set_current(const Set<Node *> &p_selection) {
void ReparentDialog::set_current(const RBSet<Node *> &p_selection) {
tree->set_marked(p_selection, false, false);
//tree->set_selected(p_node->get_parent());
}

View File

@ -32,7 +32,7 @@
#include "scene/gui/dialogs.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
class CheckBox;
class Node;
@ -55,7 +55,7 @@ protected:
static void _bind_methods();
public:
void set_current(const Set<Node *> &p_selection);
void set_current(const RBSet<Node *> &p_selection);
ReparentDialog();
~ReparentDialog();

View File

@ -794,7 +794,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
}
List<Node *> nodes = editor_selection->get_selected_node_list();
Set<Node *> nodeset;
RBSet<Node *> nodeset;
for (List<Node *>::Element *E = nodes.front(); E; E = E->next()) {
nodeset.insert(E->get());
}
@ -1612,8 +1612,8 @@ bool SceneTreeDock::_check_node_path_recursive(Node *p_root_node, Variant &r_var
return false;
}
void SceneTreeDock::perform_node_renames(Node *p_base, RBMap<Node *, NodePath> *p_renames, RBMap<Ref<Animation>, Set<int>> *r_rem_anims) {
RBMap<Ref<Animation>, Set<int>> rem_anims;
void SceneTreeDock::perform_node_renames(Node *p_base, RBMap<Node *, NodePath> *p_renames, RBMap<Ref<Animation>, RBSet<int>> *r_rem_anims) {
RBMap<Ref<Animation>, RBSet<int>> rem_anims;
if (!r_rem_anims) {
r_rem_anims = &rem_anims;
}
@ -1665,14 +1665,14 @@ void SceneTreeDock::perform_node_renames(Node *p_base, RBMap<Node *, NodePath> *
for (List<StringName>::Element *E = anims.front(); E; E = E->next()) {
Ref<Animation> anim = ap->get_animation(E->get());
if (!r_rem_anims->has(anim)) {
r_rem_anims->insert(anim, Set<int>());
Set<int> &ran = r_rem_anims->find(anim)->get();
r_rem_anims->insert(anim, RBSet<int>());
RBSet<int> &ran = r_rem_anims->find(anim)->get();
for (int i = 0; i < anim->get_track_count(); i++) {
ran.insert(i);
}
}
Set<int> &ran = r_rem_anims->find(anim)->get();
RBSet<int> &ran = r_rem_anims->find(anim)->get();
if (anim.is_null()) {
continue;
@ -1695,7 +1695,7 @@ void SceneTreeDock::perform_node_renames(Node *p_base, RBMap<Node *, NodePath> *
//will be erased
int idx = 0;
Set<int>::Element *EI = ran.front();
RBSet<int>::Element *EI = ran.front();
ERR_FAIL_COND(!EI); //bug
while (EI->get() != i) {
idx++;

View File

@ -35,7 +35,7 @@
#include "core/containers/hash_map.h"
#include "core/containers/list.h"
#include "core/containers/rb_map.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/containers/vector.h"
#include "core/object/object_id.h"
#include "core/object/reference.h"
@ -306,7 +306,7 @@ public:
void instance_scenes(const Vector<String> &p_files, Node *p_parent = nullptr);
void set_selected(Node *p_node, bool p_emit_selected = false);
void fill_path_renames(Node *p_node, Node *p_new_parent, RBMap<Node *, NodePath> *p_renames);
void perform_node_renames(Node *p_base, RBMap<Node *, NodePath> *p_renames, RBMap<Ref<Animation>, Set<int>> *r_rem_anims = nullptr);
void perform_node_renames(Node *p_base, RBMap<Node *, NodePath> *p_renames, RBMap<Ref<Animation>, RBSet<int>> *r_rem_anims = nullptr);
SceneTreeEditor *get_tree_editor() {
return scene_tree;

View File

@ -892,7 +892,7 @@ Node *SceneTreeEditor::get_selected() {
return selected;
}
void SceneTreeEditor::set_marked(const Set<Node *> &p_marked, bool p_selectable, bool p_children_selectable) {
void SceneTreeEditor::set_marked(const RBSet<Node *> &p_marked, bool p_selectable, bool p_children_selectable) {
if (tree_dirty) {
_update_tree();
}
@ -903,7 +903,7 @@ void SceneTreeEditor::set_marked(const Set<Node *> &p_marked, bool p_selectable,
}
void SceneTreeEditor::set_marked(Node *p_marked, bool p_selectable, bool p_children_selectable) {
Set<Node *> s;
RBSet<Node *> s;
if (p_marked) {
s.insert(p_marked);
}

View File

@ -37,7 +37,7 @@
#include "core/math/vector2.h"
#include "core/string/node_path.h"
#include "core/object/object_id.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
@ -110,7 +110,7 @@ class SceneTreeEditor : public Control {
void _renamed();
UndoRedo *undo_redo;
Set<Node *> marked;
RBSet<Node *> marked;
bool marked_selectable;
bool marked_children_selectable;
bool display_foreign;
@ -152,7 +152,7 @@ public:
void set_display_foreign_nodes(bool p_display);
bool get_display_foreign_nodes() const;
void set_marked(const Set<Node *> &p_marked, bool p_selectable = false, bool p_children_selectable = true);
void set_marked(const RBSet<Node *> &p_marked, bool p_selectable = false, bool p_children_selectable = true);
void set_marked(Node *p_marked, bool p_selectable = false, bool p_children_selectable = true);
void set_selected(Node *p_node, bool p_emit_selected = true);
Node *get_selected();

View File

@ -646,7 +646,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
debug_obj->prop_list.clear();
int new_props_added = 0;
Set<String> changed;
RBSet<String> changed;
for (int i = 0; i < properties.size(); i++) {
Array prop = properties[i];
if (prop.size() != 6) {
@ -718,7 +718,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
} else {
if (old_prop_size == debug_obj->prop_list.size() && new_props_added == 0) {
//only some may have changed, if so, then update those, if exist
for (Set<String>::Element *E = changed.front(); E; E = E->next()) {
for (RBSet<String>::Element *E = changed.front(); E; E = E->next()) {
EditorNode::get_singleton()->get_inspector()->update_property(E->get());
}
} else {

View File

@ -42,7 +42,7 @@
#include "core/object/object_id.h"
#include "core/object/reference.h"
#include "core/object/resource.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
#include "core/string/string_name.h"
#include "core/string/ustring.h"
#include "core/variant/variant.h"
@ -120,8 +120,8 @@ private:
String last_filter;
ScriptEditorDebuggerVariables *variables;
RBMap<ObjectID, ScriptEditorDebuggerInspectedObject *> remote_objects;
Set<RES> remote_dependencies;
Set<ObjectID> unfold_cache;
RBSet<RES> remote_dependencies;
RBSet<ObjectID> unfold_cache;
VBoxContainer *errors_tab;
Tree *error_tree;

View File

@ -7033,7 +7033,7 @@ Error GLTFDocument::_parse_gltf_extensions(Ref<GLTFState> p_state) {
p_state->extensions_required = ext_array;
}
Set<String> supported_extensions;
RBSet<String> supported_extensions;
supported_extensions.insert("KHR_lights_punctual");
supported_extensions.insert("KHR_materials_pbrSpecularGlossiness");
supported_extensions.insert("KHR_texture_transform");

View File

@ -109,8 +109,8 @@ void GLTFState::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "skins", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_skins", "get_skins"); // Vector<Ref<GLTFSkin>>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "cameras", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_cameras", "get_cameras"); // Vector<Ref<GLTFCamera>>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "lights", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_lights", "get_lights"); // Vector<Ref<GLTFLight>>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_names", "get_unique_names"); // Set<String>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_animation_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_animation_names", "get_unique_animation_names"); // Set<String>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_names", "get_unique_names"); // RBSet<String>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_animation_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_animation_names", "get_unique_animation_names"); // RBSet<String>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "skeletons", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_skeletons", "get_skeletons"); // Vector<Ref<GLTFSkeleton>>
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "skeleton_to_node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_skeleton_to_node", "get_skeleton_to_node"); // RBMap<GLTFSkeletonIndex,
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "create_animations"), "set_create_animations", "get_create_animations"); // bool

View File

@ -84,8 +84,8 @@ class GLTFState : public Resource {
Vector<Ref<GLTFSkin>> skins;
Vector<Ref<GLTFCamera>> cameras;
Vector<Ref<GLTFLight>> lights;
Set<String> unique_names;
Set<String> unique_animation_names;
RBSet<String> unique_names;
RBSet<String> unique_animation_names;
Vector<Ref<GLTFSkeleton>> skeletons;
RBMap<GLTFSkeletonIndex, GLTFNodeIndex> skeleton_to_node;

View File

@ -33,7 +33,7 @@
#include "core/variant/array.h"
#include "core/variant/dictionary.h"
#include "core/containers/set.h"
#include "core/containers/rb_set.h"
namespace GLTFTemplateConvert {
template <class T>
@ -46,9 +46,9 @@ static Array to_array(const Vector<T> &p_inp) {
}
template <class T>
static Array to_array(const Set<T> &p_inp) {
static Array to_array(const RBSet<T> &p_inp) {
Array ret;
typename Set<T>::Element *elem = p_inp.front();
typename RBSet<T>::Element *elem = p_inp.front();
while (elem) {
ret.push_back(elem->get());
elem = elem->next();
@ -65,7 +65,7 @@ static void set_from_array(Vector<T> &r_out, const Array &p_inp) {
}
template <class T>
static void set_from_array(Set<T> &r_out, const Array &p_inp) {
static void set_from_array(RBSet<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]);

View File

@ -56,7 +56,7 @@ void GLTFSkeleton::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY, "joints"), "set_joints", "get_joints"); // PoolVector<GLTFNodeIndex>
ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY, "roots"), "set_roots", "get_roots"); // PoolVector<GLTFNodeIndex>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_names", "get_unique_names"); // Set<String>
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "unique_names", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_unique_names", "get_unique_names"); // RBSet<String>
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "pandemonium_bone_node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_EDITOR), "set_pandemonium_bone_node", "get_pandemonium_bone_node"); // RBMap<int32_t,
}

Some files were not shown because too many files have changed in this diff Show More