Merge pull request #46991 from madmiraal/rename-invert-reverse
Rename Array.invert() to Array.reverse()
This commit is contained in:
commit
4b6e9f3157
@ -1138,7 +1138,7 @@ Vector<String> String::rsplit(const String &p_splitter, bool p_allow_empty, int
|
|||||||
remaining_len = left_edge;
|
remaining_len = left_edge;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret.invert();
|
ret.reverse();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ public:
|
|||||||
_data->last = p_I;
|
_data->last = p_I;
|
||||||
}
|
}
|
||||||
|
|
||||||
void invert() {
|
void reverse() {
|
||||||
int s = size() / 2;
|
int s = size() / 2;
|
||||||
Element *F = front();
|
Element *F = front();
|
||||||
Element *B = back();
|
Element *B = back();
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
remove(idx);
|
remove(idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void invert();
|
void reverse();
|
||||||
|
|
||||||
_FORCE_INLINE_ T *ptrw() { return _cowdata.ptrw(); }
|
_FORCE_INLINE_ T *ptrw() { return _cowdata.ptrw(); }
|
||||||
_FORCE_INLINE_ const T *ptr() const { return _cowdata.ptr(); }
|
_FORCE_INLINE_ const T *ptr() const { return _cowdata.ptr(); }
|
||||||
@ -194,7 +194,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
void Vector<T>::invert() {
|
void Vector<T>::reverse() {
|
||||||
for (int i = 0; i < size() / 2; i++) {
|
for (int i = 0; i < size() / 2; i++) {
|
||||||
T *p = ptrw();
|
T *p = ptrw();
|
||||||
SWAP(p[i], p[size() - i - 1]);
|
SWAP(p[i], p[size() - i - 1]);
|
||||||
|
@ -446,8 +446,8 @@ int Array::bsearch_custom(const Variant &p_value, Callable p_callable, bool p_be
|
|||||||
return bisect(_p->array, p_value, p_before, less);
|
return bisect(_p->array, p_value, p_before, less);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Array::invert() {
|
void Array::reverse() {
|
||||||
_p->array.invert();
|
_p->array.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Array::push_front(const Variant &p_value) {
|
void Array::push_front(const Variant &p_value) {
|
||||||
|
@ -83,7 +83,7 @@ public:
|
|||||||
void shuffle();
|
void shuffle();
|
||||||
int bsearch(const Variant &p_value, bool p_before = true);
|
int bsearch(const Variant &p_value, bool p_before = true);
|
||||||
int bsearch_custom(const Variant &p_value, Callable p_callable, bool p_before = true);
|
int bsearch_custom(const Variant &p_value, Callable p_callable, bool p_before = true);
|
||||||
void invert();
|
void reverse();
|
||||||
|
|
||||||
int find(const Variant &p_value, int p_from = 0) const;
|
int find(const Variant &p_value, int p_from = 0) const;
|
||||||
int rfind(const Variant &p_value, int p_from = -1) const;
|
int rfind(const Variant &p_value, int p_from = -1) const;
|
||||||
|
@ -1460,7 +1460,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(Array, shuffle, sarray(), varray());
|
bind_method(Array, shuffle, sarray(), varray());
|
||||||
bind_method(Array, bsearch, sarray("value", "before"), varray(true));
|
bind_method(Array, bsearch, sarray("value", "before"), varray(true));
|
||||||
bind_method(Array, bsearch_custom, sarray("value", "func", "before"), varray(true));
|
bind_method(Array, bsearch_custom, sarray("value", "func", "before"), varray(true));
|
||||||
bind_method(Array, invert, sarray(), varray());
|
bind_method(Array, reverse, sarray(), varray());
|
||||||
bind_method(Array, duplicate, sarray("deep"), varray(false));
|
bind_method(Array, duplicate, sarray("deep"), varray(false));
|
||||||
bind_method(Array, slice, sarray("begin", "end", "step", "deep"), varray(1, false));
|
bind_method(Array, slice, sarray("begin", "end", "step", "deep"), varray(1, false));
|
||||||
bind_method(Array, max, sarray(), varray());
|
bind_method(Array, max, sarray(), varray());
|
||||||
@ -1477,7 +1477,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedByteArray, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedByteArray, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedByteArray, resize, sarray("new_size"), varray());
|
bind_method(PackedByteArray, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedByteArray, has, sarray("value"), varray());
|
bind_method(PackedByteArray, has, sarray("value"), varray());
|
||||||
bind_method(PackedByteArray, invert, sarray(), varray());
|
bind_method(PackedByteArray, reverse, sarray(), varray());
|
||||||
bind_method(PackedByteArray, subarray, sarray("from", "to"), varray());
|
bind_method(PackedByteArray, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedByteArray, sort, sarray(), varray());
|
bind_method(PackedByteArray, sort, sarray(), varray());
|
||||||
bind_method(PackedByteArray, duplicate, sarray(), varray());
|
bind_method(PackedByteArray, duplicate, sarray(), varray());
|
||||||
@ -1503,7 +1503,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedInt32Array, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedInt32Array, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedInt32Array, resize, sarray("new_size"), varray());
|
bind_method(PackedInt32Array, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedInt32Array, has, sarray("value"), varray());
|
bind_method(PackedInt32Array, has, sarray("value"), varray());
|
||||||
bind_method(PackedInt32Array, invert, sarray(), varray());
|
bind_method(PackedInt32Array, reverse, sarray(), varray());
|
||||||
bind_method(PackedInt32Array, subarray, sarray("from", "to"), varray());
|
bind_method(PackedInt32Array, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedInt32Array, to_byte_array, sarray(), varray());
|
bind_method(PackedInt32Array, to_byte_array, sarray(), varray());
|
||||||
bind_method(PackedInt32Array, sort, sarray(), varray());
|
bind_method(PackedInt32Array, sort, sarray(), varray());
|
||||||
@ -1521,7 +1521,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedInt64Array, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedInt64Array, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedInt64Array, resize, sarray("new_size"), varray());
|
bind_method(PackedInt64Array, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedInt64Array, has, sarray("value"), varray());
|
bind_method(PackedInt64Array, has, sarray("value"), varray());
|
||||||
bind_method(PackedInt64Array, invert, sarray(), varray());
|
bind_method(PackedInt64Array, reverse, sarray(), varray());
|
||||||
bind_method(PackedInt64Array, subarray, sarray("from", "to"), varray());
|
bind_method(PackedInt64Array, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedInt64Array, to_byte_array, sarray(), varray());
|
bind_method(PackedInt64Array, to_byte_array, sarray(), varray());
|
||||||
bind_method(PackedInt64Array, sort, sarray(), varray());
|
bind_method(PackedInt64Array, sort, sarray(), varray());
|
||||||
@ -1539,7 +1539,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedFloat32Array, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedFloat32Array, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedFloat32Array, resize, sarray("new_size"), varray());
|
bind_method(PackedFloat32Array, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedFloat32Array, has, sarray("value"), varray());
|
bind_method(PackedFloat32Array, has, sarray("value"), varray());
|
||||||
bind_method(PackedFloat32Array, invert, sarray(), varray());
|
bind_method(PackedFloat32Array, reverse, sarray(), varray());
|
||||||
bind_method(PackedFloat32Array, subarray, sarray("from", "to"), varray());
|
bind_method(PackedFloat32Array, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedFloat32Array, to_byte_array, sarray(), varray());
|
bind_method(PackedFloat32Array, to_byte_array, sarray(), varray());
|
||||||
bind_method(PackedFloat32Array, sort, sarray(), varray());
|
bind_method(PackedFloat32Array, sort, sarray(), varray());
|
||||||
@ -1557,7 +1557,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedFloat64Array, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedFloat64Array, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedFloat64Array, resize, sarray("new_size"), varray());
|
bind_method(PackedFloat64Array, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedFloat64Array, has, sarray("value"), varray());
|
bind_method(PackedFloat64Array, has, sarray("value"), varray());
|
||||||
bind_method(PackedFloat64Array, invert, sarray(), varray());
|
bind_method(PackedFloat64Array, reverse, sarray(), varray());
|
||||||
bind_method(PackedFloat64Array, subarray, sarray("from", "to"), varray());
|
bind_method(PackedFloat64Array, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedFloat64Array, to_byte_array, sarray(), varray());
|
bind_method(PackedFloat64Array, to_byte_array, sarray(), varray());
|
||||||
bind_method(PackedFloat64Array, sort, sarray(), varray());
|
bind_method(PackedFloat64Array, sort, sarray(), varray());
|
||||||
@ -1575,7 +1575,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedStringArray, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedStringArray, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedStringArray, resize, sarray("new_size"), varray());
|
bind_method(PackedStringArray, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedStringArray, has, sarray("value"), varray());
|
bind_method(PackedStringArray, has, sarray("value"), varray());
|
||||||
bind_method(PackedStringArray, invert, sarray(), varray());
|
bind_method(PackedStringArray, reverse, sarray(), varray());
|
||||||
bind_method(PackedStringArray, subarray, sarray("from", "to"), varray());
|
bind_method(PackedStringArray, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedStringArray, to_byte_array, sarray(), varray());
|
bind_method(PackedStringArray, to_byte_array, sarray(), varray());
|
||||||
bind_method(PackedStringArray, sort, sarray(), varray());
|
bind_method(PackedStringArray, sort, sarray(), varray());
|
||||||
@ -1593,7 +1593,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedVector2Array, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedVector2Array, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedVector2Array, resize, sarray("new_size"), varray());
|
bind_method(PackedVector2Array, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedVector2Array, has, sarray("value"), varray());
|
bind_method(PackedVector2Array, has, sarray("value"), varray());
|
||||||
bind_method(PackedVector2Array, invert, sarray(), varray());
|
bind_method(PackedVector2Array, reverse, sarray(), varray());
|
||||||
bind_method(PackedVector2Array, subarray, sarray("from", "to"), varray());
|
bind_method(PackedVector2Array, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedVector2Array, to_byte_array, sarray(), varray());
|
bind_method(PackedVector2Array, to_byte_array, sarray(), varray());
|
||||||
bind_method(PackedVector2Array, sort, sarray(), varray());
|
bind_method(PackedVector2Array, sort, sarray(), varray());
|
||||||
@ -1611,7 +1611,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedVector3Array, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedVector3Array, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedVector3Array, resize, sarray("new_size"), varray());
|
bind_method(PackedVector3Array, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedVector3Array, has, sarray("value"), varray());
|
bind_method(PackedVector3Array, has, sarray("value"), varray());
|
||||||
bind_method(PackedVector3Array, invert, sarray(), varray());
|
bind_method(PackedVector3Array, reverse, sarray(), varray());
|
||||||
bind_method(PackedVector3Array, subarray, sarray("from", "to"), varray());
|
bind_method(PackedVector3Array, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedVector3Array, to_byte_array, sarray(), varray());
|
bind_method(PackedVector3Array, to_byte_array, sarray(), varray());
|
||||||
bind_method(PackedVector3Array, sort, sarray(), varray());
|
bind_method(PackedVector3Array, sort, sarray(), varray());
|
||||||
@ -1629,7 +1629,7 @@ static void _register_variant_builtin_methods() {
|
|||||||
bind_method(PackedColorArray, insert, sarray("at_index", "value"), varray());
|
bind_method(PackedColorArray, insert, sarray("at_index", "value"), varray());
|
||||||
bind_method(PackedColorArray, resize, sarray("new_size"), varray());
|
bind_method(PackedColorArray, resize, sarray("new_size"), varray());
|
||||||
bind_method(PackedColorArray, has, sarray("value"), varray());
|
bind_method(PackedColorArray, has, sarray("value"), varray());
|
||||||
bind_method(PackedColorArray, invert, sarray(), varray());
|
bind_method(PackedColorArray, reverse, sarray(), varray());
|
||||||
bind_method(PackedColorArray, subarray, sarray("from", "to"), varray());
|
bind_method(PackedColorArray, subarray, sarray("from", "to"), varray());
|
||||||
bind_method(PackedColorArray, to_byte_array, sarray(), varray());
|
bind_method(PackedColorArray, to_byte_array, sarray(), varray());
|
||||||
bind_method(PackedColorArray, sort, sarray(), varray());
|
bind_method(PackedColorArray, sort, sarray(), varray());
|
||||||
|
@ -328,7 +328,7 @@
|
|||||||
[b]Note:[/b] On large arrays, this method will be slower if the inserted element is close to the beginning of the array (index 0). This is because all elements placed after the newly inserted element have to be reindexed.
|
[b]Note:[/b] On large arrays, this method will be slower if the inserted element is close to the beginning of the array (index 0). This is because all elements placed after the newly inserted element have to be reindexed.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -157,7 +157,7 @@
|
|||||||
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new integer at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
Inserts a new element at a given position in the array. The position must be valid, or at the end of the array ([code]idx == size()[/code]).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="invert">
|
<method name="reverse">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
@ -86,11 +86,11 @@ void DependencyEditor::_fix_and_find(EditorFileSystemDirectory *efsd, Map<String
|
|||||||
String lost = E->key().replace_first("res://", "");
|
String lost = E->key().replace_first("res://", "");
|
||||||
|
|
||||||
Vector<String> existingv = existing.split("/");
|
Vector<String> existingv = existing.split("/");
|
||||||
existingv.invert();
|
existingv.reverse();
|
||||||
Vector<String> currentv = current.split("/");
|
Vector<String> currentv = current.split("/");
|
||||||
currentv.invert();
|
currentv.reverse();
|
||||||
Vector<String> lostv = lost.split("/");
|
Vector<String> lostv = lost.split("/");
|
||||||
lostv.invert();
|
lostv.reverse();
|
||||||
|
|
||||||
int existing_score = 0;
|
int existing_score = 0;
|
||||||
int current_score = 0;
|
int current_score = 0;
|
||||||
|
@ -680,17 +680,17 @@ void FileSystemDock::_sort_file_info_list(List<FileSystemDock::FileInfo> &r_file
|
|||||||
break;
|
break;
|
||||||
case FILE_SORT_TYPE_REVERSE:
|
case FILE_SORT_TYPE_REVERSE:
|
||||||
r_file_list.sort_custom<FileInfoTypeComparator>();
|
r_file_list.sort_custom<FileInfoTypeComparator>();
|
||||||
r_file_list.invert();
|
r_file_list.reverse();
|
||||||
break;
|
break;
|
||||||
case FILE_SORT_MODIFIED_TIME:
|
case FILE_SORT_MODIFIED_TIME:
|
||||||
r_file_list.sort_custom<FileInfoModifiedTimeComparator>();
|
r_file_list.sort_custom<FileInfoModifiedTimeComparator>();
|
||||||
break;
|
break;
|
||||||
case FILE_SORT_MODIFIED_TIME_REVERSE:
|
case FILE_SORT_MODIFIED_TIME_REVERSE:
|
||||||
r_file_list.sort_custom<FileInfoModifiedTimeComparator>();
|
r_file_list.sort_custom<FileInfoModifiedTimeComparator>();
|
||||||
r_file_list.invert();
|
r_file_list.reverse();
|
||||||
break;
|
break;
|
||||||
case FILE_SORT_NAME_REVERSE:
|
case FILE_SORT_NAME_REVERSE:
|
||||||
r_file_list.invert();
|
r_file_list.reverse();
|
||||||
break;
|
break;
|
||||||
default: // FILE_SORT_NAME
|
default: // FILE_SORT_NAME
|
||||||
break;
|
break;
|
||||||
|
@ -2928,7 +2928,7 @@ void TileSetEditor::close_shape(const Vector2 &shape_anchor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p_total < 0) {
|
if (p_total < 0) {
|
||||||
points.invert();
|
points.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
shape->set_points(points);
|
shape->set_points(points);
|
||||||
|
@ -608,7 +608,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
|
|||||||
List<Node *> selection = editor_selection->get_selected_node_list();
|
List<Node *> selection = editor_selection->get_selected_node_list();
|
||||||
selection.sort_custom<Node::Comparator>(); // sort by index
|
selection.sort_custom<Node::Comparator>(); // sort by index
|
||||||
if (MOVING_DOWN) {
|
if (MOVING_DOWN) {
|
||||||
selection.invert();
|
selection.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
int lowest_id = common_parent->get_child_count() - 1;
|
int lowest_id = common_parent->get_child_count() - 1;
|
||||||
@ -1384,7 +1384,7 @@ void SceneTreeDock::fill_path_renames(Node *p_node, Node *p_new_parent, List<Pai
|
|||||||
base_path.push_back(n->get_name());
|
base_path.push_back(n->get_name());
|
||||||
n = n->get_parent();
|
n = n->get_parent();
|
||||||
}
|
}
|
||||||
base_path.invert();
|
base_path.reverse();
|
||||||
|
|
||||||
Vector<StringName> new_base_path;
|
Vector<StringName> new_base_path;
|
||||||
if (p_new_parent) {
|
if (p_new_parent) {
|
||||||
@ -1394,7 +1394,7 @@ void SceneTreeDock::fill_path_renames(Node *p_node, Node *p_new_parent, List<Pai
|
|||||||
n = n->get_parent();
|
n = n->get_parent();
|
||||||
}
|
}
|
||||||
|
|
||||||
new_base_path.invert();
|
new_base_path.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
_fill_path_renames(base_path, new_base_path, p_node, p_renames);
|
_fill_path_renames(base_path, new_base_path, p_node, p_renames);
|
||||||
@ -1580,7 +1580,7 @@ void SceneTreeDock::_node_prerenamed(Node *p_node, const String &p_new_name) {
|
|||||||
base_path.push_back(n->get_name());
|
base_path.push_back(n->get_name());
|
||||||
n = n->get_parent();
|
n = n->get_parent();
|
||||||
}
|
}
|
||||||
base_path.invert();
|
base_path.reverse();
|
||||||
|
|
||||||
Vector<StringName> new_base_path = base_path;
|
Vector<StringName> new_base_path = base_path;
|
||||||
base_path.push_back(p_node->get_name());
|
base_path.push_back(p_node->get_name());
|
||||||
|
@ -931,7 +931,7 @@ void CSGBrushOperation::Build2DFaces::_merge_faces(const Vector<int> &p_segment_
|
|||||||
|
|
||||||
// Delete the old faces in reverse index order.
|
// Delete the old faces in reverse index order.
|
||||||
merge_faces_idx.sort();
|
merge_faces_idx.sort();
|
||||||
merge_faces_idx.invert();
|
merge_faces_idx.reverse();
|
||||||
for (int i = 0; i < merge_faces_idx.size(); ++i) {
|
for (int i = 0; i < merge_faces_idx.size(); ++i) {
|
||||||
faces.remove(merge_faces_idx[i]);
|
faces.remove(merge_faces_idx[i]);
|
||||||
}
|
}
|
||||||
|
@ -1679,7 +1679,7 @@ CSGBrush *CSGPolygon3D::_build_brush() {
|
|||||||
Vector<Point2> final_polygon = polygon;
|
Vector<Point2> final_polygon = polygon;
|
||||||
|
|
||||||
if (Triangulate::get_area(final_polygon) > 0) {
|
if (Triangulate::get_area(final_polygon) > 0) {
|
||||||
final_polygon.invert();
|
final_polygon.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<int> triangles = Geometry2D::triangulate_polygon(final_polygon);
|
Vector<int> triangles = Geometry2D::triangulate_polygon(final_polygon);
|
||||||
|
@ -5716,7 +5716,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "godot_packed_glyph_array_invert",
|
"name": "godot_packed_glyph_array_reverse",
|
||||||
"return_type": "void",
|
"return_type": "void",
|
||||||
"arguments": [
|
"arguments": [
|
||||||
[
|
[
|
||||||
|
@ -214,7 +214,7 @@ godot_bool GDAPI godot_packed_glyph_array_has(godot_packed_glyph_array *p_self,
|
|||||||
|
|
||||||
void GDAPI godot_packed_glyph_array_sort(godot_packed_glyph_array *p_self);
|
void GDAPI godot_packed_glyph_array_sort(godot_packed_glyph_array *p_self);
|
||||||
|
|
||||||
void GDAPI godot_packed_glyph_array_invert(godot_packed_glyph_array *p_self);
|
void GDAPI godot_packed_glyph_array_reverse(godot_packed_glyph_array *p_self);
|
||||||
|
|
||||||
void GDAPI godot_packed_glyph_array_push_back(godot_packed_glyph_array *p_self, const godot_glyph *p_data);
|
void GDAPI godot_packed_glyph_array_push_back(godot_packed_glyph_array *p_self, const godot_glyph *p_data);
|
||||||
|
|
||||||
|
@ -847,9 +847,9 @@ void GDAPI godot_packed_glyph_array_sort(godot_packed_glyph_array *p_self) {
|
|||||||
self->sort();
|
self->sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GDAPI godot_packed_glyph_array_invert(godot_packed_glyph_array *p_self) {
|
void GDAPI godot_packed_glyph_array_reverse(godot_packed_glyph_array *p_self) {
|
||||||
Vector<TextServer::Glyph> *self = (Vector<TextServer::Glyph> *)p_self;
|
Vector<TextServer::Glyph> *self = (Vector<TextServer::Glyph> *)p_self;
|
||||||
self->invert();
|
self->reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GDAPI godot_packed_glyph_array_push_back(godot_packed_glyph_array *p_self, const godot_glyph *p_data) {
|
void GDAPI godot_packed_glyph_array_push_back(godot_packed_glyph_array *p_self, const godot_glyph *p_data) {
|
||||||
|
@ -351,7 +351,7 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p
|
|||||||
path.push_back(begin_point);
|
path.push_back(begin_point);
|
||||||
}
|
}
|
||||||
|
|
||||||
path.invert();
|
path.reverse();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
path.push_back(end_point);
|
path.push_back(end_point);
|
||||||
@ -363,7 +363,7 @@ Vector<Vector3> NavMap::get_path(Vector3 p_origin, Vector3 p_destination, bool p
|
|||||||
np_id = navigation_polys[np_id].back_navigation_poly_id;
|
np_id = navigation_polys[np_id].back_navigation_poly_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
path.invert();
|
path.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
|
@ -276,7 +276,7 @@ void GDScript::_get_script_property_list(List<PropertyInfo> *r_list, bool p_incl
|
|||||||
}
|
}
|
||||||
|
|
||||||
msort.sort();
|
msort.sort();
|
||||||
msort.invert();
|
msort.reverse();
|
||||||
for (int i = 0; i < msort.size(); i++) {
|
for (int i = 0; i < msort.size(); i++) {
|
||||||
props.push_front(sptr->member_info[msort[i].name]);
|
props.push_front(sptr->member_info[msort[i].name]);
|
||||||
}
|
}
|
||||||
@ -1502,7 +1502,7 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
msort.sort();
|
msort.sort();
|
||||||
msort.invert();
|
msort.reverse();
|
||||||
for (int i = 0; i < msort.size(); i++) {
|
for (int i = 0; i < msort.size(); i++) {
|
||||||
props.push_front(sptr->member_info[msort[i].name]);
|
props.push_front(sptr->member_info[msort[i].name]);
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ void GDScriptByteCodeGenerator::start_parameters() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GDScriptByteCodeGenerator::end_parameters() {
|
void GDScriptByteCodeGenerator::end_parameters() {
|
||||||
function->default_arguments.invert();
|
function->default_arguments.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GDScriptByteCodeGenerator::write_start(GDScript *p_script, const StringName &p_function_name, bool p_static, MultiplayerAPI::RPCMode p_rpc_mode, const GDScriptDataType &p_return_type) {
|
void GDScriptByteCodeGenerator::write_start(GDScript *p_script, const StringName &p_function_name, bool p_static, MultiplayerAPI::RPCMode p_rpc_mode, const GDScriptDataType &p_return_type) {
|
||||||
|
@ -298,7 +298,7 @@ struct GDScriptUtilityFunctionsDefinitions {
|
|||||||
sname.push_back(p->name);
|
sname.push_back(p->name);
|
||||||
p = p->_owner;
|
p = p->_owner;
|
||||||
}
|
}
|
||||||
sname.invert();
|
sname.reverse();
|
||||||
|
|
||||||
if (!p->path.is_resource_file()) {
|
if (!p->path.is_resource_file()) {
|
||||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||||
|
@ -281,7 +281,7 @@ bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *p_sta
|
|||||||
at = cost_map[at].prev;
|
at = cost_map[at].prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
path.invert();
|
path.reverse();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1690,7 +1690,7 @@ NodePath Node::get_path_to(const Node *p_node) const {
|
|||||||
n = n->data.parent;
|
n = n->data.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
path.invert();
|
path.reverse();
|
||||||
|
|
||||||
return NodePath(path, false);
|
return NodePath(path, false);
|
||||||
}
|
}
|
||||||
@ -1711,7 +1711,7 @@ NodePath Node::get_path() const {
|
|||||||
n = n->data.parent;
|
n = n->data.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
path.invert();
|
path.reverse();
|
||||||
|
|
||||||
data.path_cache = memnew(NodePath(path, true));
|
data.path_cache = memnew(NodePath(path, true));
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ bool ConvexPolygonShape2D::_edit_is_selected_on_click(const Point2 &p_point, dou
|
|||||||
void ConvexPolygonShape2D::_update_shape() {
|
void ConvexPolygonShape2D::_update_shape() {
|
||||||
Vector<Vector2> final_points = points;
|
Vector<Vector2> final_points = points;
|
||||||
if (Geometry2D::is_polygon_clockwise(final_points)) { //needs to be counter clockwise
|
if (Geometry2D::is_polygon_clockwise(final_points)) { //needs to be counter clockwise
|
||||||
final_points.invert();
|
final_points.reverse();
|
||||||
}
|
}
|
||||||
PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), final_points);
|
PhysicsServer2D::get_singleton()->shape_set_data(get_rid(), final_points);
|
||||||
emit_changed();
|
emit_changed();
|
||||||
|
@ -368,7 +368,7 @@ Vector<Vector2> PolygonPathFinder::find_path(const Vector2 &p_from, const Vector
|
|||||||
path.push_back(points[at].pos);
|
path.push_back(points[at].pos);
|
||||||
} while (at != aidx);
|
} while (at != aidx);
|
||||||
|
|
||||||
path.invert();
|
path.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < points.size() - 2; i++) {
|
for (int i = 0; i < points.size() - 2; i++) {
|
||||||
|
@ -113,7 +113,7 @@ TEST_CASE("[Geometry2D] Polygon clockwise") {
|
|||||||
p.push_back(Vector2(1, 5));
|
p.push_back(Vector2(1, 5));
|
||||||
CHECK(Geometry2D::is_polygon_clockwise(p));
|
CHECK(Geometry2D::is_polygon_clockwise(p));
|
||||||
|
|
||||||
p.invert();
|
p.reverse();
|
||||||
CHECK_FALSE(Geometry2D::is_polygon_clockwise(p));
|
CHECK_FALSE(Geometry2D::is_polygon_clockwise(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ TEST_CASE("[List] Invert") {
|
|||||||
List<int>::Element *n[4];
|
List<int>::Element *n[4];
|
||||||
populate_integers(list, n, 4);
|
populate_integers(list, n, 4);
|
||||||
|
|
||||||
list.invert();
|
list.reverse();
|
||||||
|
|
||||||
CHECK(list.front()->get() == 3);
|
CHECK(list.front()->get() == 3);
|
||||||
CHECK(list.front()->next()->get() == 2);
|
CHECK(list.front()->next()->get() == 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user