Merge pull request #64082 from KoBeWi/array3k
This commit is contained in:
@@ -70,44 +70,44 @@ Array RenderingServer::_texture_debug_usage_bind() {
|
||||
return arr;
|
||||
}
|
||||
|
||||
static Array to_array(const Vector<ObjectID> &ids) {
|
||||
Array a;
|
||||
static PackedInt64Array to_int_array(const Vector<ObjectID> &ids) {
|
||||
PackedInt64Array a;
|
||||
a.resize(ids.size());
|
||||
for (int i = 0; i < ids.size(); ++i) {
|
||||
a[i] = ids[i];
|
||||
a.write[i] = ids[i];
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
Array RenderingServer::_instances_cull_aabb_bind(const AABB &p_aabb, RID p_scenario) const {
|
||||
PackedInt64Array RenderingServer::_instances_cull_aabb_bind(const AABB &p_aabb, RID p_scenario) const {
|
||||
if (RSG::threaded) {
|
||||
WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall.");
|
||||
}
|
||||
Vector<ObjectID> ids = instances_cull_aabb(p_aabb, p_scenario);
|
||||
return to_array(ids);
|
||||
return to_int_array(ids);
|
||||
}
|
||||
|
||||
Array RenderingServer::_instances_cull_ray_bind(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario) const {
|
||||
PackedInt64Array RenderingServer::_instances_cull_ray_bind(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario) const {
|
||||
if (RSG::threaded) {
|
||||
WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall.");
|
||||
}
|
||||
Vector<ObjectID> ids = instances_cull_ray(p_from, p_to, p_scenario);
|
||||
return to_array(ids);
|
||||
return to_int_array(ids);
|
||||
}
|
||||
|
||||
Array RenderingServer::_instances_cull_convex_bind(const Array &p_convex, RID p_scenario) const {
|
||||
PackedInt64Array RenderingServer::_instances_cull_convex_bind(const Array &p_convex, RID p_scenario) const {
|
||||
if (RSG::threaded) {
|
||||
WARN_PRINT_ONCE("Using this function with a threaded renderer hurts performance, as it causes a server stall.");
|
||||
}
|
||||
Vector<Plane> planes;
|
||||
for (int i = 0; i < p_convex.size(); ++i) {
|
||||
Variant v = p_convex[i];
|
||||
ERR_FAIL_COND_V(v.get_type() != Variant::PLANE, Array());
|
||||
ERR_FAIL_COND_V(v.get_type() != Variant::PLANE, PackedInt64Array());
|
||||
planes.push_back(v);
|
||||
}
|
||||
|
||||
Vector<ObjectID> ids = instances_cull_convex(planes, p_scenario);
|
||||
return to_array(ids);
|
||||
return to_int_array(ids);
|
||||
}
|
||||
|
||||
RID RenderingServer::get_test_texture() {
|
||||
@@ -1626,7 +1626,7 @@ Dictionary RenderingServer::_mesh_get_surface(RID p_mesh, int p_idx) {
|
||||
return d;
|
||||
}
|
||||
|
||||
Array RenderingServer::_instance_geometry_get_shader_uniform_list(RID p_instance) const {
|
||||
TypedArray<Dictionary> RenderingServer::_instance_geometry_get_shader_uniform_list(RID p_instance) const {
|
||||
List<PropertyInfo> params;
|
||||
instance_geometry_get_shader_uniform_list(p_instance, ¶ms);
|
||||
return convert_property_list(¶ms);
|
||||
|
||||
@@ -1216,9 +1216,9 @@ public:
|
||||
virtual Vector<ObjectID> instances_cull_ray(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario = RID()) const = 0;
|
||||
virtual Vector<ObjectID> instances_cull_convex(const Vector<Plane> &p_convex, RID p_scenario = RID()) const = 0;
|
||||
|
||||
Array _instances_cull_aabb_bind(const AABB &p_aabb, RID p_scenario = RID()) const;
|
||||
Array _instances_cull_ray_bind(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario = RID()) const;
|
||||
Array _instances_cull_convex_bind(const Array &p_convex, RID p_scenario = RID()) const;
|
||||
PackedInt64Array _instances_cull_aabb_bind(const AABB &p_aabb, RID p_scenario = RID()) const;
|
||||
PackedInt64Array _instances_cull_ray_bind(const Vector3 &p_from, const Vector3 &p_to, RID p_scenario = RID()) const;
|
||||
PackedInt64Array _instances_cull_convex_bind(const Array &p_convex, RID p_scenario = RID()) const;
|
||||
|
||||
enum InstanceFlags {
|
||||
INSTANCE_FLAG_USE_BAKED_LIGHT,
|
||||
@@ -1581,7 +1581,7 @@ private:
|
||||
RID _mesh_create_from_surfaces(const TypedArray<Dictionary> &p_surfaces, int p_blend_shape_count);
|
||||
void _mesh_add_surface(RID p_mesh, const Dictionary &p_surface);
|
||||
Dictionary _mesh_get_surface(RID p_mesh, int p_idx);
|
||||
Array _instance_geometry_get_shader_uniform_list(RID p_instance) const;
|
||||
TypedArray<Dictionary> _instance_geometry_get_shader_uniform_list(RID p_instance) const;
|
||||
TypedArray<Image> _bake_render_uv2(RID p_base, const TypedArray<RID> &p_material_overrides, const Size2i &p_image_size);
|
||||
void _particles_set_trail_bind_poses(RID p_particles, const TypedArray<Transform3D> &p_bind_poses);
|
||||
};
|
||||
|
||||
@@ -1534,12 +1534,12 @@ String TextServerExtension::string_to_lower(const String &p_string, const String
|
||||
return p_string;
|
||||
}
|
||||
|
||||
Array TextServerExtension::parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const {
|
||||
Array ret;
|
||||
TypedArray<Vector2i> TextServerExtension::parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const {
|
||||
TypedArray<Vector2i> ret;
|
||||
if (GDVIRTUAL_CALL(parse_structured_text, p_parser_type, p_args, p_text, ret)) {
|
||||
return ret;
|
||||
}
|
||||
return Array();
|
||||
return TypedArray<Vector2i>();
|
||||
}
|
||||
|
||||
PackedInt32Array TextServerExtension::string_get_word_breaks(const String &p_string, const String &p_language) const {
|
||||
|
||||
@@ -505,8 +505,8 @@ public:
|
||||
GDVIRTUAL2RC(String, string_to_upper, const String &, const String &);
|
||||
GDVIRTUAL2RC(String, string_to_lower, const String &, const String &);
|
||||
|
||||
Array parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const;
|
||||
GDVIRTUAL3RC(Array, parse_structured_text, StructuredTextParser, const Array &, const String &);
|
||||
TypedArray<Vector2i> parse_structured_text(StructuredTextParser p_parser_type, const Array &p_args, const String &p_text) const;
|
||||
GDVIRTUAL3RC(TypedArray<Vector2i>, parse_structured_text, StructuredTextParser, const Array &, const String &);
|
||||
|
||||
virtual int is_confusable(const String &p_string, const PackedStringArray &p_dict) const override;
|
||||
virtual bool spoof_check(const String &p_string) const override;
|
||||
|
||||
@@ -104,8 +104,8 @@ Ref<TextServer> TextServerManager::find_interface(const String &p_name) const {
|
||||
return interfaces[idx];
|
||||
}
|
||||
|
||||
Array TextServerManager::get_interfaces() const {
|
||||
Array ret;
|
||||
TypedArray<Dictionary> TextServerManager::get_interfaces() const {
|
||||
TypedArray<Dictionary> ret;
|
||||
|
||||
for (int i = 0; i < interfaces.size(); i++) {
|
||||
Dictionary iface_info;
|
||||
@@ -1663,8 +1663,8 @@ TypedArray<Vector2i> TextServer::parse_structured_text(StructuredTextParser p_pa
|
||||
return ret;
|
||||
}
|
||||
|
||||
Array TextServer::_shaped_text_get_glyphs_wrapper(const RID &p_shaped) const {
|
||||
Array ret;
|
||||
TypedArray<Dictionary> TextServer::_shaped_text_get_glyphs_wrapper(const RID &p_shaped) const {
|
||||
TypedArray<Dictionary> ret;
|
||||
|
||||
const Glyph *glyphs = shaped_text_get_glyphs(p_shaped);
|
||||
int gl_size = shaped_text_get_glyph_count(p_shaped);
|
||||
@@ -1688,7 +1688,7 @@ Array TextServer::_shaped_text_get_glyphs_wrapper(const RID &p_shaped) const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Array TextServer::_shaped_text_sort_logical_wrapper(const RID &p_shaped) {
|
||||
TypedArray<Dictionary> TextServer::_shaped_text_sort_logical_wrapper(const RID &p_shaped) {
|
||||
Array ret;
|
||||
|
||||
const Glyph *glyphs = shaped_text_sort_logical(p_shaped);
|
||||
@@ -1713,8 +1713,8 @@ Array TextServer::_shaped_text_sort_logical_wrapper(const RID &p_shaped) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Array TextServer::_shaped_text_get_ellipsis_glyphs_wrapper(const RID &p_shaped) const {
|
||||
Array ret;
|
||||
TypedArray<Dictionary> TextServer::_shaped_text_get_ellipsis_glyphs_wrapper(const RID &p_shaped) const {
|
||||
TypedArray<Dictionary> ret;
|
||||
|
||||
const Glyph *glyphs = shaped_text_get_ellipsis_glyphs(p_shaped);
|
||||
int gl_size = shaped_text_get_ellipsis_glyph_count(p_shaped);
|
||||
|
||||
@@ -414,9 +414,9 @@ public:
|
||||
virtual bool shaped_text_is_ready(const RID &p_shaped) const = 0;
|
||||
|
||||
virtual const Glyph *shaped_text_get_glyphs(const RID &p_shaped) const = 0;
|
||||
Array _shaped_text_get_glyphs_wrapper(const RID &p_shaped) const;
|
||||
TypedArray<Dictionary> _shaped_text_get_glyphs_wrapper(const RID &p_shaped) const;
|
||||
virtual const Glyph *shaped_text_sort_logical(const RID &p_shaped) = 0;
|
||||
Array _shaped_text_sort_logical_wrapper(const RID &p_shaped);
|
||||
TypedArray<Dictionary> _shaped_text_sort_logical_wrapper(const RID &p_shaped);
|
||||
virtual int64_t shaped_text_get_glyph_count(const RID &p_shaped) const = 0;
|
||||
|
||||
virtual Vector2i shaped_text_get_range(const RID &p_shaped) const = 0;
|
||||
@@ -428,7 +428,7 @@ public:
|
||||
virtual int64_t shaped_text_get_trim_pos(const RID &p_shaped) const = 0;
|
||||
virtual int64_t shaped_text_get_ellipsis_pos(const RID &p_shaped) const = 0;
|
||||
virtual const Glyph *shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const = 0;
|
||||
Array _shaped_text_get_ellipsis_glyphs_wrapper(const RID &p_shaped) const;
|
||||
TypedArray<Dictionary> _shaped_text_get_ellipsis_glyphs_wrapper(const RID &p_shaped) const;
|
||||
virtual int64_t shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const = 0;
|
||||
|
||||
virtual void shaped_text_overrun_trim_to_width(const RID &p_shaped, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) = 0;
|
||||
@@ -541,7 +541,7 @@ public:
|
||||
int get_interface_count() const;
|
||||
Ref<TextServer> get_interface(int p_index) const;
|
||||
Ref<TextServer> find_interface(const String &p_name) const;
|
||||
Array get_interfaces() const;
|
||||
TypedArray<Dictionary> get_interfaces() const;
|
||||
|
||||
_FORCE_INLINE_ Ref<TextServer> get_primary_interface() const {
|
||||
return primary_interface;
|
||||
|
||||
@@ -226,7 +226,7 @@ Ref<XRInterface> XRServer::find_interface(const String &p_name) const {
|
||||
return interfaces[idx];
|
||||
};
|
||||
|
||||
Array XRServer::get_interfaces() const {
|
||||
TypedArray<Dictionary> XRServer::get_interfaces() const {
|
||||
Array ret;
|
||||
|
||||
for (int i = 0; i < interfaces.size(); i++) {
|
||||
|
||||
+1
-1
@@ -157,7 +157,7 @@ public:
|
||||
int get_interface_count() const;
|
||||
Ref<XRInterface> get_interface(int p_index) const;
|
||||
Ref<XRInterface> find_interface(const String &p_name) const;
|
||||
Array get_interfaces() const;
|
||||
TypedArray<Dictionary> get_interfaces() const;
|
||||
|
||||
/*
|
||||
note, more then one interface can technically be active, especially on mobile, but only one interface is used for
|
||||
|
||||
Reference in New Issue
Block a user