Merge pull request #63959 from KoBeWi/typo_arrray

Replace Array return types with TypedArray (part 1)
This commit is contained in:
Rémi Verschelde 2022-08-23 08:52:13 +02:00 committed by GitHub
commit 62c3e72b6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
110 changed files with 298 additions and 272 deletions

View file

@ -36,6 +36,7 @@
#include "core/io/json.h" #include "core/io/json.h"
#include "core/license.gen.h" #include "core/license.gen.h"
#include "core/os/os.h" #include "core/os/os.h"
#include "core/variant/typed_array.h"
#include "core/version.h" #include "core/version.h"
void Engine::set_physics_ticks_per_second(int p_ips) { void Engine::set_physics_ticks_per_second(int p_ips) {
@ -136,8 +137,8 @@ Dictionary Engine::get_author_info() const {
return dict; return dict;
} }
Array Engine::get_copyright_info() const { TypedArray<Dictionary> Engine::get_copyright_info() const {
Array components; TypedArray<Dictionary> components;
for (int component_index = 0; component_index < COPYRIGHT_INFO_COUNT; component_index++) { for (int component_index = 0; component_index < COPYRIGHT_INFO_COUNT; component_index++) {
const ComponentCopyright &cp_info = COPYRIGHT_INFO[component_index]; const ComponentCopyright &cp_info = COPYRIGHT_INFO[component_index];
Dictionary component_dict; Dictionary component_dict;

View file

@ -36,6 +36,9 @@
#include "core/templates/list.h" #include "core/templates/list.h"
#include "core/templates/vector.h" #include "core/templates/vector.h"
template <typename T>
class TypedArray;
class Engine { class Engine {
public: public:
struct Singleton { struct Singleton {
@ -139,7 +142,7 @@ public:
Dictionary get_version_info() const; Dictionary get_version_info() const;
Dictionary get_author_info() const; Dictionary get_author_info() const;
Array get_copyright_info() const; TypedArray<Dictionary> get_copyright_info() const;
Dictionary get_donor_info() const; Dictionary get_donor_info() const;
Dictionary get_license_info() const; Dictionary get_license_info() const;
String get_license_text() const; String get_license_text() const;

View file

@ -39,6 +39,7 @@
#include "core/math/geometry_2d.h" #include "core/math/geometry_2d.h"
#include "core/math/geometry_3d.h" #include "core/math/geometry_3d.h"
#include "core/os/keyboard.h" #include "core/os/keyboard.h"
#include "core/variant/typed_array.h"
namespace core_bind { namespace core_bind {
@ -2022,10 +2023,10 @@ Dictionary ClassDB::get_signal(StringName p_class, StringName p_signal) const {
} }
} }
Array ClassDB::get_signal_list(StringName p_class, bool p_no_inheritance) const { TypedArray<Dictionary> ClassDB::get_signal_list(StringName p_class, bool p_no_inheritance) const {
List<MethodInfo> signals; List<MethodInfo> signals;
::ClassDB::get_signal_list(p_class, &signals, p_no_inheritance); ::ClassDB::get_signal_list(p_class, &signals, p_no_inheritance);
Array ret; TypedArray<Dictionary> ret;
for (const MethodInfo &E : signals) { for (const MethodInfo &E : signals) {
ret.push_back(E.operator Dictionary()); ret.push_back(E.operator Dictionary());
@ -2034,10 +2035,10 @@ Array ClassDB::get_signal_list(StringName p_class, bool p_no_inheritance) const
return ret; return ret;
} }
Array ClassDB::get_property_list(StringName p_class, bool p_no_inheritance) const { TypedArray<Dictionary> ClassDB::get_property_list(StringName p_class, bool p_no_inheritance) const {
List<PropertyInfo> plist; List<PropertyInfo> plist;
::ClassDB::get_property_list(p_class, &plist, p_no_inheritance); ::ClassDB::get_property_list(p_class, &plist, p_no_inheritance);
Array ret; TypedArray<Dictionary> ret;
for (const PropertyInfo &E : plist) { for (const PropertyInfo &E : plist) {
ret.push_back(E.operator Dictionary()); ret.push_back(E.operator Dictionary());
} }
@ -2066,10 +2067,10 @@ bool ClassDB::has_method(StringName p_class, StringName p_method, bool p_no_inhe
return ::ClassDB::has_method(p_class, p_method, p_no_inheritance); return ::ClassDB::has_method(p_class, p_method, p_no_inheritance);
} }
Array ClassDB::get_method_list(StringName p_class, bool p_no_inheritance) const { TypedArray<Dictionary> ClassDB::get_method_list(StringName p_class, bool p_no_inheritance) const {
List<MethodInfo> methods; List<MethodInfo> methods;
::ClassDB::get_method_list(p_class, &methods, p_no_inheritance); ::ClassDB::get_method_list(p_class, &methods, p_no_inheritance);
Array ret; TypedArray<Dictionary> ret;
for (const MethodInfo &E : methods) { for (const MethodInfo &E : methods) {
#ifdef DEBUG_METHODS_ENABLED #ifdef DEBUG_METHODS_ENABLED
@ -2254,7 +2255,7 @@ Dictionary Engine::get_author_info() const {
return ::Engine::get_singleton()->get_author_info(); return ::Engine::get_singleton()->get_author_info();
} }
Array Engine::get_copyright_info() const { TypedArray<Dictionary> Engine::get_copyright_info() const {
return ::Engine::get_singleton()->get_copyright_info(); return ::Engine::get_singleton()->get_copyright_info();
} }

View file

@ -45,6 +45,8 @@
#include "core/templates/safe_refcount.h" #include "core/templates/safe_refcount.h"
class MainLoop; class MainLoop;
template <typename T>
class TypedArray;
namespace core_bind { namespace core_bind {
@ -602,15 +604,15 @@ public:
bool has_signal(StringName p_class, StringName p_signal) const; bool has_signal(StringName p_class, StringName p_signal) const;
Dictionary get_signal(StringName p_class, StringName p_signal) const; Dictionary get_signal(StringName p_class, StringName p_signal) const;
Array get_signal_list(StringName p_class, bool p_no_inheritance = false) const; TypedArray<Dictionary> get_signal_list(StringName p_class, bool p_no_inheritance = false) const;
Array get_property_list(StringName p_class, bool p_no_inheritance = false) const; TypedArray<Dictionary> get_property_list(StringName p_class, bool p_no_inheritance = false) const;
Variant get_property(Object *p_object, const StringName &p_property) const; Variant get_property(Object *p_object, const StringName &p_property) const;
Error set_property(Object *p_object, const StringName &p_property, const Variant &p_value) const; Error set_property(Object *p_object, const StringName &p_property, const Variant &p_value) const;
bool has_method(StringName p_class, StringName p_method, bool p_no_inheritance = false) const; bool has_method(StringName p_class, StringName p_method, bool p_no_inheritance = false) const;
Array get_method_list(StringName p_class, bool p_no_inheritance = false) const; TypedArray<Dictionary> get_method_list(StringName p_class, bool p_no_inheritance = false) const;
PackedStringArray get_integer_constant_list(const StringName &p_class, bool p_no_inheritance = false) const; PackedStringArray get_integer_constant_list(const StringName &p_class, bool p_no_inheritance = false) const;
bool has_integer_constant(const StringName &p_class, const StringName &p_name) const; bool has_integer_constant(const StringName &p_class, const StringName &p_name) const;
@ -661,7 +663,7 @@ public:
Dictionary get_version_info() const; Dictionary get_version_info() const;
Dictionary get_author_info() const; Dictionary get_author_info() const;
Array get_copyright_info() const; TypedArray<Dictionary> get_copyright_info() const;
Dictionary get_donor_info() const; Dictionary get_donor_info() const;
Dictionary get_license_info() const; Dictionary get_license_info() const;
String get_license_text() const; String get_license_text() const;

View file

@ -209,8 +209,8 @@ bool AStar3D::has_point(int64_t p_id) const {
return points.has(p_id); return points.has(p_id);
} }
Array AStar3D::get_point_ids() { PackedInt64Array AStar3D::get_point_ids() {
Array point_list; PackedInt64Array point_list;
for (OAHashMap<int64_t, Point *>::Iterator it = points.iter(); it.valid; it = points.next_iter(it)) { for (OAHashMap<int64_t, Point *>::Iterator it = points.iter(); it.valid; it = points.next_iter(it)) {
point_list.push_back(*(it.key)); point_list.push_back(*(it.key));
@ -605,7 +605,7 @@ Vector<int64_t> AStar2D::get_point_connections(int64_t p_id) {
return astar.get_point_connections(p_id); return astar.get_point_connections(p_id);
} }
Array AStar2D::get_point_ids() { PackedInt64Array AStar2D::get_point_ids() {
return astar.get_point_ids(); return astar.get_point_ids();
} }

View file

@ -133,7 +133,7 @@ public:
void remove_point(int64_t p_id); void remove_point(int64_t p_id);
bool has_point(int64_t p_id) const; bool has_point(int64_t p_id) const;
Vector<int64_t> get_point_connections(int64_t p_id); Vector<int64_t> get_point_connections(int64_t p_id);
Array get_point_ids(); PackedInt64Array get_point_ids();
void set_point_disabled(int64_t p_id, bool p_disabled = true); void set_point_disabled(int64_t p_id, bool p_disabled = true);
bool is_point_disabled(int64_t p_id) const; bool is_point_disabled(int64_t p_id) const;
@ -183,7 +183,7 @@ public:
void remove_point(int64_t p_id); void remove_point(int64_t p_id);
bool has_point(int64_t p_id) const; bool has_point(int64_t p_id) const;
Vector<int64_t> get_point_connections(int64_t p_id); Vector<int64_t> get_point_connections(int64_t p_id);
Array get_point_ids(); PackedInt64Array get_point_ids();
void set_point_disabled(int64_t p_id, bool p_disabled = true); void set_point_disabled(int64_t p_id, bool p_disabled = true);
bool is_point_disabled(int64_t p_id) const; bool is_point_disabled(int64_t p_id) const;

View file

@ -218,7 +218,7 @@
</description> </description>
</method> </method>
<method name="get_point_ids"> <method name="get_point_ids">
<return type="Array" /> <return type="PackedInt64Array" />
<description> <description>
Returns an array of all point IDs. Returns an array of all point IDs.
</description> </description>

View file

@ -245,7 +245,7 @@
</description> </description>
</method> </method>
<method name="get_point_ids"> <method name="get_point_ids">
<return type="Array" /> <return type="PackedInt64Array" />
<description> <description>
Returns an array of all point IDs. Returns an array of all point IDs.
</description> </description>

View file

@ -30,7 +30,7 @@
</description> </description>
</method> </method>
<method name="capture_get_device_list"> <method name="capture_get_device_list">
<return type="Array" /> <return type="PackedStringArray" />
<description> <description>
Returns the names of all audio input devices detected on the system. Returns the names of all audio input devices detected on the system.
</description> </description>
@ -117,7 +117,7 @@
</description> </description>
</method> </method>
<method name="get_device_list"> <method name="get_device_list">
<return type="Array" /> <return type="PackedStringArray" />
<description> <description>
Returns the names of all audio devices detected on the system. Returns the names of all audio devices detected on the system.
</description> </description>

View file

@ -58,7 +58,7 @@
</description> </description>
</method> </method>
<method name="opaque_to_polygons" qualifiers="const"> <method name="opaque_to_polygons" qualifiers="const">
<return type="Array" /> <return type="PackedVector2Array[]" />
<param index="0" name="rect" type="Rect2" /> <param index="0" name="rect" type="Rect2" />
<param index="1" name="epsilon" type="float" default="2.0" /> <param index="1" name="epsilon" type="float" default="2.0" />
<description> <description>

View file

@ -11,7 +11,7 @@
</tutorials> </tutorials>
<methods> <methods>
<method name="get_buttons"> <method name="get_buttons">
<return type="Array" /> <return type="BaseButton[]" />
<description> <description>
Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see [member BaseButton.button_group]). Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see [member BaseButton.button_group]).
</description> </description>

View file

@ -37,7 +37,7 @@
</description> </description>
</method> </method>
<method name="get_frustum" qualifiers="const"> <method name="get_frustum" qualifiers="const">
<return type="Array" /> <return type="Plane[]" />
<description> <description>
Returns the camera's frustum planes in world space units as an array of [Plane]s in the following order: near, far, left, top, right, bottom. Not to be confused with [member frustum_offset]. Returns the camera's frustum planes in world space units as an array of [Plane]s in the following order: near, far, left, top, right, bottom. Not to be confused with [member frustum_offset].
</description> </description>

View file

@ -19,7 +19,7 @@
</description> </description>
</method> </method>
<method name="feeds"> <method name="feeds">
<return type="Array" /> <return type="CameraFeed[]" />
<description> <description>
Returns an array of [CameraFeed]s. Returns an array of [CameraFeed]s.
</description> </description>

View file

@ -66,7 +66,7 @@
</description> </description>
</method> </method>
<method name="class_get_method_list" qualifiers="const"> <method name="class_get_method_list" qualifiers="const">
<return type="Array" /> <return type="Dictionary[]" />
<param index="0" name="class" type="StringName" /> <param index="0" name="class" type="StringName" />
<param index="1" name="no_inheritance" type="bool" default="false" /> <param index="1" name="no_inheritance" type="bool" default="false" />
<description> <description>
@ -83,7 +83,7 @@
</description> </description>
</method> </method>
<method name="class_get_property_list" qualifiers="const"> <method name="class_get_property_list" qualifiers="const">
<return type="Array" /> <return type="Dictionary[]" />
<param index="0" name="class" type="StringName" /> <param index="0" name="class" type="StringName" />
<param index="1" name="no_inheritance" type="bool" default="false" /> <param index="1" name="no_inheritance" type="bool" default="false" />
<description> <description>
@ -99,7 +99,7 @@
</description> </description>
</method> </method>
<method name="class_get_signal_list" qualifiers="const"> <method name="class_get_signal_list" qualifiers="const">
<return type="Array" /> <return type="Dictionary[]" />
<param index="0" name="class" type="StringName" /> <param index="0" name="class" type="StringName" />
<param index="1" name="no_inheritance" type="bool" default="false" /> <param index="1" name="no_inheritance" type="bool" default="false" />
<description> <description>

View file

@ -18,7 +18,7 @@
</description> </description>
</method> </method>
<method name="_filter_code_completion_candidates" qualifiers="virtual const"> <method name="_filter_code_completion_candidates" qualifiers="virtual const">
<return type="Array" /> <return type="Dictionary[]" />
<param index="0" name="candidates" type="Dictionary[]" /> <param index="0" name="candidates" type="Dictionary[]" />
<description> <description>
Override this method to define what items in [param candidates] should be displayed. Override this method to define what items in [param candidates] should be displayed.
@ -159,13 +159,13 @@
</description> </description>
</method> </method>
<method name="get_bookmarked_lines" qualifiers="const"> <method name="get_bookmarked_lines" qualifiers="const">
<return type="Array" /> <return type="PackedInt32Array" />
<description> <description>
Gets all bookmarked lines. Gets all bookmarked lines.
</description> </description>
</method> </method>
<method name="get_breakpointed_lines" qualifiers="const"> <method name="get_breakpointed_lines" qualifiers="const">
<return type="Array" /> <return type="PackedInt32Array" />
<description> <description>
Gets all breakpointed lines. Gets all breakpointed lines.
</description> </description>
@ -226,7 +226,7 @@
</description> </description>
</method> </method>
<method name="get_executing_lines" qualifiers="const"> <method name="get_executing_lines" qualifiers="const">
<return type="Array" /> <return type="PackedInt32Array" />
<description> <description>
Gets all executing lines. Gets all executing lines.
</description> </description>

View file

@ -55,7 +55,7 @@
</description> </description>
</method> </method>
<method name="get_shape_owners"> <method name="get_shape_owners">
<return type="Array" /> <return type="PackedInt32Array" />
<description> <description>
Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument. Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument.
</description> </description>

View file

@ -49,7 +49,7 @@
</description> </description>
</method> </method>
<method name="get_shape_owners"> <method name="get_shape_owners">
<return type="Array" /> <return type="PackedInt32Array" />
<description> <description>
Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument. Returns an [Array] of [code]owner_id[/code] identifiers. You can use these ids in other methods that take [code]owner_id[/code] as an argument.
</description> </description>

View file

@ -196,7 +196,7 @@
</description> </description>
</method> </method>
<method name="_structured_text_parser" qualifiers="virtual const"> <method name="_structured_text_parser" qualifiers="virtual const">
<return type="Array" /> <return type="Vector2i[]" />
<param index="0" name="args" type="Array" /> <param index="0" name="args" type="Array" />
<param index="1" name="text" type="String" /> <param index="1" name="text" type="String" />
<description> <description>

View file

@ -105,7 +105,7 @@
</description> </description>
</method> </method>
<method name="get_display_cutouts" qualifiers="const"> <method name="get_display_cutouts" qualifiers="const">
<return type="Array" /> <return type="Rect2[]" />
<description> <description>
Returns an [Array] of [Rect2], each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also [method get_display_safe_area]. Returns an [Array] of [Rect2], each of which is the bounding rectangle for a display cutout or notch. These are non-functional areas on edge-to-edge screens used by cameras and sensors. Returns an empty array if the device does not have cutouts. See also [method get_display_safe_area].
[b]Note:[/b] Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches. [b]Note:[/b] Currently only implemented on Android. Other platforms will return an empty array even if they do have display cutouts or notches.
@ -857,7 +857,7 @@
</description> </description>
</method> </method>
<method name="tts_get_voices" qualifiers="const"> <method name="tts_get_voices" qualifiers="const">
<return type="Array" /> <return type="Dictionary[]" />
<description> <description>
Returns an [Array] of voice information dictionaries. Returns an [Array] of voice information dictionaries.
Each [Dictionary] contains two [String] entries: Each [Dictionary] contains two [String] entries:

View file

@ -115,7 +115,7 @@
</tutorials> </tutorials>
<methods> <methods>
<method name="_get_import_options" qualifiers="virtual const"> <method name="_get_import_options" qualifiers="virtual const">
<return type="Array" /> <return type="Dictionary[]" />
<param index="0" name="path" type="String" /> <param index="0" name="path" type="String" />
<param index="1" name="preset_index" type="int" /> <param index="1" name="preset_index" type="int" />
<description> <description>

View file

@ -101,7 +101,7 @@
</description> </description>
</method> </method>
<method name="get_open_scenes" qualifiers="const"> <method name="get_open_scenes" qualifiers="const">
<return type="Array" /> <return type="PackedStringArray" />
<description> <description>
Returns an [Array] with the file paths of the currently opened scenes. Returns an [Array] with the file paths of the currently opened scenes.
</description> </description>
@ -166,7 +166,7 @@
</description> </description>
</method> </method>
<method name="make_mesh_previews"> <method name="make_mesh_previews">
<return type="Array" /> <return type="Texture2D[]" />
<param index="0" name="meshes" type="Array" /> <param index="0" name="meshes" type="Array" />
<param index="1" name="preview_size" type="int" /> <param index="1" name="preview_size" type="int" />
<description> <description>

View file

@ -31,7 +31,7 @@
</description> </description>
</method> </method>
<method name="get_transformable_selected_nodes"> <method name="get_transformable_selected_nodes">
<return type="Array" /> <return type="Node[]" />
<description> <description>
Gets the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc). This list avoids situations where a node is selected and also child/grandchild. Gets the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc). This list avoids situations where a node is selected and also child/grandchild.
</description> </description>

View file

@ -85,7 +85,7 @@
</description> </description>
</method> </method>
<method name="get_changed_settings" qualifiers="const"> <method name="get_changed_settings" qualifiers="const">
<return type="Array" /> <return type="PackedStringArray" />
<description> <description>
Gets an array of the settings which have been changed since the last save. Note that internally [code]changed_settings[/code] is cleared after a successful save, so generally the most appropriate place to use this method is when processing [constant NOTIFICATION_EDITOR_SETTINGS_CHANGED] Gets an array of the settings which have been changed since the last save. Note that internally [code]changed_settings[/code] is cleared after a successful save, so generally the most appropriate place to use this method is when processing [constant NOTIFICATION_EDITOR_SETTINGS_CHANGED]
</description> </description>

View file

@ -17,7 +17,7 @@
</description> </description>
</method> </method>
<method name="_get_supported_languages" qualifiers="virtual const"> <method name="_get_supported_languages" qualifiers="virtual const">
<return type="Array" /> <return type="PackedStringArray" />
<description> <description>
Virtual method which can be overridden to return the supported language names. Virtual method which can be overridden to return the supported language names.
</description> </description>

View file

@ -17,7 +17,7 @@
</description> </description>
</method> </method>
<method name="get_file_diff"> <method name="get_file_diff">
<return type="Array" /> <return type="Dictionary[]" />
<param index="0" name="file_path" type="String" /> <param index="0" name="file_path" type="String" />
<description> <description>
Returns an [Array] of [Dictionary] objects containing the diff output from the VCS in use, if a VCS addon is initialized, else returns an empty [Array] object. The diff contents also consist of some contextual lines which provide context to the observed line change in the file. Returns an [Array] of [Dictionary] objects containing the diff output from the VCS in use, if a VCS addon is initialized, else returns an empty [Array] object. The diff contents also consist of some contextual lines which provide context to the observed line change in the file.

View file

@ -34,7 +34,7 @@
</description> </description>
</method> </method>
<method name="get_copyright_info" qualifiers="const"> <method name="get_copyright_info" qualifiers="const">
<return type="Array" /> <return type="Dictionary[]" />
<description> <description>
Returns an Array of copyright information Dictionaries. Returns an Array of copyright information Dictionaries.
[code]name[/code] - String, component name [code]name[/code] - String, component name

View file

@ -146,7 +146,7 @@
</description> </description>
</method> </method>
<method name="get_glyph_list" qualifiers="const"> <method name="get_glyph_list" qualifiers="const">
<return type="Array" /> <return type="PackedInt32Array" />
<param index="0" name="cache_index" type="int" /> <param index="0" name="cache_index" type="int" />
<param index="1" name="size" type="Vector2i" /> <param index="1" name="size" type="Vector2i" />
<description> <description>
@ -199,7 +199,7 @@
</description> </description>
</method> </method>
<method name="get_kerning_list" qualifiers="const"> <method name="get_kerning_list" qualifiers="const">
<return type="Array" /> <return type="Vector2i[]" />
<param index="0" name="cache_index" type="int" /> <param index="0" name="cache_index" type="int" />
<param index="1" name="size" type="int" /> <param index="1" name="size" type="int" />
<description> <description>
@ -233,7 +233,7 @@
</description> </description>
</method> </method>
<method name="get_size_cache_list" qualifiers="const"> <method name="get_size_cache_list" qualifiers="const">
<return type="Array" /> <return type="Vector2i[]" />
<param index="0" name="cache_index" type="int" /> <param index="0" name="cache_index" type="int" />
<description> <description>
Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size.

View file

@ -188,7 +188,7 @@
</description> </description>
</method> </method>
<method name="font_get_glyph_list" qualifiers="const"> <method name="font_get_glyph_list" qualifiers="const">
<return type="Array" /> <return type="PackedInt32Array" />
<param index="0" name="font_rid" type="RID" /> <param index="0" name="font_rid" type="RID" />
<param index="1" name="size" type="Vector2i" /> <param index="1" name="size" type="Vector2i" />
<description> <description>
@ -268,7 +268,7 @@
</description> </description>
</method> </method>
<method name="font_get_kerning_list" qualifiers="const"> <method name="font_get_kerning_list" qualifiers="const">
<return type="Array" /> <return type="Vector2i[]" />
<param index="0" name="font_rid" type="RID" /> <param index="0" name="font_rid" type="RID" />
<param index="1" name="size" type="int" /> <param index="1" name="size" type="int" />
<description> <description>
@ -349,7 +349,7 @@
</description> </description>
</method> </method>
<method name="font_get_size_cache_list" qualifiers="const"> <method name="font_get_size_cache_list" qualifiers="const">
<return type="Array" /> <return type="Vector2i[]" />
<param index="0" name="font_rid" type="RID" /> <param index="0" name="font_rid" type="RID" />
<description> <description>
Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size.
@ -993,7 +993,7 @@
</description> </description>
</method> </method>
<method name="parse_structured_text" qualifiers="const"> <method name="parse_structured_text" qualifiers="const">
<return type="Array" /> <return type="Vector2i[]" />
<param index="0" name="parser_type" type="int" enum="TextServer.StructuredTextParser" /> <param index="0" name="parser_type" type="int" enum="TextServer.StructuredTextParser" />
<param index="1" name="args" type="Array" /> <param index="1" name="args" type="Array" />
<param index="2" name="text" type="String" /> <param index="2" name="text" type="String" />

View file

@ -180,7 +180,7 @@
</description> </description>
</method> </method>
<method name="font_get_glyph_list" qualifiers="virtual const"> <method name="font_get_glyph_list" qualifiers="virtual const">
<return type="Array" /> <return type="PackedInt32Array" />
<param index="0" name="font_rid" type="RID" /> <param index="0" name="font_rid" type="RID" />
<param index="1" name="size" type="Vector2i" /> <param index="1" name="size" type="Vector2i" />
<description> <description>
@ -258,7 +258,7 @@
</description> </description>
</method> </method>
<method name="font_get_kerning_list" qualifiers="virtual const"> <method name="font_get_kerning_list" qualifiers="virtual const">
<return type="Array" /> <return type="Vector2i[]" />
<param index="0" name="font_rid" type="RID" /> <param index="0" name="font_rid" type="RID" />
<param index="1" name="size" type="int" /> <param index="1" name="size" type="int" />
<description> <description>
@ -339,7 +339,7 @@
</description> </description>
</method> </method>
<method name="font_get_size_cache_list" qualifiers="virtual const"> <method name="font_get_size_cache_list" qualifiers="virtual const">
<return type="Array" /> <return type="Vector2i[]" />
<param index="0" name="font_rid" type="RID" /> <param index="0" name="font_rid" type="RID" />
<description> <description>
Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size.

View file

@ -50,7 +50,7 @@ Error AudioDriverALSA::init_device() {
// If there is a specified device check that it is really present // If there is a specified device check that it is really present
if (device_name != "Default") { if (device_name != "Default") {
Array list = get_device_list(); PackedStringArray list = get_device_list();
if (list.find(device_name) == -1) { if (list.find(device_name) == -1) {
device_name = "Default"; device_name = "Default";
new_device = "Default"; new_device = "Default";
@ -266,8 +266,8 @@ AudioDriver::SpeakerMode AudioDriverALSA::get_speaker_mode() const {
return speaker_mode; return speaker_mode;
} }
Array AudioDriverALSA::get_device_list() { PackedStringArray AudioDriverALSA::get_device_list() {
Array list; PackedStringArray list;
list.push_back("Default"); list.push_back("Default");

View file

@ -77,7 +77,7 @@ public:
virtual void start(); virtual void start();
virtual int get_mix_rate() const; virtual int get_mix_rate() const;
virtual SpeakerMode get_speaker_mode() const; virtual SpeakerMode get_speaker_mode() const;
virtual Array get_device_list(); virtual PackedStringArray get_device_list();
virtual String get_device(); virtual String get_device();
virtual void set_device(String device); virtual void set_device(String device);
virtual void lock(); virtual void lock();

View file

@ -493,8 +493,8 @@ Error AudioDriverCoreAudio::capture_stop() {
#ifdef MACOS_ENABLED #ifdef MACOS_ENABLED
Array AudioDriverCoreAudio::_get_device_list(bool capture) { PackedStringArray AudioDriverCoreAudio::_get_device_list(bool capture) {
Array list; PackedStringArray list;
list.push_back("Default"); list.push_back("Default");
@ -637,7 +637,7 @@ void AudioDriverCoreAudio::_set_device(const String &device, bool capture) {
} }
} }
Array AudioDriverCoreAudio::get_device_list() { PackedStringArray AudioDriverCoreAudio::get_device_list() {
return _get_device_list(); return _get_device_list();
} }
@ -659,7 +659,7 @@ void AudioDriverCoreAudio::capture_set_device(const String &p_name) {
} }
} }
Array AudioDriverCoreAudio::capture_get_device_list() { PackedStringArray AudioDriverCoreAudio::capture_get_device_list() {
return _get_device_list(true); return _get_device_list(true);
} }

View file

@ -59,7 +59,7 @@ class AudioDriverCoreAudio : public AudioDriver {
Vector<int16_t> input_buf; Vector<int16_t> input_buf;
#ifdef MACOS_ENABLED #ifdef MACOS_ENABLED
Array _get_device_list(bool capture = false); PackedStringArray _get_device_list(bool capture = false);
void _set_device(const String &device, bool capture = false); void _set_device(const String &device, bool capture = false);
static OSStatus input_device_address_cb(AudioObjectID inObjectID, static OSStatus input_device_address_cb(AudioObjectID inObjectID,
@ -107,11 +107,11 @@ public:
void stop(); void stop();
#ifdef MACOS_ENABLED #ifdef MACOS_ENABLED
virtual Array get_device_list(); virtual PackedStringArray get_device_list();
virtual String get_device(); virtual String get_device();
virtual void set_device(String device); virtual void set_device(String device);
virtual Array capture_get_device_list(); virtual PackedStringArray capture_get_device_list();
virtual void capture_set_device(const String &p_name); virtual void capture_set_device(const String &p_name);
virtual String capture_get_device(); virtual String capture_get_device();
#endif #endif

View file

@ -178,7 +178,7 @@ Error AudioDriverPulseAudio::detect_channels(bool capture) {
Error AudioDriverPulseAudio::init_device() { Error AudioDriverPulseAudio::init_device() {
// If there is a specified device check that it is really present // If there is a specified device check that it is really present
if (device_name != "Default") { if (device_name != "Default") {
Array list = get_device_list(); PackedStringArray list = get_device_list();
if (list.find(device_name) == -1) { if (list.find(device_name) == -1) {
device_name = "Default"; device_name = "Default";
new_device = "Default"; new_device = "Default";
@ -599,7 +599,7 @@ void AudioDriverPulseAudio::pa_sinklist_cb(pa_context *c, const pa_sink_info *l,
ad->pa_status++; ad->pa_status++;
} }
Array AudioDriverPulseAudio::get_device_list() { PackedStringArray AudioDriverPulseAudio::get_device_list() {
pa_devices.clear(); pa_devices.clear();
pa_devices.push_back("Default"); pa_devices.push_back("Default");
@ -681,7 +681,7 @@ void AudioDriverPulseAudio::finish() {
Error AudioDriverPulseAudio::capture_init_device() { Error AudioDriverPulseAudio::capture_init_device() {
// If there is a specified device check that it is really present // If there is a specified device check that it is really present
if (capture_device_name != "Default") { if (capture_device_name != "Default") {
Array list = capture_get_device_list(); PackedStringArray list = capture_get_device_list();
if (list.find(capture_device_name) == -1) { if (list.find(capture_device_name) == -1) {
capture_device_name = "Default"; capture_device_name = "Default";
capture_new_device = "Default"; capture_new_device = "Default";
@ -785,7 +785,7 @@ void AudioDriverPulseAudio::pa_sourcelist_cb(pa_context *c, const pa_source_info
ad->pa_status++; ad->pa_status++;
} }
Array AudioDriverPulseAudio::capture_get_device_list() { PackedStringArray AudioDriverPulseAudio::capture_get_device_list() {
pa_rec_devices.clear(); pa_rec_devices.clear();
pa_rec_devices.push_back("Default"); pa_rec_devices.push_back("Default");

View file

@ -67,8 +67,8 @@ class AudioDriverPulseAudio : public AudioDriver {
int channels = 0; int channels = 0;
int pa_ready = 0; int pa_ready = 0;
int pa_status = 0; int pa_status = 0;
Array pa_devices; PackedStringArray pa_devices;
Array pa_rec_devices; PackedStringArray pa_rec_devices;
bool active = false; bool active = false;
bool thread_exited = false; bool thread_exited = false;
@ -103,11 +103,11 @@ public:
virtual int get_mix_rate() const; virtual int get_mix_rate() const;
virtual SpeakerMode get_speaker_mode() const; virtual SpeakerMode get_speaker_mode() const;
virtual Array get_device_list(); virtual PackedStringArray get_device_list();
virtual String get_device(); virtual String get_device();
virtual void set_device(String device); virtual void set_device(String device);
virtual Array capture_get_device_list(); virtual PackedStringArray capture_get_device_list();
virtual void capture_set_device(const String &p_name); virtual void capture_set_device(const String &p_name);
virtual String capture_get_device(); virtual String capture_get_device();

View file

@ -553,8 +553,8 @@ AudioDriver::SpeakerMode AudioDriverWASAPI::get_speaker_mode() const {
return get_speaker_mode_by_total_channels(channels); return get_speaker_mode_by_total_channels(channels);
} }
Array AudioDriverWASAPI::audio_device_get_list(bool p_capture) { PackedStringArray AudioDriverWASAPI::audio_device_get_list(bool p_capture) {
Array list; PackedStringArray list;
IMMDeviceCollection *devices = nullptr; IMMDeviceCollection *devices = nullptr;
IMMDeviceEnumerator *enumerator = nullptr; IMMDeviceEnumerator *enumerator = nullptr;
@ -563,14 +563,14 @@ Array AudioDriverWASAPI::audio_device_get_list(bool p_capture) {
CoInitialize(nullptr); CoInitialize(nullptr);
HRESULT hr = CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void **)&enumerator); HRESULT hr = CoCreateInstance(CLSID_MMDeviceEnumerator, nullptr, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void **)&enumerator);
ERR_FAIL_COND_V(hr != S_OK, Array()); ERR_FAIL_COND_V(hr != S_OK, PackedStringArray());
hr = enumerator->EnumAudioEndpoints(p_capture ? eCapture : eRender, DEVICE_STATE_ACTIVE, &devices); hr = enumerator->EnumAudioEndpoints(p_capture ? eCapture : eRender, DEVICE_STATE_ACTIVE, &devices);
ERR_FAIL_COND_V(hr != S_OK, Array()); ERR_FAIL_COND_V(hr != S_OK, PackedStringArray());
UINT count = 0; UINT count = 0;
hr = devices->GetCount(&count); hr = devices->GetCount(&count);
ERR_FAIL_COND_V(hr != S_OK, Array()); ERR_FAIL_COND_V(hr != S_OK, PackedStringArray());
for (ULONG i = 0; i < count; i++) { for (ULONG i = 0; i < count; i++) {
IMMDevice *device = nullptr; IMMDevice *device = nullptr;
@ -600,7 +600,7 @@ Array AudioDriverWASAPI::audio_device_get_list(bool p_capture) {
return list; return list;
} }
Array AudioDriverWASAPI::get_device_list() { PackedStringArray AudioDriverWASAPI::get_device_list() {
return audio_device_get_list(false); return audio_device_get_list(false);
} }
@ -950,7 +950,7 @@ void AudioDriverWASAPI::capture_set_device(const String &p_name) {
unlock(); unlock();
} }
Array AudioDriverWASAPI::capture_get_device_list() { PackedStringArray AudioDriverWASAPI::capture_get_device_list() {
return audio_device_get_list(true); return audio_device_get_list(true);
} }

View file

@ -91,7 +91,7 @@ class AudioDriverWASAPI : public AudioDriver {
Error audio_device_init(AudioDeviceWASAPI *p_device, bool p_capture, bool reinit); Error audio_device_init(AudioDeviceWASAPI *p_device, bool p_capture, bool reinit);
Error audio_device_finish(AudioDeviceWASAPI *p_device); Error audio_device_finish(AudioDeviceWASAPI *p_device);
Array audio_device_get_list(bool p_capture); PackedStringArray audio_device_get_list(bool p_capture);
public: public:
virtual const char *get_name() const { virtual const char *get_name() const {
@ -103,7 +103,7 @@ public:
virtual int get_mix_rate() const; virtual int get_mix_rate() const;
virtual float get_latency(); virtual float get_latency();
virtual SpeakerMode get_speaker_mode() const; virtual SpeakerMode get_speaker_mode() const;
virtual Array get_device_list(); virtual PackedStringArray get_device_list();
virtual String get_device(); virtual String get_device();
virtual void set_device(String device); virtual void set_device(String device);
virtual void lock(); virtual void lock();
@ -112,7 +112,7 @@ public:
virtual Error capture_start(); virtual Error capture_start();
virtual Error capture_stop(); virtual Error capture_stop();
virtual Array capture_get_device_list(); virtual PackedStringArray capture_get_device_list();
virtual void capture_set_device(const String &p_name); virtual void capture_set_device(const String &p_name);
virtual String capture_get_device(); virtual String capture_get_device();

View file

@ -1789,7 +1789,7 @@ void CodeTextEditor::toggle_bookmark() {
} }
void CodeTextEditor::goto_next_bookmark() { void CodeTextEditor::goto_next_bookmark() {
Array bmarks = text_editor->get_bookmarked_lines(); PackedInt32Array bmarks = text_editor->get_bookmarked_lines();
if (bmarks.size() <= 0) { if (bmarks.size() <= 0) {
return; return;
} }
@ -1813,7 +1813,7 @@ void CodeTextEditor::goto_next_bookmark() {
} }
void CodeTextEditor::goto_prev_bookmark() { void CodeTextEditor::goto_prev_bookmark() {
Array bmarks = text_editor->get_bookmarked_lines(); PackedInt32Array bmarks = text_editor->get_bookmarked_lines();
if (bmarks.size() <= 0) { if (bmarks.size() <= 0) {
return; return;
} }

View file

@ -1143,8 +1143,8 @@ void EditorSelection::_emit_change() {
emitted = false; emitted = false;
} }
Array EditorSelection::_get_transformable_selected_nodes() { TypedArray<Node> EditorSelection::_get_transformable_selected_nodes() {
Array ret; TypedArray<Node> ret;
for (const Node *E : selected_node_list) { for (const Node *E : selected_node_list) {
ret.push_back(E); ret.push_back(E);

View file

@ -271,7 +271,7 @@ class EditorSelection : public Object {
List<Node *> selected_node_list; List<Node *> selected_node_list;
void _update_node_list(); void _update_node_list();
Array _get_transformable_selected_nodes(); TypedArray<Node> _get_transformable_selected_nodes();
void _emit_change(); void _emit_change();
protected: protected:

View file

@ -48,7 +48,7 @@
#include "scene/gui/popup_menu.h" #include "scene/gui/popup_menu.h"
#include "servers/rendering_server.h" #include "servers/rendering_server.h"
Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_size) { TypedArray<Texture2D> EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_size) {
Vector<Ref<Mesh>> meshes; Vector<Ref<Mesh>> meshes;
for (int i = 0; i < p_meshes.size(); i++) { for (int i = 0; i < p_meshes.size(); i++) {
@ -56,7 +56,7 @@ Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_
} }
Vector<Ref<Texture2D>> textures = make_mesh_previews(meshes, nullptr, p_preview_size); Vector<Ref<Texture2D>> textures = make_mesh_previews(meshes, nullptr, p_preview_size);
Array ret; TypedArray<Texture2D> ret;
for (int i = 0; i < textures.size(); i++) { for (int i = 0; i < textures.size(); i++) {
ret.push_back(textures[i]); ret.push_back(textures[i]);
} }
@ -216,8 +216,8 @@ Node *EditorInterface::get_edited_scene_root() {
return EditorNode::get_singleton()->get_edited_scene(); return EditorNode::get_singleton()->get_edited_scene();
} }
Array EditorInterface::get_open_scenes() const { PackedStringArray EditorInterface::get_open_scenes() const {
Array ret; PackedStringArray ret;
Vector<EditorData::EditedScene> scenes = EditorNode::get_editor_data().get_edited_scenes(); Vector<EditorData::EditedScene> scenes = EditorNode::get_editor_data().get_edited_scenes();
int scns_amount = scenes.size(); int scns_amount = scenes.size();

View file

@ -67,7 +67,7 @@ protected:
static void _bind_methods(); static void _bind_methods();
static EditorInterface *singleton; static EditorInterface *singleton;
Array _make_mesh_previews(const Array &p_meshes, int p_preview_size); TypedArray<Texture2D> _make_mesh_previews(const Array &p_meshes, int p_preview_size);
public: public:
static EditorInterface *get_singleton() { return singleton; } static EditorInterface *get_singleton() { return singleton; }
@ -87,7 +87,7 @@ public:
String get_playing_scene() const; String get_playing_scene() const;
Node *get_edited_scene_root(); Node *get_edited_scene_root();
Array get_open_scenes() const; PackedStringArray get_open_scenes() const;
ScriptEditor *get_script_editor(); ScriptEditor *get_script_editor();
EditorCommandPalette *get_command_palette() const; EditorCommandPalette *get_command_palette() const;

View file

@ -963,8 +963,8 @@ void EditorSettings::save() {
} }
} }
Array EditorSettings::get_changed_settings() const { PackedStringArray EditorSettings::get_changed_settings() const {
Array arr; PackedStringArray arr;
for (const String &setting : changed_settings) { for (const String &setting : changed_settings) {
arr.push_back(setting); arr.push_back(setting);
} }

View file

@ -141,7 +141,7 @@ public:
} }
} }
void add_property_hint(const PropertyInfo &p_hint); void add_property_hint(const PropertyInfo &p_hint);
Array get_changed_settings() const; PackedStringArray get_changed_settings() const;
bool check_changed_settings_in_group(const String &p_setting_prefix) const; bool check_changed_settings_in_group(const String &p_setting_prefix) const;
void mark_setting_changed(const String &p_setting); void mark_setting_changed(const String &p_setting);

View file

@ -82,8 +82,8 @@ void EditorVCSInterface::_unstage_file(String p_file_path) {
void EditorVCSInterface::_commit(String p_msg) { void EditorVCSInterface::_commit(String p_msg) {
} }
Array EditorVCSInterface::_get_file_diff(String p_file_path) { TypedArray<Dictionary> EditorVCSInterface::_get_file_diff(String p_file_path) {
return Array(); return TypedArray<Dictionary>();
} }
bool EditorVCSInterface::_shut_down() { bool EditorVCSInterface::_shut_down() {
@ -133,11 +133,11 @@ void EditorVCSInterface::commit(String p_msg) {
} }
} }
Array EditorVCSInterface::get_file_diff(String p_file_path) { TypedArray<Dictionary> EditorVCSInterface::get_file_diff(String p_file_path) {
if (is_addon_ready()) { if (is_addon_ready()) {
return call("_get_file_diff", p_file_path); return call("_get_file_diff", p_file_path);
} }
return Array(); return TypedArray<Dictionary>();
} }
bool EditorVCSInterface::shut_down() { bool EditorVCSInterface::shut_down() {

View file

@ -52,7 +52,7 @@ protected:
virtual void _stage_file(String p_file_path); virtual void _stage_file(String p_file_path);
virtual void _unstage_file(String p_file_path); virtual void _unstage_file(String p_file_path);
virtual void _commit(String p_msg); virtual void _commit(String p_msg);
virtual Array _get_file_diff(String p_file_path); virtual TypedArray<Dictionary> _get_file_diff(String p_file_path);
virtual bool _shut_down(); virtual bool _shut_down();
virtual String _get_project_name(); virtual String _get_project_name();
virtual String _get_vcs_name(); virtual String _get_vcs_name();
@ -76,7 +76,7 @@ public:
void stage_file(String p_file_path); void stage_file(String p_file_path);
void unstage_file(String p_file_path); void unstage_file(String p_file_path);
void commit(String p_msg); void commit(String p_msg);
Array get_file_diff(String p_file_path); TypedArray<Dictionary> get_file_diff(String p_file_path);
bool shut_down(); bool shut_down();
String get_project_name(); String get_project_name();
String get_vcs_name(); String get_vcs_name();

View file

@ -115,7 +115,7 @@ void EditorImportPlugin::get_import_options(const String &p_path, List<ResourceI
Array needed; Array needed;
needed.push_back("name"); needed.push_back("name");
needed.push_back("default_value"); needed.push_back("default_value");
Array options; TypedArray<Dictionary> options;
if (GDVIRTUAL_CALL(_get_import_options, p_path, p_preset, options)) { if (GDVIRTUAL_CALL(_get_import_options, p_path, p_preset, options)) {
for (int i = 0; i < options.size(); i++) { for (int i = 0; i < options.size(); i++) {
Dictionary d = options[i]; Dictionary d = options[i];

View file

@ -32,6 +32,7 @@
#define EDITOR_IMPORT_PLUGIN_H #define EDITOR_IMPORT_PLUGIN_H
#include "core/io/resource_importer.h" #include "core/io/resource_importer.h"
#include "core/variant/typed_array.h"
class EditorImportPlugin : public ResourceImporter { class EditorImportPlugin : public ResourceImporter {
GDCLASS(EditorImportPlugin, ResourceImporter); GDCLASS(EditorImportPlugin, ResourceImporter);
@ -44,7 +45,7 @@ protected:
GDVIRTUAL0RC(int, _get_preset_count) GDVIRTUAL0RC(int, _get_preset_count)
GDVIRTUAL1RC(String, _get_preset_name, int) GDVIRTUAL1RC(String, _get_preset_name, int)
GDVIRTUAL0RC(Vector<String>, _get_recognized_extensions) GDVIRTUAL0RC(Vector<String>, _get_recognized_extensions)
GDVIRTUAL2RC(Array, _get_import_options, String, int) GDVIRTUAL2RC(TypedArray<Dictionary>, _get_import_options, String, int)
GDVIRTUAL0RC(String, _get_save_extension) GDVIRTUAL0RC(String, _get_save_extension)
GDVIRTUAL0RC(String, _get_resource_type) GDVIRTUAL0RC(String, _get_resource_type)
GDVIRTUAL0RC(float, _get_priority) GDVIRTUAL0RC(float, _get_priority)

View file

@ -66,12 +66,12 @@ String EditorSyntaxHighlighter::_get_name() const {
return "Unnamed"; return "Unnamed";
} }
Array EditorSyntaxHighlighter::_get_supported_languages() const { PackedStringArray EditorSyntaxHighlighter::_get_supported_languages() const {
Array ret; PackedStringArray ret;
if (GDVIRTUAL_CALL(_get_supported_languages, ret)) { if (GDVIRTUAL_CALL(_get_supported_languages, ret)) {
return ret; return ret;
} }
return Array(); return PackedStringArray();
} }
Ref<EditorSyntaxHighlighter> EditorSyntaxHighlighter::_create() const { Ref<EditorSyntaxHighlighter> EditorSyntaxHighlighter::_create() const {
@ -1732,7 +1732,7 @@ void ScriptEditor::get_breakpoints(List<String> *p_breakpoints) {
continue; continue;
} }
Array bpoints = se->get_breakpoints(); PackedInt32Array bpoints = se->get_breakpoints();
for (int j = 0; j < bpoints.size(); j++) { for (int j = 0; j < bpoints.size(); j++) {
p_breakpoints->push_back(base + ":" + itos((int)bpoints[j] + 1)); p_breakpoints->push_back(base + ":" + itos((int)bpoints[j] + 1));
} }
@ -2380,8 +2380,8 @@ bool ScriptEditor::edit(const Ref<Resource> &p_resource, int p_line, int p_col,
se->add_syntax_highlighter(highlighter); se->add_syntax_highlighter(highlighter);
if (script != nullptr && !highlighter_set) { if (script != nullptr && !highlighter_set) {
Array languages = highlighter->_get_supported_languages(); PackedStringArray languages = highlighter->_get_supported_languages();
if (languages.find(script->get_language()->get_name()) > -1) { if (languages.has(script->get_language()->get_name())) {
se->set_syntax_highlighter(highlighter); se->set_syntax_highlighter(highlighter);
highlighter_set = true; highlighter_set = true;
} }

View file

@ -59,11 +59,11 @@ protected:
static void _bind_methods(); static void _bind_methods();
GDVIRTUAL0RC(String, _get_name) GDVIRTUAL0RC(String, _get_name)
GDVIRTUAL0RC(Array, _get_supported_languages) GDVIRTUAL0RC(PackedStringArray, _get_supported_languages)
public: public:
virtual String _get_name() const; virtual String _get_name() const;
virtual Array _get_supported_languages() const; virtual PackedStringArray _get_supported_languages() const;
void _set_edited_resource(const Ref<Resource> &p_res) { edited_resourse = p_res; } void _set_edited_resource(const Ref<Resource> &p_res) { edited_resourse = p_res; }
Ref<RefCounted> _get_edited_resource() { return edited_resourse; } Ref<RefCounted> _get_edited_resource() { return edited_resourse; }
@ -156,7 +156,7 @@ public:
virtual void ensure_focus() = 0; virtual void ensure_focus() = 0;
virtual void tag_saved_version() = 0; virtual void tag_saved_version() = 0;
virtual void reload(bool p_soft) {} virtual void reload(bool p_soft) {}
virtual Array get_breakpoints() = 0; virtual PackedInt32Array get_breakpoints() = 0;
virtual void set_breakpoint(int p_line, bool p_enabled) = 0; virtual void set_breakpoint(int p_line, bool p_enabled) = 0;
virtual void clear_breakpoints() = 0; virtual void clear_breakpoints() = 0;
virtual void add_callback(const String &p_function, PackedStringArray p_args) = 0; virtual void add_callback(const String &p_function, PackedStringArray p_args) = 0;

View file

@ -596,7 +596,7 @@ void ScriptTextEditor::_update_bookmark_list() {
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT); bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT);
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV); bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines(); PackedInt32Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines();
if (bookmark_list.size() == 0) { if (bookmark_list.size() == 0) {
return; return;
} }
@ -751,7 +751,7 @@ void ScriptTextEditor::_update_breakpoint_list() {
breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_breakpoint"), DEBUG_GOTO_NEXT_BREAKPOINT); breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_breakpoint"), DEBUG_GOTO_NEXT_BREAKPOINT);
breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_breakpoint"), DEBUG_GOTO_PREV_BREAKPOINT); breakpoints_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_breakpoint"), DEBUG_GOTO_PREV_BREAKPOINT);
Array breakpoint_list = code_editor->get_text_editor()->get_breakpointed_lines(); PackedInt32Array breakpoint_list = code_editor->get_text_editor()->get_breakpointed_lines();
if (breakpoint_list.size() == 0) { if (breakpoint_list.size() == 0) {
return; return;
} }
@ -1264,7 +1264,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
EditorDebuggerNode::get_singleton()->set_breakpoint(script->get_path(), line + 1, dobreak); EditorDebuggerNode::get_singleton()->set_breakpoint(script->get_path(), line + 1, dobreak);
} break; } break;
case DEBUG_REMOVE_ALL_BREAKPOINTS: { case DEBUG_REMOVE_ALL_BREAKPOINTS: {
Array bpoints = tx->get_breakpointed_lines(); PackedInt32Array bpoints = tx->get_breakpointed_lines();
for (int i = 0; i < bpoints.size(); i++) { for (int i = 0; i < bpoints.size(); i++) {
int line = bpoints[i]; int line = bpoints[i];
@ -1274,7 +1274,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
} }
} break; } break;
case DEBUG_GOTO_NEXT_BREAKPOINT: { case DEBUG_GOTO_NEXT_BREAKPOINT: {
Array bpoints = tx->get_breakpointed_lines(); PackedInt32Array bpoints = tx->get_breakpointed_lines();
if (bpoints.size() <= 0) { if (bpoints.size() <= 0) {
return; return;
} }
@ -1300,7 +1300,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
} break; } break;
case DEBUG_GOTO_PREV_BREAKPOINT: { case DEBUG_GOTO_PREV_BREAKPOINT: {
Array bpoints = tx->get_breakpointed_lines(); PackedInt32Array bpoints = tx->get_breakpointed_lines();
if (bpoints.size() <= 0) { if (bpoints.size() <= 0) {
return; return;
} }
@ -1441,7 +1441,7 @@ void ScriptTextEditor::reload(bool p_soft) {
scr->get_language()->reload_tool_script(scr, soft); scr->get_language()->reload_tool_script(scr, soft);
} }
Array ScriptTextEditor::get_breakpoints() { PackedInt32Array ScriptTextEditor::get_breakpoints() {
return code_editor->get_text_editor()->get_breakpointed_lines(); return code_editor->get_text_editor()->get_breakpointed_lines();
} }

View file

@ -229,7 +229,7 @@ public:
virtual void clear_executing_line() override; virtual void clear_executing_line() override;
virtual void reload(bool p_soft) override; virtual void reload(bool p_soft) override;
virtual Array get_breakpoints() override; virtual PackedInt32Array get_breakpoints() override;
virtual void set_breakpoint(int p_line, bool p_enabled) override; virtual void set_breakpoint(int p_line, bool p_enabled) override;
virtual void clear_breakpoints() override; virtual void clear_breakpoints() override;

View file

@ -994,7 +994,7 @@ void ShaderEditor::_update_bookmark_list() {
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT); bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT);
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV); bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
Array bookmark_list = shader_editor->get_text_editor()->get_bookmarked_lines(); PackedInt32Array bookmark_list = shader_editor->get_text_editor()->get_bookmarked_lines();
if (bookmark_list.size() == 0) { if (bookmark_list.size() == 0) {
return; return;
} }

View file

@ -128,8 +128,8 @@ Control *TextEditor::get_base_editor() const {
return code_editor->get_text_editor(); return code_editor->get_text_editor();
} }
Array TextEditor::get_breakpoints() { PackedInt32Array TextEditor::get_breakpoints() {
return Array(); return PackedInt32Array();
} }
void TextEditor::reload_text() { void TextEditor::reload_text() {
@ -165,7 +165,7 @@ void TextEditor::_update_bookmark_list() {
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT); bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_next_bookmark"), BOOKMARK_GOTO_NEXT);
bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV); bookmarks_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/goto_previous_bookmark"), BOOKMARK_GOTO_PREV);
Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines(); PackedInt32Array bookmark_list = code_editor->get_text_editor()->get_bookmarked_lines();
if (bookmark_list.size() == 0) { if (bookmark_list.size() == 0) {
return; return;
} }

View file

@ -118,7 +118,7 @@ public:
virtual Variant get_edit_state() override; virtual Variant get_edit_state() override;
virtual void set_edit_state(const Variant &p_state) override; virtual void set_edit_state(const Variant &p_state) override;
virtual Vector<String> get_functions() override; virtual Vector<String> get_functions() override;
virtual Array get_breakpoints() override; virtual PackedInt32Array get_breakpoints() override;
virtual void set_breakpoint(int p_line, bool p_enabled) override{}; virtual void set_breakpoint(int p_line, bool p_enabled) override{};
virtual void clear_breakpoints() override{}; virtual void clear_breakpoints() override{};
virtual void goto_line(int p_line, bool p_with_error = false) override; virtual void goto_line(int p_line, bool p_with_error = false) override;

View file

@ -242,7 +242,7 @@ void VersionControlEditorPlugin::_view_file_diff() {
} }
void VersionControlEditorPlugin::_display_file_diff(String p_file_path) { void VersionControlEditorPlugin::_display_file_diff(String p_file_path) {
Array diff_content = EditorVCSInterface::get_singleton()->get_file_diff(p_file_path); TypedArray<Dictionary> diff_content = EditorVCSInterface::get_singleton()->get_file_diff(p_file_path);
diff_file_name->set_text(p_file_path); diff_file_name->set_text(p_file_path);

View file

@ -526,8 +526,8 @@ String GDScriptSyntaxHighlighter::_get_name() const {
return "GDScript"; return "GDScript";
} }
Array GDScriptSyntaxHighlighter::_get_supported_languages() const { PackedStringArray GDScriptSyntaxHighlighter::_get_supported_languages() const {
Array languages; PackedStringArray languages;
languages.push_back("GDScript"); languages.push_back("GDScript");
return languages; return languages;
} }

View file

@ -88,7 +88,7 @@ public:
virtual Dictionary _get_line_syntax_highlighting_impl(int p_line) override; virtual Dictionary _get_line_syntax_highlighting_impl(int p_line) override;
virtual String _get_name() const override; virtual String _get_name() const override;
virtual Array _get_supported_languages() const override; virtual PackedStringArray _get_supported_languages() const override;
virtual Ref<EditorSyntaxHighlighter> _create() const override; virtual Ref<EditorSyntaxHighlighter> _create() const override;
}; };

View file

@ -76,7 +76,7 @@
</description> </description>
</method> </method>
<method name="get_names" qualifiers="const"> <method name="get_names" qualifiers="const">
<return type="Array" /> <return type="PackedStringArray" />
<description> <description>
Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance. Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance.
</description> </description>

View file

@ -351,8 +351,8 @@ int RegEx::get_group_count() const {
return count; return count;
} }
Array RegEx::get_names() const { PackedStringArray RegEx::get_names() const {
Array result; PackedStringArray result;
ERR_FAIL_COND_V(!is_valid(), result); ERR_FAIL_COND_V(!is_valid(), result);

View file

@ -94,7 +94,7 @@ public:
bool is_valid() const; bool is_valid() const;
String get_pattern() const; String get_pattern() const;
int get_group_count() const; int get_group_count() const;
Array get_names() const; PackedStringArray get_names() const;
RegEx(); RegEx();
RegEx(const String &p_pattern); RegEx(const String &p_pattern);

View file

@ -46,7 +46,7 @@ TEST_CASE("[RegEx] Initialization") {
CHECK(re1.get_pattern() == pattern); CHECK(re1.get_pattern() == pattern);
CHECK(re1.get_group_count() == 1); CHECK(re1.get_group_count() == 1);
Array names = re1.get_names(); PackedStringArray names = re1.get_names();
CHECK(names.size() == 1); CHECK(names.size() == 1);
CHECK(names[0] == "vowel"); CHECK(names[0] == "vowel");

View file

@ -2170,12 +2170,12 @@ double TextServerAdvanced::font_get_oversampling(const RID &p_font_rid) const {
return fd->oversampling; return fd->oversampling;
} }
Array TextServerAdvanced::font_get_size_cache_list(const RID &p_font_rid) const { TypedArray<Vector2i> TextServerAdvanced::font_get_size_cache_list(const RID &p_font_rid) const {
FontAdvanced *fd = font_owner.get_or_null(p_font_rid); FontAdvanced *fd = font_owner.get_or_null(p_font_rid);
ERR_FAIL_COND_V(!fd, Array()); ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>());
MutexLock lock(fd->mutex); MutexLock lock(fd->mutex);
Array ret; TypedArray<Vector2i> ret;
for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) { for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) {
ret.push_back(E.key); ret.push_back(E.key);
} }
@ -2454,15 +2454,15 @@ PackedInt32Array TextServerAdvanced::font_get_texture_offsets(const RID &p_font_
return tex.offsets; return tex.offsets;
} }
Array TextServerAdvanced::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { PackedInt32Array TextServerAdvanced::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const {
FontAdvanced *fd = font_owner.get_or_null(p_font_rid); FontAdvanced *fd = font_owner.get_or_null(p_font_rid);
ERR_FAIL_COND_V(!fd, Array()); ERR_FAIL_COND_V(!fd, PackedInt32Array());
MutexLock lock(fd->mutex); MutexLock lock(fd->mutex);
Vector2i size = _get_size_outline(fd, p_size); Vector2i size = _get_size_outline(fd, p_size);
ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), Array()); ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), PackedInt32Array());
Array ret; PackedInt32Array ret;
const HashMap<int32_t, FontGlyph> &gl = fd->cache[size]->glyph_map; const HashMap<int32_t, FontGlyph> &gl = fd->cache[size]->glyph_map;
for (const KeyValue<int32_t, FontGlyph> &E : gl) { for (const KeyValue<int32_t, FontGlyph> &E : gl) {
ret.push_back(E.key); ret.push_back(E.key);
@ -2811,16 +2811,16 @@ Dictionary TextServerAdvanced::font_get_glyph_contours(const RID &p_font_rid, in
#endif #endif
} }
Array TextServerAdvanced::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { TypedArray<Vector2i> TextServerAdvanced::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const {
FontAdvanced *fd = font_owner.get_or_null(p_font_rid); FontAdvanced *fd = font_owner.get_or_null(p_font_rid);
ERR_FAIL_COND_V(!fd, Array()); ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>());
MutexLock lock(fd->mutex); MutexLock lock(fd->mutex);
Vector2i size = _get_size(fd, p_size); Vector2i size = _get_size(fd, p_size);
ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), Array()); ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), TypedArray<Vector2i>());
Array ret; TypedArray<Vector2i> ret;
for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) { for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) {
ret.push_back(E.key); ret.push_back(E.key);
} }

View file

@ -537,7 +537,7 @@ public:
virtual void font_set_oversampling(const RID &p_font_rid, double p_oversampling) override; virtual void font_set_oversampling(const RID &p_font_rid, double p_oversampling) override;
virtual double font_get_oversampling(const RID &p_font_rid) const override; virtual double font_get_oversampling(const RID &p_font_rid) const override;
virtual Array font_get_size_cache_list(const RID &p_font_rid) const override; virtual TypedArray<Vector2i> font_get_size_cache_list(const RID &p_font_rid) const override;
virtual void font_clear_size_cache(const RID &p_font_rid) override; virtual void font_clear_size_cache(const RID &p_font_rid) override;
virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override;
@ -566,7 +566,7 @@ public:
virtual void font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) override; virtual void font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) override;
virtual PackedInt32Array font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; virtual PackedInt32Array font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override;
virtual Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override; virtual PackedInt32Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override;
virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override;
virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override; virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override;
@ -590,7 +590,7 @@ public:
virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override; virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override;
virtual Array font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override; virtual TypedArray<Vector2i> font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override;
virtual void font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) override; virtual void font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) override;
virtual void font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) override; virtual void font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) override;

View file

@ -1259,12 +1259,12 @@ double TextServerFallback::font_get_oversampling(const RID &p_font_rid) const {
return fd->oversampling; return fd->oversampling;
} }
Array TextServerFallback::font_get_size_cache_list(const RID &p_font_rid) const { TypedArray<Vector2i> TextServerFallback::font_get_size_cache_list(const RID &p_font_rid) const {
FontFallback *fd = font_owner.get_or_null(p_font_rid); FontFallback *fd = font_owner.get_or_null(p_font_rid);
ERR_FAIL_COND_V(!fd, Array()); ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>());
MutexLock lock(fd->mutex); MutexLock lock(fd->mutex);
Array ret; TypedArray<Vector2i> ret;
for (const KeyValue<Vector2i, FontForSizeFallback *> &E : fd->cache) { for (const KeyValue<Vector2i, FontForSizeFallback *> &E : fd->cache) {
ret.push_back(E.key); ret.push_back(E.key);
} }
@ -1543,15 +1543,15 @@ PackedInt32Array TextServerFallback::font_get_texture_offsets(const RID &p_font_
return tex.offsets; return tex.offsets;
} }
Array TextServerFallback::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { PackedInt32Array TextServerFallback::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const {
FontFallback *fd = font_owner.get_or_null(p_font_rid); FontFallback *fd = font_owner.get_or_null(p_font_rid);
ERR_FAIL_COND_V(!fd, Array()); ERR_FAIL_COND_V(!fd, PackedInt32Array());
MutexLock lock(fd->mutex); MutexLock lock(fd->mutex);
Vector2i size = _get_size_outline(fd, p_size); Vector2i size = _get_size_outline(fd, p_size);
ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), Array()); ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), PackedInt32Array());
Array ret; PackedInt32Array ret;
const HashMap<int32_t, FontGlyph> &gl = fd->cache[size]->glyph_map; const HashMap<int32_t, FontGlyph> &gl = fd->cache[size]->glyph_map;
for (const KeyValue<int32_t, FontGlyph> &E : gl) { for (const KeyValue<int32_t, FontGlyph> &E : gl) {
ret.push_back(E.key); ret.push_back(E.key);
@ -1886,16 +1886,16 @@ Dictionary TextServerFallback::font_get_glyph_contours(const RID &p_font_rid, in
#endif #endif
} }
Array TextServerFallback::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { TypedArray<Vector2i> TextServerFallback::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const {
FontFallback *fd = font_owner.get_or_null(p_font_rid); FontFallback *fd = font_owner.get_or_null(p_font_rid);
ERR_FAIL_COND_V(!fd, Array()); ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>());
MutexLock lock(fd->mutex); MutexLock lock(fd->mutex);
Vector2i size = _get_size(fd, p_size); Vector2i size = _get_size(fd, p_size);
ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), Array()); ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), TypedArray<Vector2i>());
Array ret; TypedArray<Vector2i> ret;
for (const KeyValue<Vector2i, Vector2> &E : fd->cache[size]->kerning_map) { for (const KeyValue<Vector2i, Vector2> &E : fd->cache[size]->kerning_map) {
ret.push_back(E.key); ret.push_back(E.key);
} }

View file

@ -417,7 +417,7 @@ public:
virtual void font_set_oversampling(const RID &p_font_rid, double p_oversampling) override; virtual void font_set_oversampling(const RID &p_font_rid, double p_oversampling) override;
virtual double font_get_oversampling(const RID &p_font_rid) const override; virtual double font_get_oversampling(const RID &p_font_rid) const override;
virtual Array font_get_size_cache_list(const RID &p_font_rid) const override; virtual TypedArray<Vector2i> font_get_size_cache_list(const RID &p_font_rid) const override;
virtual void font_clear_size_cache(const RID &p_font_rid) override; virtual void font_clear_size_cache(const RID &p_font_rid) override;
virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override;
@ -446,7 +446,7 @@ public:
virtual void font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) override; virtual void font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) override;
virtual PackedInt32Array font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; virtual PackedInt32Array font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override;
virtual Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override; virtual PackedInt32Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override;
virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override;
virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override; virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override;
@ -469,7 +469,7 @@ public:
virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override; virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override;
virtual Array font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override; virtual TypedArray<Vector2i> font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override;
virtual void font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) override; virtual void font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) override;
virtual void font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) override; virtual void font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) override;

View file

@ -2850,8 +2850,8 @@ void VisualScriptEditor::reload(bool p_soft) {
_update_graph(); _update_graph();
} }
Array VisualScriptEditor::get_breakpoints() { PackedInt32Array VisualScriptEditor::get_breakpoints() {
Array breakpoints; PackedInt32Array breakpoints;
List<StringName> functions; List<StringName> functions;
script->get_function_list(&functions); script->get_function_list(&functions);
for (int i = 0; i < functions.size(); i++) { for (int i = 0; i < functions.size(); i++) {

View file

@ -341,7 +341,7 @@ public:
virtual void ensure_focus() override; virtual void ensure_focus() override;
virtual void tag_saved_version() override; virtual void tag_saved_version() override;
virtual void reload(bool p_soft) override; virtual void reload(bool p_soft) override;
virtual Array get_breakpoints() override; virtual PackedInt32Array get_breakpoints() override;
virtual void set_breakpoint(int p_line, bool p_enable) override{}; virtual void set_breakpoint(int p_line, bool p_enable) override{};
virtual void clear_breakpoints() override{}; virtual void clear_breakpoints() override{};
virtual void add_callback(const String &p_function, PackedStringArray p_args) override; virtual void add_callback(const String &p_function, PackedStringArray p_args) override;

View file

@ -83,7 +83,7 @@ bool DisplayServerAndroid::tts_is_paused() const {
return TTS_Android::is_paused(); return TTS_Android::is_paused();
} }
Array DisplayServerAndroid::tts_get_voices() const { TypedArray<Dictionary> DisplayServerAndroid::tts_get_voices() const {
return TTS_Android::get_voices(); return TTS_Android::get_voices();
} }
@ -136,7 +136,7 @@ bool DisplayServerAndroid::clipboard_has() const {
} }
} }
Array DisplayServerAndroid::get_display_cutouts() const { TypedArray<Rect2> DisplayServerAndroid::get_display_cutouts() const {
GodotIOJavaWrapper *godot_io_java = OS_Android::get_singleton()->get_godot_io_java(); GodotIOJavaWrapper *godot_io_java = OS_Android::get_singleton()->get_godot_io_java();
ERR_FAIL_NULL_V(godot_io_java, Array()); ERR_FAIL_NULL_V(godot_io_java, Array());
return godot_io_java->get_display_cutouts(); return godot_io_java->get_display_cutouts();

View file

@ -93,7 +93,7 @@ public:
virtual bool tts_is_speaking() const override; virtual bool tts_is_speaking() const override;
virtual bool tts_is_paused() const override; virtual bool tts_is_paused() const override;
virtual Array tts_get_voices() const override; virtual TypedArray<Dictionary> tts_get_voices() const override;
virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override; virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override;
virtual void tts_pause() override; virtual void tts_pause() override;
@ -104,7 +104,7 @@ public:
virtual String clipboard_get() const override; virtual String clipboard_get() const override;
virtual bool clipboard_has() const override; virtual bool clipboard_has() const override;
virtual Array get_display_cutouts() const override; virtual TypedArray<Rect2> get_display_cutouts() const override;
virtual Rect2i get_display_safe_area() const override; virtual Rect2i get_display_safe_area() const override;
virtual void screen_set_keep_on(bool p_enable) override; virtual void screen_set_keep_on(bool p_enable) override;

View file

@ -165,8 +165,8 @@ float GodotIOJavaWrapper::get_screen_refresh_rate(float fallback) {
return fallback; return fallback;
} }
Array GodotIOJavaWrapper::get_display_cutouts() { TypedArray<Rect2> GodotIOJavaWrapper::get_display_cutouts() {
Array result; TypedArray<Rect2> result;
ERR_FAIL_NULL_V(_get_display_cutouts, result); ERR_FAIL_NULL_V(_get_display_cutouts, result);
JNIEnv *env = get_jni_env(); JNIEnv *env = get_jni_env();
ERR_FAIL_NULL_V(env, result); ERR_FAIL_NULL_V(env, result);

View file

@ -38,7 +38,7 @@
#include <jni.h> #include <jni.h>
#include "core/math/rect2i.h" #include "core/math/rect2i.h"
#include "core/variant/array.h" #include "core/variant/typed_array.h"
#include "string_android.h" #include "string_android.h"
// Class that makes functions in java/src/org/godotengine/godot/GodotIO.java callable from C++ // Class that makes functions in java/src/org/godotengine/godot/GodotIO.java callable from C++
@ -78,7 +78,7 @@ public:
int get_screen_dpi(); int get_screen_dpi();
float get_scaled_density(); float get_scaled_density();
float get_screen_refresh_rate(float fallback); float get_screen_refresh_rate(float fallback);
Array get_display_cutouts(); TypedArray<Rect2> get_display_cutouts();
Rect2i get_display_safe_area(); Rect2i get_display_safe_area();
String get_unique_id(); String get_unique_id();
bool has_vk(); bool has_vk();

View file

@ -127,7 +127,7 @@ public:
virtual bool tts_is_speaking() const override; virtual bool tts_is_speaking() const override;
virtual bool tts_is_paused() const override; virtual bool tts_is_paused() const override;
virtual Array tts_get_voices() const override; virtual TypedArray<Dictionary> tts_get_voices() const override;
virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override; virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override;
virtual void tts_pause() override; virtual void tts_pause() override;

View file

@ -336,8 +336,8 @@ bool DisplayServerIOS::tts_is_paused() const {
return [tts isPaused]; return [tts isPaused];
} }
Array DisplayServerIOS::tts_get_voices() const { TypedArray<Dictionary> DisplayServerIOS::tts_get_voices() const {
ERR_FAIL_COND_V(!tts, Array()); ERR_FAIL_COND_V(!tts, TypedArray<Dictionary>());
return [tts getVoices]; return [tts getVoices];
} }

View file

@ -296,7 +296,7 @@ void DisplayServerJavaScript::update_voices_callback(int p_size, const char **p_
} }
} }
Array DisplayServerJavaScript::tts_get_voices() const { TypedArray<Dictionary> DisplayServerJavaScript::tts_get_voices() const {
godot_js_tts_get_voices(update_voices_callback); godot_js_tts_get_voices(update_voices_callback);
return voices; return voices;
} }

View file

@ -124,7 +124,7 @@ public:
// tts // tts
virtual bool tts_is_speaking() const override; virtual bool tts_is_speaking() const override;
virtual bool tts_is_paused() const override; virtual bool tts_is_paused() const override;
virtual Array tts_get_voices() const override; virtual TypedArray<Dictionary> tts_get_voices() const override;
virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override; virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override;
virtual void tts_pause() override; virtual void tts_pause() override;

View file

@ -322,8 +322,8 @@ bool DisplayServerX11::tts_is_paused() const {
return tts->is_paused(); return tts->is_paused();
} }
Array DisplayServerX11::tts_get_voices() const { TypedArray<Dictionary> DisplayServerX11::tts_get_voices() const {
ERR_FAIL_COND_V(!tts, Array()); ERR_FAIL_COND_V(!tts, TypedArray<Dictionary>());
return tts->get_voices(); return tts->get_voices();
} }

View file

@ -308,7 +308,7 @@ public:
#ifdef SPEECHD_ENABLED #ifdef SPEECHD_ENABLED
virtual bool tts_is_speaking() const override; virtual bool tts_is_speaking() const override;
virtual bool tts_is_paused() const override; virtual bool tts_is_paused() const override;
virtual Array tts_get_voices() const override; virtual TypedArray<Dictionary> tts_get_voices() const override;
virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override; virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override;
virtual void tts_pause() override; virtual void tts_pause() override;

View file

@ -277,7 +277,7 @@ public:
virtual bool tts_is_speaking() const override; virtual bool tts_is_speaking() const override;
virtual bool tts_is_paused() const override; virtual bool tts_is_paused() const override;
virtual Array tts_get_voices() const override; virtual TypedArray<Dictionary> tts_get_voices() const override;
virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override; virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override;
virtual void tts_pause() override; virtual void tts_pause() override;

View file

@ -1656,7 +1656,7 @@ bool DisplayServerMacOS::tts_is_paused() const {
return [tts isPaused]; return [tts isPaused];
} }
Array DisplayServerMacOS::tts_get_voices() const { TypedArray<Dictionary> DisplayServerMacOS::tts_get_voices() const {
ERR_FAIL_COND_V(!tts, Array()); ERR_FAIL_COND_V(!tts, Array());
return [tts getVoices]; return [tts getVoices];
} }

View file

@ -144,8 +144,8 @@ bool DisplayServerWindows::tts_is_paused() const {
return tts->is_paused(); return tts->is_paused();
} }
Array DisplayServerWindows::tts_get_voices() const { TypedArray<Dictionary> DisplayServerWindows::tts_get_voices() const {
ERR_FAIL_COND_V(!tts, Array()); ERR_FAIL_COND_V(!tts, TypedArray<Dictionary>());
return tts->get_voices(); return tts->get_voices();
} }

View file

@ -478,7 +478,7 @@ public:
virtual bool tts_is_speaking() const override; virtual bool tts_is_speaking() const override;
virtual bool tts_is_paused() const override; virtual bool tts_is_paused() const override;
virtual Array tts_get_voices() const override; virtual TypedArray<Dictionary> tts_get_voices() const override;
virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override; virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override;
virtual void tts_pause() override; virtual void tts_pause() override;

View file

@ -361,8 +361,8 @@ void CollisionObject2D::get_shape_owners(List<uint32_t> *r_owners) {
} }
} }
Array CollisionObject2D::_get_shape_owners() { PackedInt32Array CollisionObject2D::_get_shape_owners() {
Array ret; PackedInt32Array ret;
for (const KeyValue<uint32_t, ShapeData> &E : shapes) { for (const KeyValue<uint32_t, ShapeData> &E : shapes) {
ret.push_back(E.key); ret.push_back(E.key);
} }

View file

@ -125,7 +125,7 @@ public:
uint32_t create_shape_owner(Object *p_owner); uint32_t create_shape_owner(Object *p_owner);
void remove_shape_owner(uint32_t owner); void remove_shape_owner(uint32_t owner);
void get_shape_owners(List<uint32_t> *r_owners); void get_shape_owners(List<uint32_t> *r_owners);
Array _get_shape_owners(); PackedInt32Array _get_shape_owners();
void shape_owner_set_transform(uint32_t p_owner, const Transform2D &p_transform); void shape_owner_set_transform(uint32_t p_owner, const Transform2D &p_transform);
Transform2D shape_owner_get_transform(uint32_t p_owner) const; Transform2D shape_owner_get_transform(uint32_t p_owner) const;

View file

@ -485,7 +485,7 @@ void Camera3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_keep_aspect_mode"), &Camera3D::get_keep_aspect_mode); ClassDB::bind_method(D_METHOD("get_keep_aspect_mode"), &Camera3D::get_keep_aspect_mode);
ClassDB::bind_method(D_METHOD("set_doppler_tracking", "mode"), &Camera3D::set_doppler_tracking); ClassDB::bind_method(D_METHOD("set_doppler_tracking", "mode"), &Camera3D::set_doppler_tracking);
ClassDB::bind_method(D_METHOD("get_doppler_tracking"), &Camera3D::get_doppler_tracking); ClassDB::bind_method(D_METHOD("get_doppler_tracking"), &Camera3D::get_doppler_tracking);
ClassDB::bind_method(D_METHOD("get_frustum"), &Camera3D::get_frustum); ClassDB::bind_method(D_METHOD("get_frustum"), &Camera3D::_get_frustum);
ClassDB::bind_method(D_METHOD("is_position_in_frustum", "world_point"), &Camera3D::is_position_in_frustum); ClassDB::bind_method(D_METHOD("is_position_in_frustum", "world_point"), &Camera3D::is_position_in_frustum);
ClassDB::bind_method(D_METHOD("get_camera_rid"), &Camera3D::get_camera); ClassDB::bind_method(D_METHOD("get_camera_rid"), &Camera3D::get_camera);
ClassDB::bind_method(D_METHOD("get_pyramid_shape_rid"), &Camera3D::get_pyramid_shape_rid); ClassDB::bind_method(D_METHOD("get_pyramid_shape_rid"), &Camera3D::get_pyramid_shape_rid);
@ -615,6 +615,11 @@ Vector<Plane> Camera3D::get_frustum() const {
return cm.get_projection_planes(get_camera_transform()); return cm.get_projection_planes(get_camera_transform());
} }
TypedArray<Plane> Camera3D::_get_frustum() const {
Variant ret = get_frustum();
return ret;
}
bool Camera3D::is_position_in_frustum(const Vector3 &p_position) const { bool Camera3D::is_position_in_frustum(const Vector3 &p_position) const {
Vector<Plane> frustum = get_frustum(); Vector<Plane> frustum = get_frustum();
for (int i = 0; i < frustum.size(); i++) { for (int i = 0; i < frustum.size(); i++) {

View file

@ -86,6 +86,7 @@ private:
// void _camera_make_current(Node *p_camera); // void _camera_make_current(Node *p_camera);
friend class Viewport; friend class Viewport;
void _update_audio_listener_state(); void _update_audio_listener_state();
TypedArray<Plane> _get_frustum() const;
DopplerTracking doppler_tracking = DOPPLER_TRACKING_DISABLED; DopplerTracking doppler_tracking = DOPPLER_TRACKING_DISABLED;
Ref<VelocityTracker3D> velocity_tracker; Ref<VelocityTracker3D> velocity_tracker;

View file

@ -546,8 +546,8 @@ void CollisionObject3D::get_shape_owners(List<uint32_t> *r_owners) {
} }
} }
Array CollisionObject3D::_get_shape_owners() { PackedInt32Array CollisionObject3D::_get_shape_owners() {
Array ret; PackedInt32Array ret;
for (const KeyValue<uint32_t, ShapeData> &E : shapes) { for (const KeyValue<uint32_t, ShapeData> &E : shapes) {
ret.push_back(E.key); ret.push_back(E.key);
} }

View file

@ -135,7 +135,7 @@ public:
uint32_t create_shape_owner(Object *p_owner); uint32_t create_shape_owner(Object *p_owner);
void remove_shape_owner(uint32_t owner); void remove_shape_owner(uint32_t owner);
void get_shape_owners(List<uint32_t> *r_owners); void get_shape_owners(List<uint32_t> *r_owners);
Array _get_shape_owners(); PackedInt32Array _get_shape_owners();
void shape_owner_set_transform(uint32_t p_owner, const Transform3D &p_transform); void shape_owner_set_transform(uint32_t p_owner, const Transform3D &p_transform);
Transform3D shape_owner_get_transform(uint32_t p_owner) const; Transform3D shape_owner_get_transform(uint32_t p_owner) const;

View file

@ -432,7 +432,7 @@ void Label3D::_shape() {
TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i)));
} }
Array stt; TypedArray<Vector2i> stt;
if (st_parser == TextServer::STRUCTURED_TEXT_CUSTOM) { if (st_parser == TextServer::STRUCTURED_TEXT_CUSTOM) {
GDVIRTUAL_CALL(_structured_text_parser, st_args, text, stt); GDVIRTUAL_CALL(_structured_text_parser, st_args, text, stt);
} else { } else {

View file

@ -490,8 +490,8 @@ void ButtonGroup::get_buttons(List<BaseButton *> *r_buttons) {
} }
} }
Array ButtonGroup::_get_buttons() { TypedArray<BaseButton> ButtonGroup::_get_buttons() {
Array btns; TypedArray<BaseButton> btns;
for (const BaseButton *E : buttons) { for (const BaseButton *E : buttons) {
btns.push_back(E); btns.push_back(E);
} }

View file

@ -151,7 +151,7 @@ protected:
public: public:
BaseButton *get_pressed_button(); BaseButton *get_pressed_button();
void get_buttons(List<BaseButton *> *r_buttons); void get_buttons(List<BaseButton *> *r_buttons);
Array _get_buttons(); TypedArray<BaseButton> _get_buttons();
ButtonGroup(); ButtonGroup();
}; };

View file

@ -1280,8 +1280,8 @@ void CodeEdit::clear_breakpointed_lines() {
} }
} }
Array CodeEdit::get_breakpointed_lines() const { PackedInt32Array CodeEdit::get_breakpointed_lines() const {
Array ret; PackedInt32Array ret;
for (int i = 0; i < get_line_count(); i++) { for (int i = 0; i < get_line_count(); i++) {
if (is_line_breakpointed(i)) { if (is_line_breakpointed(i)) {
ret.append(i); ret.append(i);
@ -1309,8 +1309,8 @@ void CodeEdit::clear_bookmarked_lines() {
} }
} }
Array CodeEdit::get_bookmarked_lines() const { PackedInt32Array CodeEdit::get_bookmarked_lines() const {
Array ret; PackedInt32Array ret;
for (int i = 0; i < get_line_count(); i++) { for (int i = 0; i < get_line_count(); i++) {
if (is_line_bookmarked(i)) { if (is_line_bookmarked(i)) {
ret.append(i); ret.append(i);
@ -1338,8 +1338,8 @@ void CodeEdit::clear_executing_lines() {
} }
} }
Array CodeEdit::get_executing_lines() const { PackedInt32Array CodeEdit::get_executing_lines() const {
Array ret; PackedInt32Array ret;
for (int i = 0; i < get_line_count(); i++) { for (int i = 0; i < get_line_count(); i++) {
if (is_line_executing(i)) { if (is_line_executing(i)) {
ret.append(i); ret.append(i);
@ -2769,7 +2769,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() {
i++; i++;
} }
Array completion_options; TypedArray<Dictionary> completion_options;
GDVIRTUAL_CALL(_filter_code_completion_candidates, completion_options_sources, completion_options); GDVIRTUAL_CALL(_filter_code_completion_candidates, completion_options_sources, completion_options);

View file

@ -266,7 +266,7 @@ protected:
GDVIRTUAL1(_confirm_code_completion, bool) GDVIRTUAL1(_confirm_code_completion, bool)
GDVIRTUAL1(_request_code_completion, bool) GDVIRTUAL1(_request_code_completion, bool)
GDVIRTUAL1RC(Array, _filter_code_completion_candidates, TypedArray<Dictionary>) GDVIRTUAL1RC(TypedArray<Dictionary>, _filter_code_completion_candidates, TypedArray<Dictionary>)
public: public:
/* General overrides */ /* General overrides */
@ -322,19 +322,19 @@ public:
void set_line_as_breakpoint(int p_line, bool p_breakpointed); void set_line_as_breakpoint(int p_line, bool p_breakpointed);
bool is_line_breakpointed(int p_line) const; bool is_line_breakpointed(int p_line) const;
void clear_breakpointed_lines(); void clear_breakpointed_lines();
Array get_breakpointed_lines() const; PackedInt32Array get_breakpointed_lines() const;
// bookmarks // bookmarks
void set_line_as_bookmarked(int p_line, bool p_bookmarked); void set_line_as_bookmarked(int p_line, bool p_bookmarked);
bool is_line_bookmarked(int p_line) const; bool is_line_bookmarked(int p_line) const;
void clear_bookmarked_lines(); void clear_bookmarked_lines();
Array get_bookmarked_lines() const; PackedInt32Array get_bookmarked_lines() const;
// executing lines // executing lines
void set_line_as_executing(int p_line, bool p_executing); void set_line_as_executing(int p_line, bool p_executing);
bool is_line_executing(int p_line) const; bool is_line_executing(int p_line) const;
void clear_executing_lines(); void clear_executing_lines();
Array get_executing_lines() const; PackedInt32Array get_executing_lines() const;
/* Line numbers */ /* Line numbers */
void set_draw_line_numbers(bool p_draw); void set_draw_line_numbers(bool p_draw);

View file

@ -2946,13 +2946,13 @@ void Control::end_bulk_theme_override() {
// Internationalization. // Internationalization.
Array Control::structured_text_parser(TextServer::StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const { TypedArray<Vector2i> Control::structured_text_parser(TextServer::StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const {
if (p_parser_type == TextServer::STRUCTURED_TEXT_CUSTOM) { if (p_parser_type == TextServer::STRUCTURED_TEXT_CUSTOM) {
Array ret; TypedArray<Vector2i> ret;
if (GDVIRTUAL_CALL(_structured_text_parser, p_args, p_text, ret)) { if (GDVIRTUAL_CALL(_structured_text_parser, p_args, p_text, ret)) {
return ret; return ret;
} else { } else {
return Array(); return TypedArray<Vector2i>();
} }
} else { } else {
return TS->parse_structured_text(p_parser_type, p_args, p_text); return TS->parse_structured_text(p_parser_type, p_args, p_text);

View file

@ -328,7 +328,7 @@ protected:
// Internationalization. // Internationalization.
virtual Array structured_text_parser(TextServer::StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const; virtual TypedArray<Vector2i> structured_text_parser(TextServer::StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const;
// Base object overrides. // Base object overrides.
@ -341,7 +341,7 @@ protected:
// Exposed virtual methods. // Exposed virtual methods.
GDVIRTUAL1RC(bool, _has_point, Vector2) GDVIRTUAL1RC(bool, _has_point, Vector2)
GDVIRTUAL2RC(Array, _structured_text_parser, Array, String) GDVIRTUAL2RC(TypedArray<Vector2i>, _structured_text_parser, Array, String)
GDVIRTUAL0RC(Vector2, _get_minimum_size) GDVIRTUAL0RC(Vector2, _get_minimum_size)
GDVIRTUAL1RC(Variant, _get_drag_data, Vector2) GDVIRTUAL1RC(Variant, _get_drag_data, Vector2)

View file

@ -31,6 +31,7 @@
#include "bit_map.h" #include "bit_map.h"
#include "core/io/image_loader.h" #include "core/io/image_loader.h"
#include "core/variant/typed_array.h"
void BitMap::create(const Size2 &p_size) { void BitMap::create(const Size2 &p_size) {
ERR_FAIL_COND(p_size.width < 1); ERR_FAIL_COND(p_size.width < 1);
@ -576,12 +577,12 @@ void BitMap::shrink_mask(int p_pixels, const Rect2 &p_rect) {
grow_mask(-p_pixels, p_rect); grow_mask(-p_pixels, p_rect);
} }
Array BitMap::_opaque_to_polygons_bind(const Rect2 &p_rect, float p_epsilon) const { TypedArray<PackedVector2Array> BitMap::_opaque_to_polygons_bind(const Rect2 &p_rect, float p_epsilon) const {
Vector<Vector<Vector2>> result = clip_opaque_to_polygons(p_rect, p_epsilon); Vector<Vector<Vector2>> result = clip_opaque_to_polygons(p_rect, p_epsilon);
// Convert result to bindable types // Convert result to bindable types
Array result_array; TypedArray<PackedVector2Array> result_array;
result_array.resize(result.size()); result_array.resize(result.size());
for (int i = 0; i < result.size(); i++) { for (int i = 0; i < result.size(); i++) {
const Vector<Vector2> &polygon = result[i]; const Vector<Vector2> &polygon = result[i];

View file

@ -35,6 +35,9 @@
#include "core/io/resource.h" #include "core/io/resource.h"
#include "core/io/resource_loader.h" #include "core/io/resource_loader.h"
template <typename T>
class TypedArray;
class BitMap : public Resource { class BitMap : public Resource {
GDCLASS(BitMap, Resource); GDCLASS(BitMap, Resource);
OBJ_SAVE_TYPE(BitMap); OBJ_SAVE_TYPE(BitMap);
@ -45,7 +48,7 @@ class BitMap : public Resource {
Vector<Vector2> _march_square(const Rect2i &rect, const Point2i &start) const; Vector<Vector2> _march_square(const Rect2i &rect, const Point2i &start) const;
Array _opaque_to_polygons_bind(const Rect2 &p_rect, float p_epsilon) const; TypedArray<PackedVector2Array> _opaque_to_polygons_bind(const Rect2 &p_rect, float p_epsilon) const;
protected: protected:
void _set_data(const Dictionary &p_d); void _set_data(const Dictionary &p_d);

View file

@ -1267,7 +1267,7 @@ void FontFile::_get_property_list(List<PropertyInfo> *p_list) const {
} }
for (int i = 0; i < cache.size(); i++) { for (int i = 0; i < cache.size(); i++) {
String prefix = "cache/" + itos(i) + "/"; String prefix = "cache/" + itos(i) + "/";
Array sizes = get_size_cache_list(i); TypedArray<Vector2i> sizes = get_size_cache_list(i);
p_list->push_back(PropertyInfo(Variant::DICTIONARY, prefix + "variation_coordinates", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); p_list->push_back(PropertyInfo(Variant::DICTIONARY, prefix + "variation_coordinates", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE));
p_list->push_back(PropertyInfo(Variant::INT, "face_index", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); p_list->push_back(PropertyInfo(Variant::INT, "face_index", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE));
p_list->push_back(PropertyInfo(Variant::FLOAT, "embolden", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); p_list->push_back(PropertyInfo(Variant::FLOAT, "embolden", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE));
@ -1289,7 +1289,7 @@ void FontFile::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, prefix_sz + "textures/" + itos(k) + "/offsets", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, prefix_sz + "textures/" + itos(k) + "/offsets", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE));
p_list->push_back(PropertyInfo(Variant::OBJECT, prefix_sz + "textures/" + itos(k) + "/image", PROPERTY_HINT_RESOURCE_TYPE, "Image", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT)); p_list->push_back(PropertyInfo(Variant::OBJECT, prefix_sz + "textures/" + itos(k) + "/image", PROPERTY_HINT_RESOURCE_TYPE, "Image", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT));
} }
Array glyphs = get_glyph_list(i, sz); PackedInt32Array glyphs = get_glyph_list(i, sz);
for (int k = 0; k < glyphs.size(); k++) { for (int k = 0; k < glyphs.size(); k++) {
const int32_t &gl = glyphs[k]; const int32_t &gl = glyphs[k];
if (sz.y == 0) { if (sz.y == 0) {
@ -1301,7 +1301,7 @@ void FontFile::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::INT, prefix_sz + "glyphs/" + itos(gl) + "/texture_idx", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); p_list->push_back(PropertyInfo(Variant::INT, prefix_sz + "glyphs/" + itos(gl) + "/texture_idx", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE));
} }
if (sz.y == 0) { if (sz.y == 0) {
Array kerning_map = get_kerning_list(i, sz.x); TypedArray<Vector2i> kerning_map = get_kerning_list(i, sz.x);
for (int k = 0; k < kerning_map.size(); k++) { for (int k = 0; k < kerning_map.size(); k++) {
const Vector2i &gl_pair = kerning_map[k]; const Vector2i &gl_pair = kerning_map[k];
p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "kerning_overrides/" + itos(gl_pair.x) + "/" + itos(gl_pair.y), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "kerning_overrides/" + itos(gl_pair.x) + "/" + itos(gl_pair.y), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE));
@ -2089,7 +2089,7 @@ void FontFile::remove_cache(int p_cache_index) {
emit_changed(); emit_changed();
} }
Array FontFile::get_size_cache_list(int p_cache_index) const { TypedArray<Vector2i> FontFile::get_size_cache_list(int p_cache_index) const {
ERR_FAIL_COND_V(p_cache_index < 0, Array()); ERR_FAIL_COND_V(p_cache_index < 0, Array());
_ensure_rid(p_cache_index); _ensure_rid(p_cache_index);
return TS->font_get_size_cache_list(cache[p_cache_index]); return TS->font_get_size_cache_list(cache[p_cache_index]);
@ -2260,8 +2260,8 @@ PackedInt32Array FontFile::get_texture_offsets(int p_cache_index, const Vector2i
return TS->font_get_texture_offsets(cache[p_cache_index], p_size, p_texture_index); return TS->font_get_texture_offsets(cache[p_cache_index], p_size, p_texture_index);
} }
Array FontFile::get_glyph_list(int p_cache_index, const Vector2i &p_size) const { PackedInt32Array FontFile::get_glyph_list(int p_cache_index, const Vector2i &p_size) const {
ERR_FAIL_COND_V(p_cache_index < 0, Array()); ERR_FAIL_COND_V(p_cache_index < 0, PackedInt32Array());
_ensure_rid(p_cache_index); _ensure_rid(p_cache_index);
return TS->font_get_glyph_list(cache[p_cache_index], p_size); return TS->font_get_glyph_list(cache[p_cache_index], p_size);
} }
@ -2338,7 +2338,7 @@ int FontFile::get_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, i
return TS->font_get_glyph_texture_idx(cache[p_cache_index], p_size, p_glyph); return TS->font_get_glyph_texture_idx(cache[p_cache_index], p_size, p_glyph);
} }
Array FontFile::get_kerning_list(int p_cache_index, int p_size) const { TypedArray<Vector2i> FontFile::get_kerning_list(int p_cache_index, int p_size) const {
ERR_FAIL_COND_V(p_cache_index < 0, Array()); ERR_FAIL_COND_V(p_cache_index < 0, Array());
_ensure_rid(p_cache_index); _ensure_rid(p_cache_index);
return TS->font_get_kerning_list(cache[p_cache_index], p_size); return TS->font_get_kerning_list(cache[p_cache_index], p_size);

View file

@ -230,7 +230,7 @@ public:
virtual void clear_cache(); virtual void clear_cache();
virtual void remove_cache(int p_cache_index); virtual void remove_cache(int p_cache_index);
virtual Array get_size_cache_list(int p_cache_index) const; virtual TypedArray<Vector2i> get_size_cache_list(int p_cache_index) const;
virtual void clear_size_cache(int p_cache_index); virtual void clear_size_cache(int p_cache_index);
virtual void remove_size_cache(int p_cache_index, const Vector2i &p_size); virtual void remove_size_cache(int p_cache_index, const Vector2i &p_size);
@ -271,7 +271,7 @@ public:
virtual void set_texture_offsets(int p_cache_index, const Vector2i &p_size, int p_texture_index, const PackedInt32Array &p_offset); virtual void set_texture_offsets(int p_cache_index, const Vector2i &p_size, int p_texture_index, const PackedInt32Array &p_offset);
virtual PackedInt32Array get_texture_offsets(int p_cache_index, const Vector2i &p_size, int p_texture_index) const; virtual PackedInt32Array get_texture_offsets(int p_cache_index, const Vector2i &p_size, int p_texture_index) const;
virtual Array get_glyph_list(int p_cache_index, const Vector2i &p_size) const; virtual PackedInt32Array get_glyph_list(int p_cache_index, const Vector2i &p_size) const;
virtual void clear_glyphs(int p_cache_index, const Vector2i &p_size); virtual void clear_glyphs(int p_cache_index, const Vector2i &p_size);
virtual void remove_glyph(int p_cache_index, const Vector2i &p_size, int32_t p_glyph); virtual void remove_glyph(int p_cache_index, const Vector2i &p_size, int32_t p_glyph);
@ -290,7 +290,7 @@ public:
virtual void set_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, int p_texture_idx); virtual void set_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, int p_texture_idx);
virtual int get_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const; virtual int get_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const;
virtual Array get_kerning_list(int p_cache_index, int p_size) const; virtual TypedArray<Vector2i> get_kerning_list(int p_cache_index, int p_size) const;
virtual void clear_kerning_map(int p_cache_index, int p_size); virtual void clear_kerning_map(int p_cache_index, int p_size);
virtual void remove_kerning(int p_cache_index, int p_size, const Vector2i &p_glyph_pair); virtual void remove_kerning(int p_cache_index, int p_size, const Vector2i &p_glyph_pair);

View file

@ -144,8 +144,8 @@ int AudioDriver::get_total_channels_by_speaker_mode(AudioDriver::SpeakerMode p_m
ERR_FAIL_V(2); ERR_FAIL_V(2);
} }
Array AudioDriver::get_device_list() { PackedStringArray AudioDriver::get_device_list() {
Array list; PackedStringArray list;
list.push_back("Default"); list.push_back("Default");
@ -156,8 +156,8 @@ String AudioDriver::get_device() {
return "Default"; return "Default";
} }
Array AudioDriver::capture_get_device_list() { PackedStringArray AudioDriver::capture_get_device_list() {
Array list; PackedStringArray list;
list.push_back("Default"); list.push_back("Default");
@ -1637,7 +1637,7 @@ Ref<AudioBusLayout> AudioServer::generate_bus_layout() const {
return state; return state;
} }
Array AudioServer::get_device_list() { PackedStringArray AudioServer::get_device_list() {
return AudioDriver::get_singleton()->get_device_list(); return AudioDriver::get_singleton()->get_device_list();
} }
@ -1649,7 +1649,7 @@ void AudioServer::set_device(String device) {
AudioDriver::get_singleton()->set_device(device); AudioDriver::get_singleton()->set_device(device);
} }
Array AudioServer::capture_get_device_list() { PackedStringArray AudioServer::capture_get_device_list() {
return AudioDriver::get_singleton()->capture_get_device_list(); return AudioDriver::get_singleton()->capture_get_device_list();
} }

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