Skip to content

Commit

Permalink
Make Vector<T>::duplicate() const
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfranke committed Dec 18, 2024
1 parent 6e2cf2a commit 55a3669
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/templates/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class Vector {
return search.bisect(ptrw(), size(), p_value, p_before);
}

Vector<T> duplicate() {
Vector<T> duplicate() const {
return *this;
}

Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedByteArray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
[b]Note:[/b] Decompression is not guaranteed to work with data not compressed by Godot, for example if data compressed with the deflate compression mode lacks a checksum or header.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedByteArray" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedColorArray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
Returns the number of times an element is in the array.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedColorArray" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedFloat32Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
[b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedFloat32Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedFloat64Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
[b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedFloat64Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedInt32Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
Returns the number of times an element is in the array.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedInt32Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedInt64Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
Returns the number of times an element is in the array.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedInt64Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedStringArray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
Returns the number of times an element is in the array.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedStringArray" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedVector2Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedVector2Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedVector3Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedVector3Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/PackedVector4Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
</description>
</method>
<method name="duplicate">
<method name="duplicate" qualifiers="const">
<return type="PackedVector4Array" />
<description>
Creates a copy of the array, and returns it.
Expand Down
26 changes: 26 additions & 0 deletions misc/extension_api_validation/4.3-stable.expected
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,29 @@ Validate extension JSON: Error: Field 'classes/PointLight2D/properties/texture':

Property hints modified to disallow resource types that don't work. The types allowed are now more restricted, but this change only impacts the editor and not the actual exposed API. No adjustments should be necessary.
Decal properties were previously changed from Texture to Texture2D in 4.2, so we need to silence those warnings too.


GH-79140
--------
Validate extension JSON: Error: Field 'builtin_classes/PackedByteArray/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedColorArray/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedFloat32Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedFloat64Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedInt32Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedInt64Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedStringArray/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedVector2Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedVector3Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Field 'builtin_classes/PackedVector4Array/methods/duplicate': is_const changed value in new API, from false to true.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedByteArray/methods/duplicate', from 32C526A8 to 0EC26674. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedColorArray/methods/duplicate', from 3C506BBD to B71B693D. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedFloat32Array/methods/duplicate', from 3189CE20 to D517D0F3. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedFloat64Array/methods/duplicate', from 3894A88D to 60FEC131. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedInt32Array/methods/duplicate', from 7714AAB9 to BC482404. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedInt64Array/methods/duplicate', from 8DA48760 to 74E6F928. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedStringArray/methods/duplicate', from B24A91B2 to 2C891259. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedVector2Array/methods/duplicate', from E054B15C to 62F74D55. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedVector3Array/methods/duplicate', from A42961E9 to F89F931C. This means that the function has changed and no compatibility function was provided.
Validate extension JSON: Error: Hash changed for 'builtin_classes/PackedVector4Array/methods/duplicate', from BDEB27F5 to 08B6E3EC. This means that the function has changed and no compatibility function was provided.

Make Vector<T>::duplicate() const.

0 comments on commit 55a3669

Please sign in to comment.