diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-27 13:53:16 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-09-27 13:53:16 +0200 |
commit | 8a9a26ef1980f149c6466329a989bbb930612902 (patch) | |
tree | 12979c68b0685334e0f95a0fa96e9381f347f3ec /servers | |
parent | 543fa16b4ce821a0118da3ef0904a105aaa046e9 (diff) | |
parent | c2af6bcb5983356244d699735cda00b0bc5f4f8d (diff) | |
download | redot-engine-8a9a26ef1980f149c6466329a989bbb930612902.tar.gz |
Merge pull request #93311 from dsnopek/gdextension-required-virtuals
GDExtension: Mark virtual function as `is_required` in `extension_api.json`
Diffstat (limited to 'servers')
-rw-r--r-- | servers/audio/audio_effect.cpp | 4 | ||||
-rw-r--r-- | servers/audio/audio_effect.h | 4 | ||||
-rw-r--r-- | servers/audio/audio_stream.cpp | 6 | ||||
-rw-r--r-- | servers/audio/audio_stream.h | 6 | ||||
-rw-r--r-- | servers/extensions/physics_server_2d_extension.h | 44 | ||||
-rw-r--r-- | servers/extensions/physics_server_3d_extension.h | 44 | ||||
-rw-r--r-- | servers/movie_writer/movie_writer.cpp | 14 | ||||
-rw-r--r-- | servers/movie_writer/movie_writer.h | 14 | ||||
-rw-r--r-- | servers/physics_server_3d.cpp | 6 | ||||
-rw-r--r-- | servers/physics_server_3d.h | 6 | ||||
-rw-r--r-- | servers/text/text_server_extension.cpp | 160 | ||||
-rw-r--r-- | servers/text/text_server_extension.h | 160 |
12 files changed, 234 insertions, 234 deletions
diff --git a/servers/audio/audio_effect.cpp b/servers/audio/audio_effect.cpp index 28a957cf6f..ac334eb764 100644 --- a/servers/audio/audio_effect.cpp +++ b/servers/audio/audio_effect.cpp @@ -31,7 +31,7 @@ #include "audio_effect.h" void AudioEffectInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) { - GDVIRTUAL_REQUIRED_CALL(_process, p_src_frames, p_dst_frames, p_frame_count); + GDVIRTUAL_CALL(_process, p_src_frames, p_dst_frames, p_frame_count); } bool AudioEffectInstance::process_silence() const { bool ret = false; @@ -48,7 +48,7 @@ void AudioEffectInstance::_bind_methods() { Ref<AudioEffectInstance> AudioEffect::instantiate() { Ref<AudioEffectInstance> ret; - GDVIRTUAL_REQUIRED_CALL(_instantiate, ret); + GDVIRTUAL_CALL(_instantiate, ret); return ret; } void AudioEffect::_bind_methods() { diff --git a/servers/audio/audio_effect.h b/servers/audio/audio_effect.h index 9952246c20..cef5bfec5e 100644 --- a/servers/audio/audio_effect.h +++ b/servers/audio/audio_effect.h @@ -40,7 +40,7 @@ class AudioEffectInstance : public RefCounted { GDCLASS(AudioEffectInstance, RefCounted); protected: - GDVIRTUAL3(_process, GDExtensionConstPtr<AudioFrame>, GDExtensionPtr<AudioFrame>, int) + GDVIRTUAL3_REQUIRED(_process, GDExtensionConstPtr<AudioFrame>, GDExtensionPtr<AudioFrame>, int) GDVIRTUAL0RC(bool, _process_silence) static void _bind_methods(); @@ -53,7 +53,7 @@ class AudioEffect : public Resource { GDCLASS(AudioEffect, Resource); protected: - GDVIRTUAL0R(Ref<AudioEffectInstance>, _instantiate) + GDVIRTUAL0R_REQUIRED(Ref<AudioEffectInstance>, _instantiate) static void _bind_methods(); public: diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index ece088a694..1886ebe1ac 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -72,7 +72,7 @@ void AudioStreamPlayback::seek(double p_time) { int AudioStreamPlayback::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) { int ret = 0; - GDVIRTUAL_REQUIRED_CALL(_mix, p_buffer, p_rate_scale, p_frames, ret); + GDVIRTUAL_CALL(_mix, p_buffer, p_rate_scale, p_frames, ret); return ret; } @@ -132,12 +132,12 @@ void AudioStreamPlaybackResampled::begin_resample() { int AudioStreamPlaybackResampled::_mix_internal(AudioFrame *p_buffer, int p_frames) { int ret = 0; - GDVIRTUAL_REQUIRED_CALL(_mix_resampled, p_buffer, p_frames, ret); + GDVIRTUAL_CALL(_mix_resampled, p_buffer, p_frames, ret); return ret; } float AudioStreamPlaybackResampled::get_stream_sampling_rate() { float ret = 0; - GDVIRTUAL_REQUIRED_CALL(_get_stream_sampling_rate, ret); + GDVIRTUAL_CALL(_get_stream_sampling_rate, ret); return ret; } diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h index 7f2b68a796..3feaa53630 100644 --- a/servers/audio/audio_stream.h +++ b/servers/audio/audio_stream.h @@ -89,7 +89,7 @@ protected: GDVIRTUAL0RC(int, _get_loop_count) GDVIRTUAL0RC(double, _get_playback_position) GDVIRTUAL1(_seek, double) - GDVIRTUAL3R(int, _mix, GDExtensionPtr<AudioFrame>, float, int) + GDVIRTUAL3R_REQUIRED(int, _mix, GDExtensionPtr<AudioFrame>, float, int) GDVIRTUAL0(_tag_used_streams) GDVIRTUAL2(_set_parameter, const StringName &, const Variant &) GDVIRTUAL1RC(Variant, _get_parameter, const StringName &) @@ -141,8 +141,8 @@ protected: virtual int _mix_internal(AudioFrame *p_buffer, int p_frames); virtual float get_stream_sampling_rate(); - GDVIRTUAL2R(int, _mix_resampled, GDExtensionPtr<AudioFrame>, int) - GDVIRTUAL0RC(float, _get_stream_sampling_rate) + GDVIRTUAL2R_REQUIRED(int, _mix_resampled, GDExtensionPtr<AudioFrame>, int) + GDVIRTUAL0RC_REQUIRED(float, _get_stream_sampling_rate) static void _bind_methods(); diff --git a/servers/extensions/physics_server_2d_extension.h b/servers/extensions/physics_server_2d_extension.h index 6e0277a7c6..7bbd84ddf4 100644 --- a/servers/extensions/physics_server_2d_extension.h +++ b/servers/extensions/physics_server_2d_extension.h @@ -127,53 +127,53 @@ protected: static void _bind_methods(); bool is_body_excluded_from_query(const RID &p_body) const; - GDVIRTUAL7R(bool, _intersect_ray, const Vector2 &, const Vector2 &, uint32_t, bool, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionRayResult>) - GDVIRTUAL7R(int, _intersect_point, const Vector2 &, ObjectID, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeResult>, int) - GDVIRTUAL9R(int, _intersect_shape, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeResult>, int) - GDVIRTUAL9R(bool, _cast_motion, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<real_t>, GDExtensionPtr<real_t>) - GDVIRTUAL10R(bool, _collide_shape, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>) - GDVIRTUAL8R(bool, _rest_info, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeRestInfo>) + GDVIRTUAL7R_REQUIRED(bool, _intersect_ray, const Vector2 &, const Vector2 &, uint32_t, bool, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionRayResult>) + GDVIRTUAL7R_REQUIRED(int, _intersect_point, const Vector2 &, ObjectID, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeResult>, int) + GDVIRTUAL9R_REQUIRED(int, _intersect_shape, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeResult>, int) + GDVIRTUAL9R_REQUIRED(bool, _cast_motion, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<real_t>, GDExtensionPtr<real_t>) + GDVIRTUAL10R_REQUIRED(bool, _collide_shape, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>) + GDVIRTUAL8R_REQUIRED(bool, _rest_info, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeRestInfo>) public: virtual bool intersect_ray(const RayParameters &p_parameters, RayResult &r_result) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_intersect_ray, p_parameters.from, p_parameters.to, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, p_parameters.hit_from_inside, &r_result, ret); + GDVIRTUAL_CALL(_intersect_ray, p_parameters.from, p_parameters.to, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, p_parameters.hit_from_inside, &r_result, ret); exclude = nullptr; return ret; } virtual int intersect_point(const PointParameters &p_parameters, ShapeResult *r_results, int p_result_max) override { exclude = &p_parameters.exclude; int ret = false; - GDVIRTUAL_REQUIRED_CALL(_intersect_point, p_parameters.position, p_parameters.canvas_instance_id, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret); + GDVIRTUAL_CALL(_intersect_point, p_parameters.position, p_parameters.canvas_instance_id, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret); exclude = nullptr; return ret; } virtual int intersect_shape(const ShapeParameters &p_parameters, ShapeResult *r_results, int p_result_max) override { exclude = &p_parameters.exclude; int ret = 0; - GDVIRTUAL_REQUIRED_CALL(_intersect_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret); + GDVIRTUAL_CALL(_intersect_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret); exclude = nullptr; return ret; } virtual bool cast_motion(const ShapeParameters &p_parameters, real_t &p_closest_safe, real_t &p_closest_unsafe) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_cast_motion, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, &p_closest_safe, &p_closest_unsafe, ret); + GDVIRTUAL_CALL(_cast_motion, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, &p_closest_safe, &p_closest_unsafe, ret); exclude = nullptr; return ret; } virtual bool collide_shape(const ShapeParameters &p_parameters, Vector2 *r_results, int p_result_max, int &r_result_count) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_collide_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, &r_result_count, ret); + GDVIRTUAL_CALL(_collide_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, &r_result_count, ret); exclude = nullptr; return ret; } virtual bool rest_info(const ShapeParameters &p_parameters, ShapeRestInfo *r_info) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_rest_info, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_info, ret); + GDVIRTUAL_CALL(_rest_info, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_info, ret); exclude = nullptr; return ret; } @@ -191,9 +191,9 @@ class PhysicsServer2DExtension : public PhysicsServer2D { protected: static void _bind_methods(); - GDVIRTUAL9R(bool, _shape_collide, RID, const Transform2D &, const Vector2 &, RID, const Transform2D &, const Vector2 &, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>) + GDVIRTUAL9R_REQUIRED(bool, _shape_collide, RID, const Transform2D &, const Vector2 &, RID, const Transform2D &, const Vector2 &, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>) - GDVIRTUAL8R(bool, _body_collide_shape, RID, int, RID, const Transform2D &, const Vector2 &, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>) + GDVIRTUAL8R_REQUIRED(bool, _body_collide_shape, RID, int, RID, const Transform2D &, const Vector2 &, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>) public: // The warning is valid, but unavoidable. If the function is not overridden it will error anyway. @@ -218,7 +218,7 @@ public: virtual bool shape_collide(RID p_shape_A, const Transform2D &p_xform_A, const Vector2 &p_motion_A, RID p_shape_B, const Transform2D &p_xform_B, const Vector2 &p_motion_B, Vector2 *r_results, int p_result_max, int &r_result_count) override { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_shape_collide, p_shape_A, p_xform_A, p_motion_A, p_shape_B, p_xform_B, p_motion_B, r_results, p_result_max, &r_result_count, ret); + GDVIRTUAL_CALL(_shape_collide, p_shape_A, p_xform_A, p_motion_A, p_shape_B, p_xform_B, p_motion_B, r_results, p_result_max, &r_result_count, ret); return ret; } @@ -354,11 +354,11 @@ public: EXBIND2(body_add_collision_exception, RID, RID) EXBIND2(body_remove_collision_exception, RID, RID) - GDVIRTUAL1RC(TypedArray<RID>, _body_get_collision_exceptions, RID) + GDVIRTUAL1RC_REQUIRED(TypedArray<RID>, _body_get_collision_exceptions, RID) void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) override { TypedArray<RID> ret; - GDVIRTUAL_REQUIRED_CALL(_body_get_collision_exceptions, p_body, ret); + GDVIRTUAL_CALL(_body_get_collision_exceptions, p_body, ret); for (int i = 0; i < ret.size(); i++) { p_exceptions->push_back(ret[i]); } @@ -378,7 +378,7 @@ public: virtual bool body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, Vector2 *r_results, int p_result_max, int &r_result_count) override { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_body_collide_shape, p_body, p_body_shape, p_shape, p_shape_xform, p_motion, r_results, p_result_max, &r_result_count, ret); + GDVIRTUAL_CALL(_body_collide_shape, p_body, p_body_shape, p_shape, p_shape_xform, p_motion, r_results, p_result_max, &r_result_count, ret); return ret; } @@ -386,7 +386,7 @@ public: EXBIND1R(PhysicsDirectBodyState2D *, body_get_direct_state, RID) - GDVIRTUAL7RC(bool, _body_test_motion, RID, const Transform2D &, const Vector2 &, real_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionMotionResult>) + GDVIRTUAL7RC_REQUIRED(bool, _body_test_motion, RID, const Transform2D &, const Vector2 &, real_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionMotionResult>) thread_local static const HashSet<RID> *exclude_bodies; thread_local static const HashSet<ObjectID> *exclude_objects; @@ -398,7 +398,7 @@ public: bool ret = false; exclude_bodies = &p_parameters.exclude_bodies; exclude_objects = &p_parameters.exclude_objects; - GDVIRTUAL_REQUIRED_CALL(_body_test_motion, p_body, p_parameters.from, p_parameters.motion, p_parameters.margin, p_parameters.collide_separation_ray, p_parameters.recovery_as_collision, r_result, ret); + GDVIRTUAL_CALL(_body_test_motion, p_body, p_parameters.from, p_parameters.motion, p_parameters.margin, p_parameters.collide_separation_ray, p_parameters.recovery_as_collision, r_result, ret); exclude_bodies = nullptr; exclude_objects = nullptr; return ret; @@ -432,9 +432,9 @@ public: /* MISC */ - GDVIRTUAL1(_free_rid, RID) + GDVIRTUAL1_REQUIRED(_free_rid, RID) virtual void free(RID p_rid) override { - GDVIRTUAL_REQUIRED_CALL(_free_rid, p_rid); + GDVIRTUAL_CALL(_free_rid, p_rid); } EXBIND1(set_active, bool) diff --git a/servers/extensions/physics_server_3d_extension.h b/servers/extensions/physics_server_3d_extension.h index eb8b627245..b808b80b93 100644 --- a/servers/extensions/physics_server_3d_extension.h +++ b/servers/extensions/physics_server_3d_extension.h @@ -129,61 +129,61 @@ protected: static void _bind_methods(); bool is_body_excluded_from_query(const RID &p_body) const; - GDVIRTUAL9R(bool, _intersect_ray, const Vector3 &, const Vector3 &, uint32_t, bool, bool, bool, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionRayResult>) - GDVIRTUAL6R(int, _intersect_point, const Vector3 &, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionShapeResult>, int) - GDVIRTUAL9R(int, _intersect_shape, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionShapeResult>, int) - GDVIRTUAL10R(bool, _cast_motion, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<real_t>, GDExtensionPtr<real_t>, GDExtensionPtr<PhysicsServer3DExtensionShapeRestInfo>) - GDVIRTUAL10R(bool, _collide_shape, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<Vector3>, int, GDExtensionPtr<int>) - GDVIRTUAL8R(bool, _rest_info, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionShapeRestInfo>) - GDVIRTUAL2RC(Vector3, _get_closest_point_to_object_volume, RID, const Vector3 &) + GDVIRTUAL9R_REQUIRED(bool, _intersect_ray, const Vector3 &, const Vector3 &, uint32_t, bool, bool, bool, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionRayResult>) + GDVIRTUAL6R_REQUIRED(int, _intersect_point, const Vector3 &, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionShapeResult>, int) + GDVIRTUAL9R_REQUIRED(int, _intersect_shape, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionShapeResult>, int) + GDVIRTUAL10R_REQUIRED(bool, _cast_motion, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<real_t>, GDExtensionPtr<real_t>, GDExtensionPtr<PhysicsServer3DExtensionShapeRestInfo>) + GDVIRTUAL10R_REQUIRED(bool, _collide_shape, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<Vector3>, int, GDExtensionPtr<int>) + GDVIRTUAL8R_REQUIRED(bool, _rest_info, RID, const Transform3D &, const Vector3 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionShapeRestInfo>) + GDVIRTUAL2RC_REQUIRED(Vector3, _get_closest_point_to_object_volume, RID, const Vector3 &) public: virtual bool intersect_ray(const RayParameters &p_parameters, RayResult &r_result) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_intersect_ray, p_parameters.from, p_parameters.to, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, p_parameters.hit_from_inside, p_parameters.hit_back_faces, p_parameters.pick_ray, &r_result, ret); + GDVIRTUAL_CALL(_intersect_ray, p_parameters.from, p_parameters.to, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, p_parameters.hit_from_inside, p_parameters.hit_back_faces, p_parameters.pick_ray, &r_result, ret); exclude = nullptr; return ret; } virtual int intersect_point(const PointParameters &p_parameters, ShapeResult *r_results, int p_result_max) override { exclude = &p_parameters.exclude; int ret = false; - GDVIRTUAL_REQUIRED_CALL(_intersect_point, p_parameters.position, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret); + GDVIRTUAL_CALL(_intersect_point, p_parameters.position, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret); exclude = nullptr; return ret; } virtual int intersect_shape(const ShapeParameters &p_parameters, ShapeResult *r_results, int p_result_max) override { exclude = &p_parameters.exclude; int ret = 0; - GDVIRTUAL_REQUIRED_CALL(_intersect_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret); + GDVIRTUAL_CALL(_intersect_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret); exclude = nullptr; return ret; } virtual bool cast_motion(const ShapeParameters &p_parameters, real_t &p_closest_safe, real_t &p_closest_unsafe, ShapeRestInfo *r_info = nullptr) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_cast_motion, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, &p_closest_safe, &p_closest_unsafe, r_info, ret); + GDVIRTUAL_CALL(_cast_motion, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, &p_closest_safe, &p_closest_unsafe, r_info, ret); exclude = nullptr; return ret; } virtual bool collide_shape(const ShapeParameters &p_parameters, Vector3 *r_results, int p_result_max, int &r_result_count) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_collide_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, &r_result_count, ret); + GDVIRTUAL_CALL(_collide_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, &r_result_count, ret); exclude = nullptr; return ret; } virtual bool rest_info(const ShapeParameters &p_parameters, ShapeRestInfo *r_info) override { exclude = &p_parameters.exclude; bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_rest_info, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_info, ret); + GDVIRTUAL_CALL(_rest_info, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_info, ret); exclude = nullptr; return ret; } virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const override { Vector3 ret; - GDVIRTUAL_REQUIRED_CALL(_get_closest_point_to_object_volume, p_object, p_point, ret); + GDVIRTUAL_CALL(_get_closest_point_to_object_volume, p_object, p_point, ret); return ret; } @@ -359,11 +359,11 @@ public: EXBIND2(body_add_collision_exception, RID, RID) EXBIND2(body_remove_collision_exception, RID, RID) - GDVIRTUAL1RC(TypedArray<RID>, _body_get_collision_exceptions, RID) + GDVIRTUAL1RC_REQUIRED(TypedArray<RID>, _body_get_collision_exceptions, RID) void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) override { TypedArray<RID> ret; - GDVIRTUAL_REQUIRED_CALL(_body_get_collision_exceptions, p_body, ret); + GDVIRTUAL_CALL(_body_get_collision_exceptions, p_body, ret); for (int i = 0; i < ret.size(); i++) { p_exceptions->push_back(ret[i]); } @@ -383,7 +383,7 @@ public: EXBIND2(body_set_ray_pickable, RID, bool) - GDVIRTUAL8RC(bool, _body_test_motion, RID, const Transform3D &, const Vector3 &, real_t, int, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionMotionResult>) + GDVIRTUAL8RC_REQUIRED(bool, _body_test_motion, RID, const Transform3D &, const Vector3 &, real_t, int, bool, bool, GDExtensionPtr<PhysicsServer3DExtensionMotionResult>) thread_local static const HashSet<RID> *exclude_bodies; thread_local static const HashSet<ObjectID> *exclude_objects; @@ -395,7 +395,7 @@ public: bool ret = false; exclude_bodies = &p_parameters.exclude_bodies; exclude_objects = &p_parameters.exclude_objects; - GDVIRTUAL_REQUIRED_CALL(_body_test_motion, p_body, p_parameters.from, p_parameters.motion, p_parameters.margin, p_parameters.max_collisions, p_parameters.collide_separation_ray, p_parameters.recovery_as_collision, r_result, ret); + GDVIRTUAL_CALL(_body_test_motion, p_body, p_parameters.from, p_parameters.motion, p_parameters.margin, p_parameters.max_collisions, p_parameters.collide_separation_ray, p_parameters.recovery_as_collision, r_result, ret); exclude_bodies = nullptr; exclude_objects = nullptr; return ret; @@ -423,11 +423,11 @@ public: EXBIND2(soft_body_add_collision_exception, RID, RID) EXBIND2(soft_body_remove_collision_exception, RID, RID) - GDVIRTUAL1RC(TypedArray<RID>, _soft_body_get_collision_exceptions, RID) + GDVIRTUAL1RC_REQUIRED(TypedArray<RID>, _soft_body_get_collision_exceptions, RID) void soft_body_get_collision_exceptions(RID p_soft_body, List<RID> *p_exceptions) override { TypedArray<RID> ret; - GDVIRTUAL_REQUIRED_CALL(_soft_body_get_collision_exceptions, p_soft_body, ret); + GDVIRTUAL_CALL(_soft_body_get_collision_exceptions, p_soft_body, ret); for (int i = 0; i < ret.size(); i++) { p_exceptions->push_back(ret[i]); } @@ -520,9 +520,9 @@ public: /* MISC */ - GDVIRTUAL1(_free_rid, RID) + GDVIRTUAL1_REQUIRED(_free_rid, RID) virtual void free(RID p_rid) override { - GDVIRTUAL_REQUIRED_CALL(_free_rid, p_rid); + GDVIRTUAL_CALL(_free_rid, p_rid); } EXBIND1(set_active, bool) diff --git a/servers/movie_writer/movie_writer.cpp b/servers/movie_writer/movie_writer.cpp index aebed4b432..14e920d8cd 100644 --- a/servers/movie_writer/movie_writer.cpp +++ b/servers/movie_writer/movie_writer.cpp @@ -54,40 +54,40 @@ MovieWriter *MovieWriter::find_writer_for_file(const String &p_file) { uint32_t MovieWriter::get_audio_mix_rate() const { uint32_t ret = 48000; - GDVIRTUAL_REQUIRED_CALL(_get_audio_mix_rate, ret); + GDVIRTUAL_CALL(_get_audio_mix_rate, ret); return ret; } AudioServer::SpeakerMode MovieWriter::get_audio_speaker_mode() const { AudioServer::SpeakerMode ret = AudioServer::SPEAKER_MODE_STEREO; - GDVIRTUAL_REQUIRED_CALL(_get_audio_speaker_mode, ret); + GDVIRTUAL_CALL(_get_audio_speaker_mode, ret); return ret; } Error MovieWriter::write_begin(const Size2i &p_movie_size, uint32_t p_fps, const String &p_base_path) { Error ret = ERR_UNCONFIGURED; - GDVIRTUAL_REQUIRED_CALL(_write_begin, p_movie_size, p_fps, p_base_path, ret); + GDVIRTUAL_CALL(_write_begin, p_movie_size, p_fps, p_base_path, ret); return ret; } Error MovieWriter::write_frame(const Ref<Image> &p_image, const int32_t *p_audio_data) { Error ret = ERR_UNCONFIGURED; - GDVIRTUAL_REQUIRED_CALL(_write_frame, p_image, p_audio_data, ret); + GDVIRTUAL_CALL(_write_frame, p_image, p_audio_data, ret); return ret; } void MovieWriter::write_end() { - GDVIRTUAL_REQUIRED_CALL(_write_end); + GDVIRTUAL_CALL(_write_end); } bool MovieWriter::handles_file(const String &p_path) const { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_handles_file, p_path, ret); + GDVIRTUAL_CALL(_handles_file, p_path, ret); return ret; } void MovieWriter::get_supported_extensions(List<String> *r_extensions) const { Vector<String> exts; - GDVIRTUAL_REQUIRED_CALL(_get_supported_extensions, exts); + GDVIRTUAL_CALL(_get_supported_extensions, exts); for (int i = 0; i < exts.size(); i++) { r_extensions->push_back(exts[i]); } diff --git a/servers/movie_writer/movie_writer.h b/servers/movie_writer/movie_writer.h index 4757de203c..e1dc8ef8cf 100644 --- a/servers/movie_writer/movie_writer.h +++ b/servers/movie_writer/movie_writer.h @@ -63,15 +63,15 @@ protected: virtual Error write_frame(const Ref<Image> &p_image, const int32_t *p_audio_data); virtual void write_end(); - GDVIRTUAL0RC(uint32_t, _get_audio_mix_rate) - GDVIRTUAL0RC(AudioServer::SpeakerMode, _get_audio_speaker_mode) + GDVIRTUAL0RC_REQUIRED(uint32_t, _get_audio_mix_rate) + GDVIRTUAL0RC_REQUIRED(AudioServer::SpeakerMode, _get_audio_speaker_mode) - GDVIRTUAL1RC(bool, _handles_file, const String &) - GDVIRTUAL0RC(Vector<String>, _get_supported_extensions) + GDVIRTUAL1RC_REQUIRED(bool, _handles_file, const String &) + GDVIRTUAL0RC_REQUIRED(Vector<String>, _get_supported_extensions) - GDVIRTUAL3R(Error, _write_begin, const Size2i &, uint32_t, const String &) - GDVIRTUAL2R(Error, _write_frame, const Ref<Image> &, GDExtensionConstPtr<int32_t>) - GDVIRTUAL0(_write_end) + GDVIRTUAL3R_REQUIRED(Error, _write_begin, const Size2i &, uint32_t, const String &) + GDVIRTUAL2R_REQUIRED(Error, _write_frame, const Ref<Image> &, GDExtensionConstPtr<int32_t>) + GDVIRTUAL0_REQUIRED(_write_end) static void _bind_methods(); diff --git a/servers/physics_server_3d.cpp b/servers/physics_server_3d.cpp index ee48151863..312b67ada9 100644 --- a/servers/physics_server_3d.cpp +++ b/servers/physics_server_3d.cpp @@ -37,13 +37,13 @@ #include "core/variant/typed_array.h" void PhysicsServer3DRenderingServerHandler::set_vertex(int p_vertex_id, const Vector3 &p_vertex) { - GDVIRTUAL_REQUIRED_CALL(_set_vertex, p_vertex_id, p_vertex); + GDVIRTUAL_CALL(_set_vertex, p_vertex_id, p_vertex); } void PhysicsServer3DRenderingServerHandler::set_normal(int p_vertex_id, const Vector3 &p_normal) { - GDVIRTUAL_REQUIRED_CALL(_set_normal, p_vertex_id, p_normal); + GDVIRTUAL_CALL(_set_normal, p_vertex_id, p_normal); } void PhysicsServer3DRenderingServerHandler::set_aabb(const AABB &p_aabb) { - GDVIRTUAL_REQUIRED_CALL(_set_aabb, p_aabb); + GDVIRTUAL_CALL(_set_aabb, p_aabb); } void PhysicsServer3DRenderingServerHandler::_bind_methods() { diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h index ea785fa03f..33def7cf8d 100644 --- a/servers/physics_server_3d.h +++ b/servers/physics_server_3d.h @@ -213,9 +213,9 @@ public: class PhysicsServer3DRenderingServerHandler : public Object { GDCLASS(PhysicsServer3DRenderingServerHandler, Object) protected: - GDVIRTUAL2(_set_vertex, int, const Vector3 &) - GDVIRTUAL2(_set_normal, int, const Vector3 &) - GDVIRTUAL1(_set_aabb, const AABB &) + GDVIRTUAL2_REQUIRED(_set_vertex, int, const Vector3 &) + GDVIRTUAL2_REQUIRED(_set_normal, int, const Vector3 &) + GDVIRTUAL1_REQUIRED(_set_aabb, const AABB &) static void _bind_methods(); diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp index d387c8ff7e..1c0d518e75 100644 --- a/servers/text/text_server_extension.cpp +++ b/servers/text/text_server_extension.cpp @@ -352,29 +352,29 @@ void TextServerExtension::_bind_methods() { bool TextServerExtension::has_feature(Feature p_feature) const { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_has_feature, p_feature, ret); + GDVIRTUAL_CALL(_has_feature, p_feature, ret); return ret; } String TextServerExtension::get_name() const { String ret = "Unknown"; - GDVIRTUAL_REQUIRED_CALL(_get_name, ret); + GDVIRTUAL_CALL(_get_name, ret); return ret; } int64_t TextServerExtension::get_features() const { int64_t ret = 0; - GDVIRTUAL_REQUIRED_CALL(_get_features, ret); + GDVIRTUAL_CALL(_get_features, ret); return ret; } void TextServerExtension::free_rid(const RID &p_rid) { - GDVIRTUAL_REQUIRED_CALL(_free_rid, p_rid); + GDVIRTUAL_CALL(_free_rid, p_rid); } bool TextServerExtension::has(const RID &p_rid) { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_has, p_rid, ret); + GDVIRTUAL_CALL(_has, p_rid, ret); return ret; } @@ -430,7 +430,7 @@ String TextServerExtension::tag_to_name(int64_t p_tag) const { RID TextServerExtension::create_font() { RID ret; - GDVIRTUAL_REQUIRED_CALL(_create_font, ret); + GDVIRTUAL_CALL(_create_font, ret); return ret; } @@ -581,22 +581,22 @@ int64_t TextServerExtension::font_get_msdf_size(const RID &p_font_rid) const { } void TextServerExtension::font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) { - GDVIRTUAL_REQUIRED_CALL(_font_set_fixed_size, p_font_rid, p_fixed_size); + GDVIRTUAL_CALL(_font_set_fixed_size, p_font_rid, p_fixed_size); } int64_t TextServerExtension::font_get_fixed_size(const RID &p_font_rid) const { int64_t ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_fixed_size, p_font_rid, ret); + GDVIRTUAL_CALL(_font_get_fixed_size, p_font_rid, ret); return ret; } void TextServerExtension::font_set_fixed_size_scale_mode(const RID &p_font_rid, TextServer::FixedSizeScaleMode p_fixed_size_scale_mode) { - GDVIRTUAL_REQUIRED_CALL(_font_set_fixed_size_scale_mode, p_font_rid, p_fixed_size_scale_mode); + GDVIRTUAL_CALL(_font_set_fixed_size_scale_mode, p_font_rid, p_fixed_size_scale_mode); } TextServer::FixedSizeScaleMode TextServerExtension::font_get_fixed_size_scale_mode(const RID &p_font_rid) const { FixedSizeScaleMode ret = FIXED_SIZE_SCALE_DISABLE; - GDVIRTUAL_REQUIRED_CALL(_font_get_fixed_size_scale_mode, p_font_rid, ret); + GDVIRTUAL_CALL(_font_get_fixed_size_scale_mode, p_font_rid, ret); return ret; } @@ -702,89 +702,89 @@ double TextServerExtension::font_get_oversampling(const RID &p_font_rid) const { TypedArray<Vector2i> TextServerExtension::font_get_size_cache_list(const RID &p_font_rid) const { TypedArray<Vector2i> ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_size_cache_list, p_font_rid, ret); + GDVIRTUAL_CALL(_font_get_size_cache_list, p_font_rid, ret); return ret; } void TextServerExtension::font_clear_size_cache(const RID &p_font_rid) { - GDVIRTUAL_REQUIRED_CALL(_font_clear_size_cache, p_font_rid); + GDVIRTUAL_CALL(_font_clear_size_cache, p_font_rid); } void TextServerExtension::font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) { - GDVIRTUAL_REQUIRED_CALL(_font_remove_size_cache, p_font_rid, p_size); + GDVIRTUAL_CALL(_font_remove_size_cache, p_font_rid, p_size); } void TextServerExtension::font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) { - GDVIRTUAL_REQUIRED_CALL(_font_set_ascent, p_font_rid, p_size, p_ascent); + GDVIRTUAL_CALL(_font_set_ascent, p_font_rid, p_size, p_ascent); } double TextServerExtension::font_get_ascent(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_ascent, p_font_rid, p_size, ret); + GDVIRTUAL_CALL(_font_get_ascent, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) { - GDVIRTUAL_REQUIRED_CALL(_font_set_descent, p_font_rid, p_size, p_descent); + GDVIRTUAL_CALL(_font_set_descent, p_font_rid, p_size, p_descent); } double TextServerExtension::font_get_descent(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_descent, p_font_rid, p_size, ret); + GDVIRTUAL_CALL(_font_get_descent, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) { - GDVIRTUAL_REQUIRED_CALL(_font_set_underline_position, p_font_rid, p_size, p_underline_position); + GDVIRTUAL_CALL(_font_set_underline_position, p_font_rid, p_size, p_underline_position); } double TextServerExtension::font_get_underline_position(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_underline_position, p_font_rid, p_size, ret); + GDVIRTUAL_CALL(_font_get_underline_position, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) { - GDVIRTUAL_REQUIRED_CALL(_font_set_underline_thickness, p_font_rid, p_size, p_underline_thickness); + GDVIRTUAL_CALL(_font_set_underline_thickness, p_font_rid, p_size, p_underline_thickness); } double TextServerExtension::font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_underline_thickness, p_font_rid, p_size, ret); + GDVIRTUAL_CALL(_font_get_underline_thickness, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) { - GDVIRTUAL_REQUIRED_CALL(_font_set_scale, p_font_rid, p_size, p_scale); + GDVIRTUAL_CALL(_font_set_scale, p_font_rid, p_size, p_scale); } double TextServerExtension::font_get_scale(const RID &p_font_rid, int64_t p_size) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_scale, p_font_rid, p_size, ret); + GDVIRTUAL_CALL(_font_get_scale, p_font_rid, p_size, ret); return ret; } int64_t TextServerExtension::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { int64_t ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_texture_count, p_font_rid, p_size, ret); + GDVIRTUAL_CALL(_font_get_texture_count, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) { - GDVIRTUAL_REQUIRED_CALL(_font_clear_textures, p_font_rid, p_size); + GDVIRTUAL_CALL(_font_clear_textures, p_font_rid, p_size); } void TextServerExtension::font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) { - GDVIRTUAL_REQUIRED_CALL(_font_remove_texture, p_font_rid, p_size, p_texture_index); + GDVIRTUAL_CALL(_font_remove_texture, p_font_rid, p_size, p_texture_index); } void TextServerExtension::font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) { - GDVIRTUAL_REQUIRED_CALL(_font_set_texture_image, p_font_rid, p_size, p_texture_index, p_image); + GDVIRTUAL_CALL(_font_set_texture_image, p_font_rid, p_size, p_texture_index, p_image); } Ref<Image> TextServerExtension::font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { Ref<Image> ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_texture_image, p_font_rid, p_size, p_texture_index, ret); + GDVIRTUAL_CALL(_font_get_texture_image, p_font_rid, p_size, p_texture_index, ret); return ret; } @@ -800,77 +800,77 @@ PackedInt32Array TextServerExtension::font_get_texture_offsets(const RID &p_font PackedInt32Array TextServerExtension::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { PackedInt32Array ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_list, p_font_rid, p_size, ret); + GDVIRTUAL_CALL(_font_get_glyph_list, p_font_rid, p_size, ret); return ret; } void TextServerExtension::font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) { - GDVIRTUAL_REQUIRED_CALL(_font_clear_glyphs, p_font_rid, p_size); + GDVIRTUAL_CALL(_font_clear_glyphs, p_font_rid, p_size); } void TextServerExtension::font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) { - GDVIRTUAL_REQUIRED_CALL(_font_remove_glyph, p_font_rid, p_size, p_glyph); + GDVIRTUAL_CALL(_font_remove_glyph, p_font_rid, p_size, p_glyph); } Vector2 TextServerExtension::font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const { Vector2 ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_advance, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_CALL(_font_get_glyph_advance, p_font_rid, p_size, p_glyph, ret); return ret; } void TextServerExtension::font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) { - GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_advance, p_font_rid, p_size, p_glyph, p_advance); + GDVIRTUAL_CALL(_font_set_glyph_advance, p_font_rid, p_size, p_glyph, p_advance); } Vector2 TextServerExtension::font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Vector2 ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_offset, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_CALL(_font_get_glyph_offset, p_font_rid, p_size, p_glyph, ret); return ret; } void TextServerExtension::font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) { - GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_offset, p_font_rid, p_size, p_glyph, p_offset); + GDVIRTUAL_CALL(_font_set_glyph_offset, p_font_rid, p_size, p_glyph, p_offset); } Vector2 TextServerExtension::font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Vector2 ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_size, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_CALL(_font_get_glyph_size, p_font_rid, p_size, p_glyph, ret); return ret; } void TextServerExtension::font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) { - GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_size, p_font_rid, p_size, p_glyph, p_gl_size); + GDVIRTUAL_CALL(_font_set_glyph_size, p_font_rid, p_size, p_glyph, p_gl_size); } Rect2 TextServerExtension::font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Rect2 ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_uv_rect, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_CALL(_font_get_glyph_uv_rect, p_font_rid, p_size, p_glyph, ret); return ret; } void TextServerExtension::font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) { - GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_uv_rect, p_font_rid, p_size, p_glyph, p_uv_rect); + GDVIRTUAL_CALL(_font_set_glyph_uv_rect, p_font_rid, p_size, p_glyph, p_uv_rect); } int64_t TextServerExtension::font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { int64_t ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_idx, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_CALL(_font_get_glyph_texture_idx, p_font_rid, p_size, p_glyph, ret); return ret; } void TextServerExtension::font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) { - GDVIRTUAL_REQUIRED_CALL(_font_set_glyph_texture_idx, p_font_rid, p_size, p_glyph, p_texture_idx); + GDVIRTUAL_CALL(_font_set_glyph_texture_idx, p_font_rid, p_size, p_glyph, p_texture_idx); } RID TextServerExtension::font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { RID ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_rid, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_CALL(_font_get_glyph_texture_rid, p_font_rid, p_size, p_glyph, ret); return ret; } Size2 TextServerExtension::font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { Size2 ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_texture_size, p_font_rid, p_size, p_glyph, ret); + GDVIRTUAL_CALL(_font_get_glyph_texture_size, p_font_rid, p_size, p_glyph, ret); return ret; } @@ -906,31 +906,31 @@ Vector2 TextServerExtension::font_get_kerning(const RID &p_font_rid, int64_t p_s int64_t TextServerExtension::font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector) const { int64_t ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_glyph_index, p_font_rid, p_size, p_char, p_variation_selector, ret); + GDVIRTUAL_CALL(_font_get_glyph_index, p_font_rid, p_size, p_char, p_variation_selector, ret); return ret; } int64_t TextServerExtension::font_get_char_from_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_glyph_index) const { int64_t ret = 0; - GDVIRTUAL_REQUIRED_CALL(_font_get_char_from_glyph_index, p_font_rid, p_size, p_glyph_index, ret); + GDVIRTUAL_CALL(_font_get_char_from_glyph_index, p_font_rid, p_size, p_glyph_index, ret); return ret; } bool TextServerExtension::font_has_char(const RID &p_font_rid, int64_t p_char) const { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_font_has_char, p_font_rid, p_char, ret); + GDVIRTUAL_CALL(_font_has_char, p_font_rid, p_char, ret); return ret; } String TextServerExtension::font_get_supported_chars(const RID &p_font_rid) const { String ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_supported_chars, p_font_rid, ret); + GDVIRTUAL_CALL(_font_get_supported_chars, p_font_rid, ret); return ret; } PackedInt32Array TextServerExtension::font_get_supported_glyphs(const RID &p_font_rid) const { PackedInt32Array ret; - GDVIRTUAL_REQUIRED_CALL(_font_get_supported_glyphs, p_font_rid, ret); + GDVIRTUAL_CALL(_font_get_supported_glyphs, p_font_rid, ret); return ret; } @@ -943,11 +943,11 @@ void TextServerExtension::font_render_glyph(const RID &p_font_rid, const Vector2 } void TextServerExtension::font_draw_glyph(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { - GDVIRTUAL_REQUIRED_CALL(_font_draw_glyph, p_font_rid, p_canvas, p_size, p_pos, p_index, p_color); + GDVIRTUAL_CALL(_font_draw_glyph, p_font_rid, p_canvas, p_size, p_pos, p_index, p_color); } void TextServerExtension::font_draw_glyph_outline(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { - GDVIRTUAL_REQUIRED_CALL(_font_draw_glyph_outline, p_font_rid, p_canvas, p_size, p_outline_size, p_pos, p_index, p_color); + GDVIRTUAL_CALL(_font_draw_glyph_outline, p_font_rid, p_canvas, p_size, p_outline_size, p_pos, p_index, p_color); } bool TextServerExtension::font_is_language_supported(const RID &p_font_rid, const String &p_language) const { @@ -1054,12 +1054,12 @@ void TextServerExtension::draw_hex_code_box(const RID &p_canvas, int64_t p_size, RID TextServerExtension::create_shaped_text(TextServer::Direction p_direction, TextServer::Orientation p_orientation) { RID ret; - GDVIRTUAL_REQUIRED_CALL(_create_shaped_text, p_direction, p_orientation, ret); + GDVIRTUAL_CALL(_create_shaped_text, p_direction, p_orientation, ret); return ret; } void TextServerExtension::shaped_text_clear(const RID &p_shaped) { - GDVIRTUAL_REQUIRED_CALL(_shaped_text_clear, p_shaped); + GDVIRTUAL_CALL(_shaped_text_clear, p_shaped); } void TextServerExtension::shaped_text_set_direction(const RID &p_shaped, TextServer::Direction p_direction) { @@ -1144,47 +1144,47 @@ int64_t TextServerExtension::shaped_text_get_spacing(const RID &p_shaped, TextSe bool TextServerExtension::shaped_text_add_string(const RID &p_shaped, const String &p_text, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features, const String &p_language, const Variant &p_meta) { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_add_string, p_shaped, p_text, p_fonts, p_size, p_opentype_features, p_language, p_meta, ret); + GDVIRTUAL_CALL(_shaped_text_add_string, p_shaped, p_text, p_fonts, p_size, p_opentype_features, p_language, p_meta, ret); return ret; } bool TextServerExtension::shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length, double p_baseline) { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_add_object, p_shaped, p_key, p_size, p_inline_align, p_length, p_baseline, ret); + GDVIRTUAL_CALL(_shaped_text_add_object, p_shaped, p_key, p_size, p_inline_align, p_length, p_baseline, ret); return ret; } bool TextServerExtension::shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, double p_baseline) { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_resize_object, p_shaped, p_key, p_size, p_inline_align, p_baseline, ret); + GDVIRTUAL_CALL(_shaped_text_resize_object, p_shaped, p_key, p_size, p_inline_align, p_baseline, ret); return ret; } int64_t TextServerExtension::shaped_get_span_count(const RID &p_shaped) const { int64_t ret = 0; - GDVIRTUAL_REQUIRED_CALL(_shaped_get_span_count, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_get_span_count, p_shaped, ret); return ret; } Variant TextServerExtension::shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const { Variant ret = false; - GDVIRTUAL_REQUIRED_CALL(_shaped_get_span_meta, p_shaped, p_index, ret); + GDVIRTUAL_CALL(_shaped_get_span_meta, p_shaped, p_index, ret); return ret; } void TextServerExtension::shaped_set_span_update_font(const RID &p_shaped, int64_t p_index, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features) { - GDVIRTUAL_REQUIRED_CALL(_shaped_set_span_update_font, p_shaped, p_index, p_fonts, p_size, p_opentype_features); + GDVIRTUAL_CALL(_shaped_set_span_update_font, p_shaped, p_index, p_fonts, p_size, p_opentype_features); } RID TextServerExtension::shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const { RID ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_substr, p_shaped, p_start, p_length, ret); + GDVIRTUAL_CALL(_shaped_text_substr, p_shaped, p_start, p_length, ret); return ret; } RID TextServerExtension::shaped_text_get_parent(const RID &p_shaped) const { RID ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_parent, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_parent, p_shaped, ret); return ret; } @@ -1202,7 +1202,7 @@ double TextServerExtension::shaped_text_tab_align(const RID &p_shaped, const Pac bool TextServerExtension::shaped_text_shape(const RID &p_shaped) { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_shape, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_shape, p_shaped, ret); return ret; } @@ -1220,31 +1220,31 @@ bool TextServerExtension::shaped_text_update_justification_ops(const RID &p_shap bool TextServerExtension::shaped_text_is_ready(const RID &p_shaped) const { bool ret = false; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_is_ready, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_is_ready, p_shaped, ret); return ret; } const Glyph *TextServerExtension::shaped_text_get_glyphs(const RID &p_shaped) const { GDExtensionConstPtr<const Glyph> ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_glyphs, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_glyphs, p_shaped, ret); return ret; } const Glyph *TextServerExtension::shaped_text_sort_logical(const RID &p_shaped) { GDExtensionConstPtr<const Glyph> ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_sort_logical, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_sort_logical, p_shaped, ret); return ret; } int64_t TextServerExtension::shaped_text_get_glyph_count(const RID &p_shaped) const { int64_t ret = 0; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_glyph_count, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_glyph_count, p_shaped, ret); return ret; } Vector2i TextServerExtension::shaped_text_get_range(const RID &p_shaped) const { Vector2i ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_range, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_range, p_shaped, ret); return ret; } @@ -1274,25 +1274,25 @@ PackedInt32Array TextServerExtension::shaped_text_get_word_breaks(const RID &p_s int64_t TextServerExtension::shaped_text_get_trim_pos(const RID &p_shaped) const { int64_t ret = -1; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_trim_pos, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_trim_pos, p_shaped, ret); return ret; } int64_t TextServerExtension::shaped_text_get_ellipsis_pos(const RID &p_shaped) const { int64_t ret = -1; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_pos, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_ellipsis_pos, p_shaped, ret); return ret; } const Glyph *TextServerExtension::shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const { GDExtensionConstPtr<const Glyph> ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_glyphs, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_ellipsis_glyphs, p_shaped, ret); return ret; } int64_t TextServerExtension::shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const { int64_t ret = -1; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ellipsis_glyph_count, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_ellipsis_glyph_count, p_shaped, ret); return ret; } @@ -1302,61 +1302,61 @@ void TextServerExtension::shaped_text_overrun_trim_to_width(const RID &p_shaped_ Array TextServerExtension::shaped_text_get_objects(const RID &p_shaped) const { Array ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_objects, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_objects, p_shaped, ret); return ret; } Rect2 TextServerExtension::shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const { Rect2 ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_rect, p_shaped, p_key, ret); + GDVIRTUAL_CALL(_shaped_text_get_object_rect, p_shaped, p_key, ret); return ret; } Vector2i TextServerExtension::shaped_text_get_object_range(const RID &p_shaped, const Variant &p_key) const { Vector2i ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_range, p_shaped, p_key, ret); + GDVIRTUAL_CALL(_shaped_text_get_object_range, p_shaped, p_key, ret); return ret; } int64_t TextServerExtension::shaped_text_get_object_glyph(const RID &p_shaped, const Variant &p_key) const { int64_t ret = -1; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_object_glyph, p_shaped, p_key, ret); + GDVIRTUAL_CALL(_shaped_text_get_object_glyph, p_shaped, p_key, ret); return ret; } Size2 TextServerExtension::shaped_text_get_size(const RID &p_shaped) const { Size2 ret; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_size, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_size, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_ascent(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_ascent, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_ascent, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_descent(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_descent, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_descent, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_width(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_width, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_width, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_underline_position(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_underline_position, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_underline_position, p_shaped, ret); return ret; } double TextServerExtension::shaped_text_get_underline_thickness(const RID &p_shaped) const { double ret = 0; - GDVIRTUAL_REQUIRED_CALL(_shaped_text_get_underline_thickness, p_shaped, ret); + GDVIRTUAL_CALL(_shaped_text_get_underline_thickness, p_shaped, ret); return ret; } diff --git a/servers/text/text_server_extension.h b/servers/text/text_server_extension.h index 52654c010c..bd803be8aa 100644 --- a/servers/text/text_server_extension.h +++ b/servers/text/text_server_extension.h @@ -49,15 +49,15 @@ public: virtual bool has_feature(Feature p_feature) const override; virtual String get_name() const override; virtual int64_t get_features() const override; - GDVIRTUAL1RC(bool, _has_feature, Feature); - GDVIRTUAL0RC(String, _get_name); - GDVIRTUAL0RC(int64_t, _get_features); + GDVIRTUAL1RC_REQUIRED(bool, _has_feature, Feature); + GDVIRTUAL0RC_REQUIRED(String, _get_name); + GDVIRTUAL0RC_REQUIRED(int64_t, _get_features); virtual void free_rid(const RID &p_rid) override; virtual bool has(const RID &p_rid) override; virtual bool load_support_data(const String &p_filename) override; - GDVIRTUAL1(_free_rid, RID); - GDVIRTUAL1R(bool, _has, RID); + GDVIRTUAL1_REQUIRED(_free_rid, RID); + GDVIRTUAL1R_REQUIRED(bool, _has, RID); GDVIRTUAL1R(bool, _load_support_data, const String &); virtual String get_support_data_filename() const override; @@ -78,7 +78,7 @@ public: /* Font interface */ virtual RID create_font() override; - GDVIRTUAL0R(RID, _create_font); + GDVIRTUAL0R_REQUIRED(RID, _create_font); virtual RID create_font_linked_variation(const RID &p_font_rid) override; GDVIRTUAL1R(RID, _create_font_linked_variation, RID); @@ -155,13 +155,13 @@ public: virtual void font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) override; virtual int64_t font_get_fixed_size(const RID &p_font_rid) const override; - GDVIRTUAL2(_font_set_fixed_size, RID, int64_t); - GDVIRTUAL1RC(int64_t, _font_get_fixed_size, RID); + GDVIRTUAL2_REQUIRED(_font_set_fixed_size, RID, int64_t); + GDVIRTUAL1RC_REQUIRED(int64_t, _font_get_fixed_size, RID); virtual void font_set_fixed_size_scale_mode(const RID &p_font_rid, FixedSizeScaleMode p_fixed_size_scale) override; virtual FixedSizeScaleMode font_get_fixed_size_scale_mode(const RID &p_font_rid) const override; - GDVIRTUAL2(_font_set_fixed_size_scale_mode, RID, FixedSizeScaleMode); - GDVIRTUAL1RC(FixedSizeScaleMode, _font_get_fixed_size_scale_mode, RID); + GDVIRTUAL2_REQUIRED(_font_set_fixed_size_scale_mode, RID, FixedSizeScaleMode); + GDVIRTUAL1RC_REQUIRED(FixedSizeScaleMode, _font_get_fixed_size_scale_mode, RID); virtual void font_set_subpixel_positioning(const RID &p_font_rid, SubpixelPositioning p_subpixel) override; virtual SubpixelPositioning font_get_subpixel_positioning(const RID &p_font_rid) const override; @@ -216,46 +216,46 @@ public: 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_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override; - GDVIRTUAL1RC(TypedArray<Vector2i>, _font_get_size_cache_list, RID); - GDVIRTUAL1(_font_clear_size_cache, RID); - GDVIRTUAL2(_font_remove_size_cache, RID, const Vector2i &); + GDVIRTUAL1RC_REQUIRED(TypedArray<Vector2i>, _font_get_size_cache_list, RID); + GDVIRTUAL1_REQUIRED(_font_clear_size_cache, RID); + GDVIRTUAL2_REQUIRED(_font_remove_size_cache, RID, const Vector2i &); virtual void font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) override; virtual double font_get_ascent(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(_font_set_ascent, RID, int64_t, double); - GDVIRTUAL2RC(double, _font_get_ascent, RID, int64_t); + GDVIRTUAL3_REQUIRED(_font_set_ascent, RID, int64_t, double); + GDVIRTUAL2RC_REQUIRED(double, _font_get_ascent, RID, int64_t); virtual void font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) override; virtual double font_get_descent(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(_font_set_descent, RID, int64_t, double); - GDVIRTUAL2RC(double, _font_get_descent, RID, int64_t); + GDVIRTUAL3_REQUIRED(_font_set_descent, RID, int64_t, double); + GDVIRTUAL2RC_REQUIRED(double, _font_get_descent, RID, int64_t); virtual void font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) override; virtual double font_get_underline_position(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(_font_set_underline_position, RID, int64_t, double); - GDVIRTUAL2RC(double, _font_get_underline_position, RID, int64_t); + GDVIRTUAL3_REQUIRED(_font_set_underline_position, RID, int64_t, double); + GDVIRTUAL2RC_REQUIRED(double, _font_get_underline_position, RID, int64_t); virtual void font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) override; virtual double font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(_font_set_underline_thickness, RID, int64_t, double); - GDVIRTUAL2RC(double, _font_get_underline_thickness, RID, int64_t); + GDVIRTUAL3_REQUIRED(_font_set_underline_thickness, RID, int64_t, double); + GDVIRTUAL2RC_REQUIRED(double, _font_get_underline_thickness, RID, int64_t); virtual void font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) override; virtual double font_get_scale(const RID &p_font_rid, int64_t p_size) const override; - GDVIRTUAL3(_font_set_scale, RID, int64_t, double); - GDVIRTUAL2RC(double, _font_get_scale, RID, int64_t); + GDVIRTUAL3_REQUIRED(_font_set_scale, RID, int64_t, double); + GDVIRTUAL2RC_REQUIRED(double, _font_get_scale, RID, int64_t); virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const override; virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) override; - GDVIRTUAL2RC(int64_t, _font_get_texture_count, RID, const Vector2i &); - GDVIRTUAL2(_font_clear_textures, RID, const Vector2i &); - GDVIRTUAL3(_font_remove_texture, RID, const Vector2i &, int64_t); + GDVIRTUAL2RC_REQUIRED(int64_t, _font_get_texture_count, RID, const Vector2i &); + GDVIRTUAL2_REQUIRED(_font_clear_textures, RID, const Vector2i &); + GDVIRTUAL3_REQUIRED(_font_remove_texture, RID, const Vector2i &, int64_t); virtual void font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) override; virtual Ref<Image> font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; - GDVIRTUAL4(_font_set_texture_image, RID, const Vector2i &, int64_t, const Ref<Image> &); - GDVIRTUAL3RC(Ref<Image>, _font_get_texture_image, RID, const Vector2i &, int64_t); + GDVIRTUAL4_REQUIRED(_font_set_texture_image, RID, const Vector2i &, int64_t, const Ref<Image> &); + GDVIRTUAL3RC_REQUIRED(Ref<Image>, _font_get_texture_image, RID, const Vector2i &, int64_t); 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; @@ -265,40 +265,40 @@ public: 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_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override; - GDVIRTUAL2RC(PackedInt32Array, _font_get_glyph_list, RID, const Vector2i &); - GDVIRTUAL2(_font_clear_glyphs, RID, const Vector2i &); - GDVIRTUAL3(_font_remove_glyph, RID, const Vector2i &, int64_t); + GDVIRTUAL2RC_REQUIRED(PackedInt32Array, _font_get_glyph_list, RID, const Vector2i &); + GDVIRTUAL2_REQUIRED(_font_clear_glyphs, RID, const Vector2i &); + GDVIRTUAL3_REQUIRED(_font_remove_glyph, RID, const Vector2i &, int64_t); virtual Vector2 font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const override; virtual void font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) override; - GDVIRTUAL3RC(Vector2, _font_get_glyph_advance, RID, int64_t, int64_t); - GDVIRTUAL4(_font_set_glyph_advance, RID, int64_t, int64_t, const Vector2 &); + GDVIRTUAL3RC_REQUIRED(Vector2, _font_get_glyph_advance, RID, int64_t, int64_t); + GDVIRTUAL4_REQUIRED(_font_set_glyph_advance, RID, int64_t, int64_t, const Vector2 &); virtual Vector2 font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; virtual void font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) override; - GDVIRTUAL3RC(Vector2, _font_get_glyph_offset, RID, const Vector2i &, int64_t); - GDVIRTUAL4(_font_set_glyph_offset, RID, const Vector2i &, int64_t, const Vector2 &); + GDVIRTUAL3RC_REQUIRED(Vector2, _font_get_glyph_offset, RID, const Vector2i &, int64_t); + GDVIRTUAL4_REQUIRED(_font_set_glyph_offset, RID, const Vector2i &, int64_t, const Vector2 &); virtual Vector2 font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; virtual void font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) override; - GDVIRTUAL3RC(Vector2, _font_get_glyph_size, RID, const Vector2i &, int64_t); - GDVIRTUAL4(_font_set_glyph_size, RID, const Vector2i &, int64_t, const Vector2 &); + GDVIRTUAL3RC_REQUIRED(Vector2, _font_get_glyph_size, RID, const Vector2i &, int64_t); + GDVIRTUAL4_REQUIRED(_font_set_glyph_size, RID, const Vector2i &, int64_t, const Vector2 &); virtual Rect2 font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; virtual void font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) override; - GDVIRTUAL3RC(Rect2, _font_get_glyph_uv_rect, RID, const Vector2i &, int64_t); - GDVIRTUAL4(_font_set_glyph_uv_rect, RID, const Vector2i &, int64_t, const Rect2 &); + GDVIRTUAL3RC_REQUIRED(Rect2, _font_get_glyph_uv_rect, RID, const Vector2i &, int64_t); + GDVIRTUAL4_REQUIRED(_font_set_glyph_uv_rect, RID, const Vector2i &, int64_t, const Rect2 &); virtual int64_t font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; virtual void font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) override; - GDVIRTUAL3RC(int64_t, _font_get_glyph_texture_idx, RID, const Vector2i &, int64_t); - GDVIRTUAL4(_font_set_glyph_texture_idx, RID, const Vector2i &, int64_t, int64_t); + GDVIRTUAL3RC_REQUIRED(int64_t, _font_get_glyph_texture_idx, RID, const Vector2i &, int64_t); + GDVIRTUAL4_REQUIRED(_font_set_glyph_texture_idx, RID, const Vector2i &, int64_t, int64_t); virtual RID font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - GDVIRTUAL3RC(RID, _font_get_glyph_texture_rid, RID, const Vector2i &, int64_t); + GDVIRTUAL3RC_REQUIRED(RID, _font_get_glyph_texture_rid, RID, const Vector2i &, int64_t); virtual Size2 font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override; - GDVIRTUAL3RC(Size2, _font_get_glyph_texture_size, RID, const Vector2i &, int64_t); + GDVIRTUAL3RC_REQUIRED(Size2, _font_get_glyph_texture_size, RID, const Vector2i &, int64_t); virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override; GDVIRTUAL3RC(Dictionary, _font_get_glyph_contours, RID, int64_t, int64_t); @@ -316,17 +316,17 @@ public: GDVIRTUAL3RC(Vector2, _font_get_kerning, RID, int64_t, const Vector2i &); virtual int64_t font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector = 0) const override; - GDVIRTUAL4RC(int64_t, _font_get_glyph_index, RID, int64_t, int64_t, int64_t); + GDVIRTUAL4RC_REQUIRED(int64_t, _font_get_glyph_index, RID, int64_t, int64_t, int64_t); virtual int64_t font_get_char_from_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_glyph_index) const override; - GDVIRTUAL3RC(int64_t, _font_get_char_from_glyph_index, RID, int64_t, int64_t); + GDVIRTUAL3RC_REQUIRED(int64_t, _font_get_char_from_glyph_index, RID, int64_t, int64_t); virtual bool font_has_char(const RID &p_font_rid, int64_t p_char) const override; virtual String font_get_supported_chars(const RID &p_font_rid) const override; virtual PackedInt32Array font_get_supported_glyphs(const RID &p_font_rid) const override; - GDVIRTUAL2RC(bool, _font_has_char, RID, int64_t); - GDVIRTUAL1RC(String, _font_get_supported_chars, RID); - GDVIRTUAL1RC(PackedInt32Array, _font_get_supported_glyphs, RID); + GDVIRTUAL2RC_REQUIRED(bool, _font_has_char, RID, int64_t); + GDVIRTUAL1RC_REQUIRED(String, _font_get_supported_chars, RID); + GDVIRTUAL1RC_REQUIRED(PackedInt32Array, _font_get_supported_glyphs, RID); virtual void font_render_range(const RID &p_font, const Vector2i &p_size, int64_t p_start, int64_t p_end) override; virtual void font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) override; @@ -335,8 +335,8 @@ public: virtual void font_draw_glyph(const RID &p_font, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color = Color(1, 1, 1)) const override; virtual void font_draw_glyph_outline(const RID &p_font, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color = Color(1, 1, 1)) const override; - GDVIRTUAL6C(_font_draw_glyph, RID, RID, int64_t, const Vector2 &, int64_t, const Color &); - GDVIRTUAL7C(_font_draw_glyph_outline, RID, RID, int64_t, int64_t, const Vector2 &, int64_t, const Color &); + GDVIRTUAL6C_REQUIRED(_font_draw_glyph, RID, RID, int64_t, const Vector2 &, int64_t, const Color &); + GDVIRTUAL7C_REQUIRED(_font_draw_glyph_outline, RID, RID, int64_t, int64_t, const Vector2 &, int64_t, const Color &); virtual bool font_is_language_supported(const RID &p_font_rid, const String &p_language) const override; virtual void font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) override; @@ -383,10 +383,10 @@ public: /* Shaped text buffer interface */ virtual RID create_shaped_text(Direction p_direction = DIRECTION_AUTO, Orientation p_orientation = ORIENTATION_HORIZONTAL) override; - GDVIRTUAL2R(RID, _create_shaped_text, Direction, Orientation); + GDVIRTUAL2R_REQUIRED(RID, _create_shaped_text, Direction, Orientation); virtual void shaped_text_clear(const RID &p_shaped) override; - GDVIRTUAL1(_shaped_text_clear, RID); + GDVIRTUAL1_REQUIRED(_shaped_text_clear, RID); virtual void shaped_text_set_direction(const RID &p_shaped, Direction p_direction = DIRECTION_AUTO) override; virtual Direction shaped_text_get_direction(const RID &p_shaped) const override; @@ -431,21 +431,21 @@ public: virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) override; virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1, double p_baseline = 0.0) override; virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, double p_baseline = 0.0) override; - GDVIRTUAL7R(bool, _shaped_text_add_string, RID, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &); - GDVIRTUAL6R(bool, _shaped_text_add_object, RID, const Variant &, const Size2 &, InlineAlignment, int64_t, double); - GDVIRTUAL5R(bool, _shaped_text_resize_object, RID, const Variant &, const Size2 &, InlineAlignment, double); + GDVIRTUAL7R_REQUIRED(bool, _shaped_text_add_string, RID, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &); + GDVIRTUAL6R_REQUIRED(bool, _shaped_text_add_object, RID, const Variant &, const Size2 &, InlineAlignment, int64_t, double); + GDVIRTUAL5R_REQUIRED(bool, _shaped_text_resize_object, RID, const Variant &, const Size2 &, InlineAlignment, double); virtual int64_t shaped_get_span_count(const RID &p_shaped) const override; virtual Variant shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const override; virtual void shaped_set_span_update_font(const RID &p_shaped, int64_t p_index, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary()) override; - GDVIRTUAL1RC(int64_t, _shaped_get_span_count, RID); - GDVIRTUAL2RC(Variant, _shaped_get_span_meta, RID, int64_t); - GDVIRTUAL5(_shaped_set_span_update_font, RID, int64_t, const TypedArray<RID> &, int64_t, const Dictionary &); + GDVIRTUAL1RC_REQUIRED(int64_t, _shaped_get_span_count, RID); + GDVIRTUAL2RC_REQUIRED(Variant, _shaped_get_span_meta, RID, int64_t); + GDVIRTUAL5_REQUIRED(_shaped_set_span_update_font, RID, int64_t, const TypedArray<RID> &, int64_t, const Dictionary &); virtual RID shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const override; virtual RID shaped_text_get_parent(const RID &p_shaped) const override; - GDVIRTUAL3RC(RID, _shaped_text_substr, RID, int64_t, int64_t); - GDVIRTUAL1RC(RID, _shaped_text_get_parent, RID); + GDVIRTUAL3RC_REQUIRED(RID, _shaped_text_substr, RID, int64_t, int64_t); + GDVIRTUAL1RC_REQUIRED(RID, _shaped_text_get_parent, RID); virtual double shaped_text_fit_to_width(const RID &p_shaped, double p_width, BitField<TextServer::JustificationFlag> p_jst_flags = JUSTIFICATION_WORD_BOUND | JUSTIFICATION_KASHIDA) override; virtual double shaped_text_tab_align(const RID &p_shaped, const PackedFloat32Array &p_tab_stops) override; @@ -455,22 +455,22 @@ public: virtual bool shaped_text_shape(const RID &p_shaped) override; virtual bool shaped_text_update_breaks(const RID &p_shaped) override; virtual bool shaped_text_update_justification_ops(const RID &p_shaped) override; - GDVIRTUAL1R(bool, _shaped_text_shape, RID); + GDVIRTUAL1R_REQUIRED(bool, _shaped_text_shape, RID); GDVIRTUAL1R(bool, _shaped_text_update_breaks, RID); GDVIRTUAL1R(bool, _shaped_text_update_justification_ops, RID); virtual bool shaped_text_is_ready(const RID &p_shaped) const override; - GDVIRTUAL1RC(bool, _shaped_text_is_ready, RID); + GDVIRTUAL1RC_REQUIRED(bool, _shaped_text_is_ready, RID); virtual const Glyph *shaped_text_get_glyphs(const RID &p_shaped) const override; virtual const Glyph *shaped_text_sort_logical(const RID &p_shaped) override; virtual int64_t shaped_text_get_glyph_count(const RID &p_shaped) const override; - GDVIRTUAL1RC(GDExtensionConstPtr<const Glyph>, _shaped_text_get_glyphs, RID); - GDVIRTUAL1R(GDExtensionConstPtr<const Glyph>, _shaped_text_sort_logical, RID); - GDVIRTUAL1RC(int64_t, _shaped_text_get_glyph_count, RID); + GDVIRTUAL1RC_REQUIRED(GDExtensionConstPtr<const Glyph>, _shaped_text_get_glyphs, RID); + GDVIRTUAL1R_REQUIRED(GDExtensionConstPtr<const Glyph>, _shaped_text_sort_logical, RID); + GDVIRTUAL1RC_REQUIRED(int64_t, _shaped_text_get_glyph_count, RID); virtual Vector2i shaped_text_get_range(const RID &p_shaped) const override; - GDVIRTUAL1RC(Vector2i, _shaped_text_get_range, RID); + GDVIRTUAL1RC_REQUIRED(Vector2i, _shaped_text_get_range, RID); virtual PackedInt32Array shaped_text_get_line_breaks_adv(const RID &p_shaped, const PackedFloat32Array &p_width, int64_t p_start = 0, bool p_once = true, BitField<TextServer::LineBreakFlag> p_break_flags = BREAK_MANDATORY | BREAK_WORD_BOUND) const override; virtual PackedInt32Array shaped_text_get_line_breaks(const RID &p_shaped, double p_width, int64_t p_start = 0, BitField<TextServer::LineBreakFlag> p_break_flags = BREAK_MANDATORY | BREAK_WORD_BOUND) const override; @@ -483,10 +483,10 @@ public: virtual int64_t shaped_text_get_ellipsis_pos(const RID &p_shaped) const override; virtual const Glyph *shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const override; virtual int64_t shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const override; - GDVIRTUAL1RC(int64_t, _shaped_text_get_trim_pos, RID); - GDVIRTUAL1RC(int64_t, _shaped_text_get_ellipsis_pos, RID); - GDVIRTUAL1RC(GDExtensionConstPtr<const Glyph>, _shaped_text_get_ellipsis_glyphs, RID); - GDVIRTUAL1RC(int64_t, _shaped_text_get_ellipsis_glyph_count, RID); + GDVIRTUAL1RC_REQUIRED(int64_t, _shaped_text_get_trim_pos, RID); + GDVIRTUAL1RC_REQUIRED(int64_t, _shaped_text_get_ellipsis_pos, RID); + GDVIRTUAL1RC_REQUIRED(GDExtensionConstPtr<const Glyph>, _shaped_text_get_ellipsis_glyphs, RID); + GDVIRTUAL1RC_REQUIRED(int64_t, _shaped_text_get_ellipsis_glyph_count, RID); virtual void shaped_text_overrun_trim_to_width(const RID &p_shaped, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) override; GDVIRTUAL3(_shaped_text_overrun_trim_to_width, RID, double, BitField<TextServer::TextOverrunFlag>); @@ -495,10 +495,10 @@ public: virtual Rect2 shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const override; virtual Vector2i shaped_text_get_object_range(const RID &p_shaped, const Variant &p_key) const override; virtual int64_t shaped_text_get_object_glyph(const RID &p_shaped, const Variant &p_key) const override; - GDVIRTUAL1RC(Array, _shaped_text_get_objects, RID); - GDVIRTUAL2RC(Rect2, _shaped_text_get_object_rect, RID, const Variant &); - GDVIRTUAL2RC(Vector2i, _shaped_text_get_object_range, RID, const Variant &); - GDVIRTUAL2RC(int64_t, _shaped_text_get_object_glyph, RID, const Variant &); + GDVIRTUAL1RC_REQUIRED(Array, _shaped_text_get_objects, RID); + GDVIRTUAL2RC_REQUIRED(Rect2, _shaped_text_get_object_rect, RID, const Variant &); + GDVIRTUAL2RC_REQUIRED(Vector2i, _shaped_text_get_object_range, RID, const Variant &); + GDVIRTUAL2RC_REQUIRED(int64_t, _shaped_text_get_object_glyph, RID, const Variant &); virtual Size2 shaped_text_get_size(const RID &p_shaped) const override; virtual double shaped_text_get_ascent(const RID &p_shaped) const override; @@ -506,12 +506,12 @@ public: virtual double shaped_text_get_width(const RID &p_shaped) const override; virtual double shaped_text_get_underline_position(const RID &p_shaped) const override; virtual double shaped_text_get_underline_thickness(const RID &p_shaped) const override; - GDVIRTUAL1RC(Size2, _shaped_text_get_size, RID); - GDVIRTUAL1RC(double, _shaped_text_get_ascent, RID); - GDVIRTUAL1RC(double, _shaped_text_get_descent, RID); - GDVIRTUAL1RC(double, _shaped_text_get_width, RID); - GDVIRTUAL1RC(double, _shaped_text_get_underline_position, RID); - GDVIRTUAL1RC(double, _shaped_text_get_underline_thickness, RID); + GDVIRTUAL1RC_REQUIRED(Size2, _shaped_text_get_size, RID); + GDVIRTUAL1RC_REQUIRED(double, _shaped_text_get_ascent, RID); + GDVIRTUAL1RC_REQUIRED(double, _shaped_text_get_descent, RID); + GDVIRTUAL1RC_REQUIRED(double, _shaped_text_get_width, RID); + GDVIRTUAL1RC_REQUIRED(double, _shaped_text_get_underline_position, RID); + GDVIRTUAL1RC_REQUIRED(double, _shaped_text_get_underline_thickness, RID); virtual Direction shaped_text_get_dominant_direction_in_range(const RID &p_shaped, int64_t p_start, int64_t p_end) const override; GDVIRTUAL3RC(int64_t, _shaped_text_get_dominant_direction_in_range, RID, int64_t, int64_t); |