diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2021-09-30 12:56:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 12:56:01 +0200 |
commit | ac7505e27730a800c9167ab940216c3980257b5b (patch) | |
tree | 6544521a289e8e851bd8e145b6a7685756fb03ea /modules | |
parent | b8c92828146ba22e2bb205da73aecc0619581829 (diff) | |
parent | ba65730cbf744b19f5f357cb6a0e4e748ea5f9f9 (diff) |
Merge pull request #53227 from Calinou/rename-getornull
Rename RID's `getornull()` to `get_or_null()`
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/bullet_physics_server.cpp | 360 | ||||
-rw-r--r-- | modules/bullet/space_bullet.cpp | 8 | ||||
-rw-r--r-- | modules/navigation/godot_navigation_server.cpp | 82 | ||||
-rw-r--r-- | modules/raycast/raycast_occlusion_cull.cpp | 14 | ||||
-rw-r--r-- | modules/text_server_adv/text_server_adv.cpp | 240 | ||||
-rw-r--r-- | modules/text_server_fb/text_server_fb.cpp | 228 |
6 files changed, 466 insertions, 466 deletions
diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp index ed05e51e53..3054debaec 100644 --- a/modules/bullet/bullet_physics_server.cpp +++ b/modules/bullet/bullet_physics_server.cpp @@ -124,7 +124,7 @@ RID BulletPhysicsServer3D::shape_create(ShapeType p_shape) { } void BulletPhysicsServer3D::shape_set_data(RID p_shape, const Variant &p_data) { - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND(!shape); shape->set_data(p_data); } @@ -134,25 +134,25 @@ void BulletPhysicsServer3D::shape_set_custom_solver_bias(RID p_shape, real_t p_b } PhysicsServer3D::ShapeType BulletPhysicsServer3D::shape_get_type(RID p_shape) const { - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND_V(!shape, PhysicsServer3D::SHAPE_CUSTOM); return shape->get_type(); } Variant BulletPhysicsServer3D::shape_get_data(RID p_shape) const { - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND_V(!shape, Variant()); return shape->get_data(); } void BulletPhysicsServer3D::shape_set_margin(RID p_shape, real_t p_margin) { - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND(!shape); shape->set_margin(p_margin); } real_t BulletPhysicsServer3D::shape_get_margin(RID p_shape) const { - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND_V(!shape, 0.0); return shape->get_margin(); } @@ -168,7 +168,7 @@ RID BulletPhysicsServer3D::space_create() { } void BulletPhysicsServer3D::space_set_active(RID p_space, bool p_active) { - SpaceBullet *space = space_owner.getornull(p_space); + SpaceBullet *space = space_owner.get_or_null(p_space); ERR_FAIL_COND(!space); if (space_is_active(p_space) == p_active) { @@ -185,47 +185,47 @@ void BulletPhysicsServer3D::space_set_active(RID p_space, bool p_active) { } bool BulletPhysicsServer3D::space_is_active(RID p_space) const { - SpaceBullet *space = space_owner.getornull(p_space); + SpaceBullet *space = space_owner.get_or_null(p_space); ERR_FAIL_COND_V(!space, false); return -1 != active_spaces.find(space); } void BulletPhysicsServer3D::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) { - SpaceBullet *space = space_owner.getornull(p_space); + SpaceBullet *space = space_owner.get_or_null(p_space); ERR_FAIL_COND(!space); space->set_param(p_param, p_value); } real_t BulletPhysicsServer3D::space_get_param(RID p_space, SpaceParameter p_param) const { - SpaceBullet *space = space_owner.getornull(p_space); + SpaceBullet *space = space_owner.get_or_null(p_space); ERR_FAIL_COND_V(!space, 0); return space->get_param(p_param); } PhysicsDirectSpaceState3D *BulletPhysicsServer3D::space_get_direct_state(RID p_space) { - SpaceBullet *space = space_owner.getornull(p_space); + SpaceBullet *space = space_owner.get_or_null(p_space); ERR_FAIL_COND_V(!space, nullptr); return space->get_direct_state(); } void BulletPhysicsServer3D::space_set_debug_contacts(RID p_space, int p_max_contacts) { - SpaceBullet *space = space_owner.getornull(p_space); + SpaceBullet *space = space_owner.get_or_null(p_space); ERR_FAIL_COND(!space); space->set_debug_contacts(p_max_contacts); } Vector<Vector3> BulletPhysicsServer3D::space_get_contacts(RID p_space) const { - SpaceBullet *space = space_owner.getornull(p_space); + SpaceBullet *space = space_owner.get_or_null(p_space); ERR_FAIL_COND_V(!space, Vector<Vector3>()); return space->get_debug_contacts(); } int BulletPhysicsServer3D::space_get_contact_count(RID p_space) const { - SpaceBullet *space = space_owner.getornull(p_space); + SpaceBullet *space = space_owner.get_or_null(p_space); ERR_FAIL_COND_V(!space, 0); return space->get_debug_contact_count(); @@ -239,91 +239,91 @@ RID BulletPhysicsServer3D::area_create() { } void BulletPhysicsServer3D::area_set_space(RID p_area, RID p_space) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); SpaceBullet *space = nullptr; if (p_space.is_valid()) { - space = space_owner.getornull(p_space); + space = space_owner.get_or_null(p_space); ERR_FAIL_COND(!space); } area->set_space(space); } RID BulletPhysicsServer3D::area_get_space(RID p_area) const { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); return area->get_space()->get_self(); } void BulletPhysicsServer3D::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_spOv_mode(p_mode); } PhysicsServer3D::AreaSpaceOverrideMode BulletPhysicsServer3D::area_get_space_override_mode(RID p_area) const { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND_V(!area, PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED); return area->get_spOv_mode(); } void BulletPhysicsServer3D::area_add_shape(RID p_area, RID p_shape, const Transform3D &p_transform, bool p_disabled) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND(!shape); area->add_shape(shape, p_transform, p_disabled); } void BulletPhysicsServer3D::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND(!shape); area->set_shape(p_shape_idx, shape); } void BulletPhysicsServer3D::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform3D &p_transform) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_shape_transform(p_shape_idx, p_transform); } int BulletPhysicsServer3D::area_get_shape_count(RID p_area) const { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND_V(!area, 0); return area->get_shape_count(); } RID BulletPhysicsServer3D::area_get_shape(RID p_area, int p_shape_idx) const { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND_V(!area, RID()); return area->get_shape(p_shape_idx)->get_self(); } Transform3D BulletPhysicsServer3D::area_get_shape_transform(RID p_area, int p_shape_idx) const { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND_V(!area, Transform3D()); return area->get_shape_transform(p_shape_idx); } void BulletPhysicsServer3D::area_remove_shape(RID p_area, int p_shape_idx) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); return area->remove_shape_full(p_shape_idx); } void BulletPhysicsServer3D::area_clear_shapes(RID p_area) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); for (int i = area->get_shape_count(); 0 < i; --i) { @@ -332,7 +332,7 @@ void BulletPhysicsServer3D::area_clear_shapes(RID p_area) { } void BulletPhysicsServer3D::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_shape_disabled(p_shape_idx, p_disabled); @@ -342,7 +342,7 @@ void BulletPhysicsServer3D::area_attach_object_instance_id(RID p_area, ObjectID if (space_owner.owns(p_area)) { return; } - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_instance_id(p_id); } @@ -351,19 +351,19 @@ ObjectID BulletPhysicsServer3D::area_get_object_instance_id(RID p_area) const { if (space_owner.owns(p_area)) { return ObjectID(); } - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND_V(!area, ObjectID()); return area->get_instance_id(); } void BulletPhysicsServer3D::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) { if (space_owner.owns(p_area)) { - SpaceBullet *space = space_owner.getornull(p_area); + SpaceBullet *space = space_owner.get_or_null(p_area); if (space) { space->set_param(p_param, p_value); } } else { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_param(p_param, p_value); @@ -372,10 +372,10 @@ void BulletPhysicsServer3D::area_set_param(RID p_area, AreaParameter p_param, co Variant BulletPhysicsServer3D::area_get_param(RID p_area, AreaParameter p_param) const { if (space_owner.owns(p_area)) { - SpaceBullet *space = space_owner.getornull(p_area); + SpaceBullet *space = space_owner.get_or_null(p_area); return space->get_param(p_param); } else { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND_V(!area, Variant()); return area->get_param(p_param); @@ -383,52 +383,52 @@ Variant BulletPhysicsServer3D::area_get_param(RID p_area, AreaParameter p_param) } void BulletPhysicsServer3D::area_set_transform(RID p_area, const Transform3D &p_transform) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_transform(p_transform); } Transform3D BulletPhysicsServer3D::area_get_transform(RID p_area) const { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND_V(!area, Transform3D()); return area->get_transform(); } void BulletPhysicsServer3D::area_set_collision_mask(RID p_area, uint32_t p_mask) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_collision_mask(p_mask); } void BulletPhysicsServer3D::area_set_collision_layer(RID p_area, uint32_t p_layer) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_collision_layer(p_layer); } void BulletPhysicsServer3D::area_set_monitorable(RID p_area, bool p_monitorable) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_monitorable(p_monitorable); } void BulletPhysicsServer3D::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_event_callback(CollisionObjectBullet::TYPE_RIGID_BODY, p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method); } void BulletPhysicsServer3D::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_event_callback(CollisionObjectBullet::TYPE_AREA, p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method); } void BulletPhysicsServer3D::area_set_ray_pickable(RID p_area, bool p_enable) { - AreaBullet *area = area_owner.getornull(p_area); + AreaBullet *area = area_owner.get_or_null(p_area); ERR_FAIL_COND(!area); area->set_ray_pickable(p_enable); } @@ -445,12 +445,12 @@ RID BulletPhysicsServer3D::body_create(BodyMode p_mode, bool p_init_sleeping) { } void BulletPhysicsServer3D::body_set_space(RID p_body, RID p_space) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); SpaceBullet *space = nullptr; if (p_space.is_valid()) { - space = space_owner.getornull(p_space); + space = space_owner.get_or_null(p_space); ERR_FAIL_COND(!space); } @@ -462,7 +462,7 @@ void BulletPhysicsServer3D::body_set_space(RID p_body, RID p_space) { } RID BulletPhysicsServer3D::body_get_space(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, RID()); SpaceBullet *space = body->get_space(); @@ -473,52 +473,52 @@ RID BulletPhysicsServer3D::body_get_space(RID p_body) const { } void BulletPhysicsServer3D::body_set_mode(RID p_body, PhysicsServer3D::BodyMode p_mode) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_mode(p_mode); } PhysicsServer3D::BodyMode BulletPhysicsServer3D::body_get_mode(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, BODY_MODE_STATIC); return body->get_mode(); } void BulletPhysicsServer3D::body_add_shape(RID p_body, RID p_shape, const Transform3D &p_transform, bool p_disabled) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND(!shape); body->add_shape(shape, p_transform, p_disabled); } void BulletPhysicsServer3D::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); - ShapeBullet *shape = shape_owner.getornull(p_shape); + ShapeBullet *shape = shape_owner.get_or_null(p_shape); ERR_FAIL_COND(!shape); body->set_shape(p_shape_idx, shape); } void BulletPhysicsServer3D::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform3D &p_transform) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_shape_transform(p_shape_idx, p_transform); } int BulletPhysicsServer3D::body_get_shape_count(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_shape_count(); } RID BulletPhysicsServer3D::body_get_shape(RID p_body, int p_shape_idx) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, RID()); ShapeBullet *shape = body->get_shape(p_shape_idx); @@ -528,27 +528,27 @@ RID BulletPhysicsServer3D::body_get_shape(RID p_body, int p_shape_idx) const { } Transform3D BulletPhysicsServer3D::body_get_shape_transform(RID p_body, int p_shape_idx) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, Transform3D()); return body->get_shape_transform(p_shape_idx); } void BulletPhysicsServer3D::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_shape_disabled(p_shape_idx, p_disabled); } void BulletPhysicsServer3D::body_remove_shape(RID p_body, int p_shape_idx) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->remove_shape_full(p_shape_idx); } void BulletPhysicsServer3D::body_clear_shapes(RID p_body) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->remove_all_shapes(); @@ -569,42 +569,42 @@ ObjectID BulletPhysicsServer3D::body_get_object_instance_id(RID p_body) const { } void BulletPhysicsServer3D::body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_continuous_collision_detection(p_enable); } bool BulletPhysicsServer3D::body_is_continuous_collision_detection_enabled(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, false); return body->is_continuous_collision_detection_enabled(); } void BulletPhysicsServer3D::body_set_collision_layer(RID p_body, uint32_t p_layer) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_collision_layer(p_layer); } uint32_t BulletPhysicsServer3D::body_get_collision_layer(RID p_body) const { - const RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + const RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_collision_layer(); } void BulletPhysicsServer3D::body_set_collision_mask(RID p_body, uint32_t p_mask) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_collision_mask(p_mask); } uint32_t BulletPhysicsServer3D::body_get_collision_mask(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_collision_mask(); @@ -620,21 +620,21 @@ uint32_t BulletPhysicsServer3D::body_get_user_flags(RID p_body) const { } void BulletPhysicsServer3D::body_set_param(RID p_body, BodyParameter p_param, real_t p_value) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_param(p_param, p_value); } real_t BulletPhysicsServer3D::body_get_param(RID p_body, BodyParameter p_param) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_param(p_param); } void BulletPhysicsServer3D::body_set_kinematic_safe_margin(RID p_body, real_t p_margin) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); if (body->get_kinematic_utilities()) { @@ -643,7 +643,7 @@ void BulletPhysicsServer3D::body_set_kinematic_safe_margin(RID p_body, real_t p_ } real_t BulletPhysicsServer3D::body_get_kinematic_safe_margin(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); if (body->get_kinematic_utilities()) { @@ -654,90 +654,90 @@ real_t BulletPhysicsServer3D::body_get_kinematic_safe_margin(RID p_body) const { } void BulletPhysicsServer3D::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_state(p_state, p_variant); } Variant BulletPhysicsServer3D::body_get_state(RID p_body, BodyState p_state) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, Variant()); return body->get_state(p_state); } void BulletPhysicsServer3D::body_set_applied_force(RID p_body, const Vector3 &p_force) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_applied_force(p_force); } Vector3 BulletPhysicsServer3D::body_get_applied_force(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, Vector3()); return body->get_applied_force(); } void BulletPhysicsServer3D::body_set_applied_torque(RID p_body, const Vector3 &p_torque) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_applied_torque(p_torque); } Vector3 BulletPhysicsServer3D::body_get_applied_torque(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, Vector3()); return body->get_applied_torque(); } void BulletPhysicsServer3D::body_add_central_force(RID p_body, const Vector3 &p_force) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->apply_central_force(p_force); } void BulletPhysicsServer3D::body_add_force(RID p_body, const Vector3 &p_force, const Vector3 &p_position) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->apply_force(p_force, p_position); } void BulletPhysicsServer3D::body_add_torque(RID p_body, const Vector3 &p_torque) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->apply_torque(p_torque); } void BulletPhysicsServer3D::body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->apply_central_impulse(p_impulse); } void BulletPhysicsServer3D::body_apply_impulse(RID p_body, const Vector3 &p_impulse, const Vector3 &p_position) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->apply_impulse(p_impulse, p_position); } void BulletPhysicsServer3D::body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->apply_torque_impulse(p_impulse); } void BulletPhysicsServer3D::body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); Vector3 v = body->get_linear_velocity(); @@ -748,39 +748,39 @@ void BulletPhysicsServer3D::body_set_axis_velocity(RID p_body, const Vector3 &p_ } void BulletPhysicsServer3D::body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_axis_lock(p_axis, p_lock); } bool BulletPhysicsServer3D::body_is_axis_locked(RID p_body, BodyAxis p_axis) const { - const RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + const RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); return body->is_axis_locked(p_axis); } void BulletPhysicsServer3D::body_add_collision_exception(RID p_body, RID p_body_b) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); - RigidBodyBullet *other_body = rigid_body_owner.getornull(p_body_b); + RigidBodyBullet *other_body = rigid_body_owner.get_or_null(p_body_b); ERR_FAIL_COND(!other_body); body->add_collision_exception(other_body); } void BulletPhysicsServer3D::body_remove_collision_exception(RID p_body, RID p_body_b) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); - RigidBodyBullet *other_body = rigid_body_owner.getornull(p_body_b); + RigidBodyBullet *other_body = rigid_body_owner.get_or_null(p_body_b); ERR_FAIL_COND(!other_body); body->remove_collision_exception(other_body); } void BulletPhysicsServer3D::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); for (int i = 0; i < body->get_exceptions().size(); i++) { p_exceptions->push_back(body->get_exceptions()[i]); @@ -788,14 +788,14 @@ void BulletPhysicsServer3D::body_get_collision_exceptions(RID p_body, List<RID> } void BulletPhysicsServer3D::body_set_max_contacts_reported(RID p_body, int p_contacts) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_max_collisions_detection(p_contacts); } int BulletPhysicsServer3D::body_get_max_contacts_reported(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_max_collisions_detection(); @@ -811,39 +811,39 @@ real_t BulletPhysicsServer3D::body_get_contacts_reported_depth_threshold(RID p_b } void BulletPhysicsServer3D::body_set_omit_force_integration(RID p_body, bool p_omit) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_omit_forces_integration(p_omit); } bool BulletPhysicsServer3D::body_is_omitting_force_integration(RID p_body) const { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, false); return body->get_omit_forces_integration(); } void BulletPhysicsServer3D::body_set_force_integration_callback(RID p_body, const Callable &p_callable, const Variant &p_udata) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_force_integration_callback(p_callable, p_udata); } void BulletPhysicsServer3D::body_set_ray_pickable(RID p_body, bool p_enable) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_ray_pickable(p_enable); } PhysicsDirectBodyState3D *BulletPhysicsServer3D::body_get_direct_state(RID p_body) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, nullptr); return BulletPhysicsDirectBodyState3D::get_singleton(body); } bool BulletPhysicsServer3D::body_test_motion(RID p_body, const Transform3D &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result, bool p_exclude_raycast_shapes, const Set<RID> &p_exclude) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, false); ERR_FAIL_COND_V(!body->get_space(), false); @@ -851,7 +851,7 @@ bool BulletPhysicsServer3D::body_test_motion(RID p_body, const Transform3D &p_fr } int BulletPhysicsServer3D::body_test_ray_separation(RID p_body, const Transform3D &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, real_t p_margin) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_body); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); ERR_FAIL_COND_V(!body->get_space(), 0); @@ -869,19 +869,19 @@ RID BulletPhysicsServer3D::soft_body_create(bool p_init_sleeping) { } void BulletPhysicsServer3D::soft_body_update_rendering_server(RID p_body, RenderingServerHandler *p_rendering_server_handler) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->update_rendering_server(p_rendering_server_handler); } void BulletPhysicsServer3D::soft_body_set_space(RID p_body, RID p_space) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); SpaceBullet *space = nullptr; if (p_space.is_valid()) { - space = space_owner.getornull(p_space); + space = space_owner.get_or_null(p_space); ERR_FAIL_COND(!space); } @@ -893,7 +893,7 @@ void BulletPhysicsServer3D::soft_body_set_space(RID p_body, RID p_space) { } RID BulletPhysicsServer3D::soft_body_get_space(RID p_body) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, RID()); SpaceBullet *space = body->get_space(); @@ -904,7 +904,7 @@ RID BulletPhysicsServer3D::soft_body_get_space(RID p_body) const { } void BulletPhysicsServer3D::soft_body_set_mesh(RID p_body, const REF &p_mesh) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_soft_mesh(p_mesh); @@ -918,40 +918,40 @@ AABB BulletPhysicsServer::soft_body_get_bounds(RID p_body) const { } void BulletPhysicsServer3D::soft_body_set_collision_layer(RID p_body, uint32_t p_layer) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_collision_layer(p_layer); } uint32_t BulletPhysicsServer3D::soft_body_get_collision_layer(RID p_body) const { - const SoftBodyBullet *body = soft_body_owner.getornull(p_body); + const SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_collision_layer(); } void BulletPhysicsServer3D::soft_body_set_collision_mask(RID p_body, uint32_t p_mask) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_collision_mask(p_mask); } uint32_t BulletPhysicsServer3D::soft_body_get_collision_mask(RID p_body) const { - const SoftBodyBullet *body = soft_body_owner.getornull(p_body); + const SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_collision_mask(); } void BulletPhysicsServer3D::soft_body_add_collision_exception(RID p_body, RID p_body_b) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); - CollisionObjectBullet *other_body = rigid_body_owner.getornull(p_body_b); + CollisionObjectBullet *other_body = rigid_body_owner.get_or_null(p_body_b); if (!other_body) { - other_body = soft_body_owner.getornull(p_body_b); + other_body = soft_body_owner.get_or_null(p_body_b); } ERR_FAIL_COND(!other_body); @@ -959,12 +959,12 @@ void BulletPhysicsServer3D::soft_body_add_collision_exception(RID p_body, RID p_ } void BulletPhysicsServer3D::soft_body_remove_collision_exception(RID p_body, RID p_body_b) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); - CollisionObjectBullet *other_body = rigid_body_owner.getornull(p_body_b); + CollisionObjectBullet *other_body = rigid_body_owner.get_or_null(p_body_b); if (!other_body) { - other_body = soft_body_owner.getornull(p_body_b); + other_body = soft_body_owner.get_or_null(p_body_b); } ERR_FAIL_COND(!other_body); @@ -972,7 +972,7 @@ void BulletPhysicsServer3D::soft_body_remove_collision_exception(RID p_body, RID } void BulletPhysicsServer3D::soft_body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); for (int i = 0; i < body->get_exceptions().size(); i++) { p_exceptions->push_back(body->get_exceptions()[i]); @@ -991,98 +991,98 @@ Variant BulletPhysicsServer3D::soft_body_get_state(RID p_body, BodyState p_state } void BulletPhysicsServer3D::soft_body_set_transform(RID p_body, const Transform3D &p_transform) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_soft_transform(p_transform); } void BulletPhysicsServer3D::soft_body_set_ray_pickable(RID p_body, bool p_enable) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_ray_pickable(p_enable); } void BulletPhysicsServer3D::soft_body_set_simulation_precision(RID p_body, int p_simulation_precision) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_simulation_precision(p_simulation_precision); } int BulletPhysicsServer3D::soft_body_get_simulation_precision(RID p_body) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_simulation_precision(); } void BulletPhysicsServer3D::soft_body_set_total_mass(RID p_body, real_t p_total_mass) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_total_mass(p_total_mass); } real_t BulletPhysicsServer3D::soft_body_get_total_mass(RID p_body) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_total_mass(); } void BulletPhysicsServer3D::soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_linear_stiffness(p_stiffness); } real_t BulletPhysicsServer3D::soft_body_get_linear_stiffness(RID p_body) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_linear_stiffness(); } void BulletPhysicsServer3D::soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_pressure_coefficient(p_pressure_coefficient); } real_t BulletPhysicsServer3D::soft_body_get_pressure_coefficient(RID p_body) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_pressure_coefficient(); } void BulletPhysicsServer3D::soft_body_set_damping_coefficient(RID p_body, real_t p_damping_coefficient) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_damping_coefficient(p_damping_coefficient); } real_t BulletPhysicsServer3D::soft_body_get_damping_coefficient(RID p_body) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_damping_coefficient(); } void BulletPhysicsServer3D::soft_body_set_drag_coefficient(RID p_body, real_t p_drag_coefficient) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_drag_coefficient(p_drag_coefficient); } real_t BulletPhysicsServer3D::soft_body_get_drag_coefficient(RID p_body) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_drag_coefficient(); } void BulletPhysicsServer3D::soft_body_move_point(RID p_body, int p_point_index, const Vector3 &p_global_position) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_node_position(p_point_index, p_global_position); } Vector3 BulletPhysicsServer3D::soft_body_get_point_global_position(RID p_body, int p_point_index) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, Vector3(0., 0., 0.)); Vector3 pos; body->get_node_position(p_point_index, pos); @@ -1090,25 +1090,25 @@ Vector3 BulletPhysicsServer3D::soft_body_get_point_global_position(RID p_body, i } void BulletPhysicsServer3D::soft_body_remove_all_pinned_points(RID p_body) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->reset_all_node_mass(); } void BulletPhysicsServer3D::soft_body_pin_point(RID p_body, int p_point_index, bool p_pin) { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND(!body); body->set_node_mass(p_point_index, p_pin ? 0 : 1); } bool BulletPhysicsServer3D::soft_body_is_point_pinned(RID p_body, int p_point_index) const { - SoftBodyBullet *body = soft_body_owner.getornull(p_body); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_node_mass(p_point_index); } PhysicsServer3D::JointType BulletPhysicsServer3D::joint_get_type(RID p_joint) const { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, JOINT_PIN); return joint->get_type(); } @@ -1123,28 +1123,28 @@ int BulletPhysicsServer3D::joint_get_solver_priority(RID p_joint) const { } void BulletPhysicsServer3D::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); joint->disable_collisions_between_bodies(p_disable); } bool BulletPhysicsServer3D::joint_is_disabled_collisions_between_bodies(RID p_joint) const { - JointBullet *joint(joint_owner.getornull(p_joint)); + JointBullet *joint(joint_owner.get_or_null(p_joint)); ERR_FAIL_COND_V(!joint, false); return joint->is_disabled_collisions_between_bodies(); } RID BulletPhysicsServer3D::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) { - RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); + RigidBodyBullet *body_A = rigid_body_owner.get_or_null(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { - body_B = rigid_body_owner.getornull(p_body_B); + body_B = rigid_body_owner.get_or_null(p_body_B); JointAssertSpace(body_B, "B", RID()); JointAssertSameSpace(body_A, body_B, RID()); } @@ -1158,7 +1158,7 @@ RID BulletPhysicsServer3D::joint_create_pin(RID p_body_A, const Vector3 &p_local } void BulletPhysicsServer3D::pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_PIN); PinJointBullet *pin_joint = static_cast<PinJointBullet *>(joint); @@ -1166,7 +1166,7 @@ void BulletPhysicsServer3D::pin_joint_set_param(RID p_joint, PinJointParam p_par } real_t BulletPhysicsServer3D::pin_joint_get_param(RID p_joint, PinJointParam p_param) const { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, 0); PinJointBullet *pin_joint = static_cast<PinJointBullet *>(joint); @@ -1174,7 +1174,7 @@ real_t BulletPhysicsServer3D::pin_joint_get_param(RID p_joint, PinJointParam p_p } void BulletPhysicsServer3D::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_PIN); PinJointBullet *pin_joint = static_cast<PinJointBullet *>(joint); @@ -1182,7 +1182,7 @@ void BulletPhysicsServer3D::pin_joint_set_local_a(RID p_joint, const Vector3 &p_ } Vector3 BulletPhysicsServer3D::pin_joint_get_local_a(RID p_joint) const { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, Vector3()); ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3()); PinJointBullet *pin_joint = static_cast<PinJointBullet *>(joint); @@ -1190,7 +1190,7 @@ Vector3 BulletPhysicsServer3D::pin_joint_get_local_a(RID p_joint) const { } void BulletPhysicsServer3D::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_PIN); PinJointBullet *pin_joint = static_cast<PinJointBullet *>(joint); @@ -1198,7 +1198,7 @@ void BulletPhysicsServer3D::pin_joint_set_local_b(RID p_joint, const Vector3 &p_ } Vector3 BulletPhysicsServer3D::pin_joint_get_local_b(RID p_joint) const { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, Vector3()); ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3()); PinJointBullet *pin_joint = static_cast<PinJointBullet *>(joint); @@ -1206,13 +1206,13 @@ Vector3 BulletPhysicsServer3D::pin_joint_get_local_b(RID p_joint) const { } RID BulletPhysicsServer3D::joint_create_hinge(RID p_body_A, const Transform3D &p_hinge_A, RID p_body_B, const Transform3D &p_hinge_B) { - RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); + RigidBodyBullet *body_A = rigid_body_owner.get_or_null(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { - body_B = rigid_body_owner.getornull(p_body_B); + body_B = rigid_body_owner.get_or_null(p_body_B); JointAssertSpace(body_B, "B", RID()); JointAssertSameSpace(body_A, body_B, RID()); } @@ -1226,13 +1226,13 @@ RID BulletPhysicsServer3D::joint_create_hinge(RID p_body_A, const Transform3D &p } RID BulletPhysicsServer3D::joint_create_hinge_simple(RID p_body_A, const Vector3 &p_pivot_A, const Vector3 &p_axis_A, RID p_body_B, const Vector3 &p_pivot_B, const Vector3 &p_axis_B) { - RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); + RigidBodyBullet *body_A = rigid_body_owner.get_or_null(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { - body_B = rigid_body_owner.getornull(p_body_B); + body_B = rigid_body_owner.get_or_null(p_body_B); JointAssertSpace(body_B, "B", RID()); JointAssertSameSpace(body_A, body_B, RID()); } @@ -1246,7 +1246,7 @@ RID BulletPhysicsServer3D::joint_create_hinge_simple(RID p_body_A, const Vector3 } void BulletPhysicsServer3D::hinge_joint_set_param(RID p_joint, HingeJointParam p_param, real_t p_value) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_HINGE); HingeJointBullet *hinge_joint = static_cast<HingeJointBullet *>(joint); @@ -1254,7 +1254,7 @@ void BulletPhysicsServer3D::hinge_joint_set_param(RID p_joint, HingeJointParam p } real_t BulletPhysicsServer3D::hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, 0); HingeJointBullet *hinge_joint = static_cast<HingeJointBullet *>(joint); @@ -1262,7 +1262,7 @@ real_t BulletPhysicsServer3D::hinge_joint_get_param(RID p_joint, HingeJointParam } void BulletPhysicsServer3D::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_value) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_HINGE); HingeJointBullet *hinge_joint = static_cast<HingeJointBullet *>(joint); @@ -1270,7 +1270,7 @@ void BulletPhysicsServer3D::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_f } bool BulletPhysicsServer3D::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, false); ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, false); HingeJointBullet *hinge_joint = static_cast<HingeJointBullet *>(joint); @@ -1278,13 +1278,13 @@ bool BulletPhysicsServer3D::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_f } RID BulletPhysicsServer3D::joint_create_slider(RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) { - RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); + RigidBodyBullet *body_A = rigid_body_owner.get_or_null(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { - body_B = rigid_body_owner.getornull(p_body_B); + body_B = rigid_body_owner.get_or_null(p_body_B); JointAssertSpace(body_B, "B", RID()); JointAssertSameSpace(body_A, body_B, RID()); } @@ -1298,7 +1298,7 @@ RID BulletPhysicsServer3D::joint_create_slider(RID p_body_A, const Transform3D & } void BulletPhysicsServer3D::slider_joint_set_param(RID p_joint, SliderJointParam p_param, real_t p_value) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_SLIDER); SliderJointBullet *slider_joint = static_cast<SliderJointBullet *>(joint); @@ -1306,7 +1306,7 @@ void BulletPhysicsServer3D::slider_joint_set_param(RID p_joint, SliderJointParam } real_t BulletPhysicsServer3D::slider_joint_get_param(RID p_joint, SliderJointParam p_param) const { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_SLIDER, 0); SliderJointBullet *slider_joint = static_cast<SliderJointBullet *>(joint); @@ -1314,13 +1314,13 @@ real_t BulletPhysicsServer3D::slider_joint_get_param(RID p_joint, SliderJointPar } RID BulletPhysicsServer3D::joint_create_cone_twist(RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) { - RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); + RigidBodyBullet *body_A = rigid_body_owner.get_or_null(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { - body_B = rigid_body_owner.getornull(p_body_B); + body_B = rigid_body_owner.get_or_null(p_body_B); JointAssertSpace(body_B, "B", RID()); JointAssertSameSpace(body_A, body_B, RID()); } @@ -1332,7 +1332,7 @@ RID BulletPhysicsServer3D::joint_create_cone_twist(RID p_body_A, const Transform } void BulletPhysicsServer3D::cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, real_t p_value) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_CONE_TWIST); ConeTwistJointBullet *coneTwist_joint = static_cast<ConeTwistJointBullet *>(joint); @@ -1340,7 +1340,7 @@ void BulletPhysicsServer3D::cone_twist_joint_set_param(RID p_joint, ConeTwistJoi } real_t BulletPhysicsServer3D::cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, 0.); ERR_FAIL_COND_V(joint->get_type() != JOINT_CONE_TWIST, 0.); ConeTwistJointBullet *coneTwist_joint = static_cast<ConeTwistJointBullet *>(joint); @@ -1348,13 +1348,13 @@ real_t BulletPhysicsServer3D::cone_twist_joint_get_param(RID p_joint, ConeTwistJ } RID BulletPhysicsServer3D::joint_create_generic_6dof(RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) { - RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); + RigidBodyBullet *body_A = rigid_body_owner.get_or_null(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { - body_B = rigid_body_owner.getornull(p_body_B); + body_B = rigid_body_owner.get_or_null(p_body_B); JointAssertSpace(body_B, "B", RID()); JointAssertSameSpace(body_A, body_B, RID()); } @@ -1368,7 +1368,7 @@ RID BulletPhysicsServer3D::joint_create_generic_6dof(RID p_body_A, const Transfo } void BulletPhysicsServer3D::generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, real_t p_value) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_6DOF); Generic6DOFJointBullet *generic_6dof_joint = static_cast<Generic6DOFJointBullet *>(joint); @@ -1376,7 +1376,7 @@ void BulletPhysicsServer3D::generic_6dof_joint_set_param(RID p_joint, Vector3::A } real_t BulletPhysicsServer3D::generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, 0); Generic6DOFJointBullet *generic_6dof_joint = static_cast<Generic6DOFJointBullet *>(joint); @@ -1384,7 +1384,7 @@ real_t BulletPhysicsServer3D::generic_6dof_joint_get_param(RID p_joint, Vector3: } void BulletPhysicsServer3D::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_6DOF); Generic6DOFJointBullet *generic_6dof_joint = static_cast<Generic6DOFJointBullet *>(joint); @@ -1392,7 +1392,7 @@ void BulletPhysicsServer3D::generic_6dof_joint_set_flag(RID p_joint, Vector3::Ax } bool BulletPhysicsServer3D::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) { - JointBullet *joint = joint_owner.getornull(p_joint); + JointBullet *joint = joint_owner.get_or_null(p_joint); ERR_FAIL_COND_V(!joint, false); ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, false); Generic6DOFJointBullet *generic_6dof_joint = static_cast<Generic6DOFJointBullet *>(joint); @@ -1401,7 +1401,7 @@ bool BulletPhysicsServer3D::generic_6dof_joint_get_flag(RID p_joint, Vector3::Ax void BulletPhysicsServer3D::free(RID p_rid) { if (shape_owner.owns(p_rid)) { - ShapeBullet *shape = shape_owner.getornull(p_rid); + ShapeBullet *shape = shape_owner.get_or_null(p_rid); // Notify the shape is configured for (Map<ShapeOwnerBullet *, int>::Element *element = shape->get_owners().front(); element; element = element->next()) { @@ -1411,7 +1411,7 @@ void BulletPhysicsServer3D::free(RID p_rid) { shape_owner.free(p_rid); bulletdelete(shape); } else if (rigid_body_owner.owns(p_rid)) { - RigidBodyBullet *body = rigid_body_owner.getornull(p_rid); + RigidBodyBullet *body = rigid_body_owner.get_or_null(p_rid); body->set_space(nullptr); @@ -1421,7 +1421,7 @@ void BulletPhysicsServer3D::free(RID p_rid) { bulletdelete(body); } else if (soft_body_owner.owns(p_rid)) { - SoftBodyBullet *body = soft_body_owner.getornull(p_rid); + SoftBodyBullet *body = soft_body_owner.get_or_null(p_rid); body->set_space(nullptr); @@ -1429,7 +1429,7 @@ void BulletPhysicsServer3D::free(RID p_rid) { bulletdelete(body); } else if (area_owner.owns(p_rid)) { - AreaBullet *area = area_owner.getornull(p_rid); + AreaBullet *area = area_owner.get_or_null(p_rid); area->set_space(nullptr); @@ -1439,13 +1439,13 @@ void BulletPhysicsServer3D::free(RID p_rid) { bulletdelete(area); } else if (joint_owner.owns(p_rid)) { - JointBullet *joint = joint_owner.getornull(p_rid); + JointBullet *joint = joint_owner.get_or_null(p_rid); joint->destroy_internal_constraint(); joint_owner.free(p_rid); bulletdelete(joint); } else if (space_owner.owns(p_rid)) { - SpaceBullet *space = space_owner.getornull(p_rid); + SpaceBullet *space = space_owner.get_or_null(p_rid); space->remove_all_collision_objects(); @@ -1493,38 +1493,38 @@ int BulletPhysicsServer3D::get_process_info(ProcessInfo p_info) { SpaceBullet *BulletPhysicsServer3D::get_space(RID p_rid) const { ERR_FAIL_COND_V_MSG(space_owner.owns(p_rid) == false, nullptr, "The RID is not valid."); - return space_owner.getornull(p_rid); + return space_owner.get_or_null(p_rid); } ShapeBullet *BulletPhysicsServer3D::get_shape(RID p_rid) const { ERR_FAIL_COND_V_MSG(shape_owner.owns(p_rid) == false, nullptr, "The RID is not valid."); - return shape_owner.getornull(p_rid); + return shape_owner.get_or_null(p_rid); } CollisionObjectBullet *BulletPhysicsServer3D::get_collision_object(RID p_object) const { if (rigid_body_owner.owns(p_object)) { - return rigid_body_owner.getornull(p_object); + return rigid_body_owner.get_or_null(p_object); } if (area_owner.owns(p_object)) { - return area_owner.getornull(p_object); + return area_owner.get_or_null(p_object); } if (soft_body_owner.owns(p_object)) { - return soft_body_owner.getornull(p_object); + return soft_body_owner.get_or_null(p_object); } ERR_FAIL_V_MSG(nullptr, "The RID is no valid."); } RigidCollisionObjectBullet *BulletPhysicsServer3D::get_rigid_collision_object(RID p_object) const { if (rigid_body_owner.owns(p_object)) { - return rigid_body_owner.getornull(p_object); + return rigid_body_owner.get_or_null(p_object); } if (area_owner.owns(p_object)) { - return area_owner.getornull(p_object); + return area_owner.get_or_null(p_object); } ERR_FAIL_V_MSG(nullptr, "The RID is no valid."); } JointBullet *BulletPhysicsServer3D::get_joint(RID p_rid) const { ERR_FAIL_COND_V_MSG(joint_owner.owns(p_rid) == false, nullptr, "The RID is not valid."); - return joint_owner.getornull(p_rid); + return joint_owner.get_or_null(p_rid); } diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp index 0cfd658bd5..66d7370bd7 100644 --- a/modules/bullet/space_bullet.cpp +++ b/modules/bullet/space_bullet.cpp @@ -122,7 +122,7 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra return 0; } - ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); + ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get_or_null(p_shape); ERR_FAIL_COND_V(!shape, 0); btCollisionShape *btShape = shape->create_bt_shape(p_xform.basis.get_scale_abs(), p_margin); @@ -158,7 +158,7 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf btVector3 bt_motion; G_TO_B(p_motion, bt_motion); - ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); + ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get_or_null(p_shape); ERR_FAIL_COND_V(!shape, false); btCollisionShape *btShape = shape->create_bt_shape(p_xform.basis.get_scale(), p_margin); @@ -219,7 +219,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform3D return false; } - ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); + ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get_or_null(p_shape); ERR_FAIL_COND_V(!shape, false); btCollisionShape *btShape = shape->create_bt_shape(p_shape_xform.basis.get_scale_abs(), p_margin); @@ -251,7 +251,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform3D } bool BulletPhysicsDirectSpaceState::rest_info(RID p_shape, const Transform3D &p_shape_xform, real_t p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) { - ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape); + ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get_or_null(p_shape); ERR_FAIL_COND_V(!shape, false); btCollisionShape *btShape = shape->create_bt_shape(p_shape_xform.basis.get_scale_abs(), p_margin); diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp index fd965674d6..f600f07c87 100644 --- a/modules/navigation/godot_navigation_server.cpp +++ b/modules/navigation/godot_navigation_server.cpp @@ -133,13 +133,13 @@ RID GodotNavigationServer::map_create() const { GodotNavigationServer *mut_this = const_cast<GodotNavigationServer *>(this); MutexLock lock(mut_this->operations_mutex); RID rid = map_owner.make_rid(); - NavMap *space = map_owner.getornull(rid); + NavMap *space = map_owner.get_or_null(rid); space->set_self(rid); return rid; } COMMAND_2(map_set_active, RID, p_map, bool, p_active) { - NavMap *map = map_owner.getornull(p_map); + NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND(map == nullptr); if (p_active) { @@ -156,84 +156,84 @@ COMMAND_2(map_set_active, RID, p_map, bool, p_active) { } bool GodotNavigationServer::map_is_active(RID p_map) const { - NavMap *map = map_owner.getornull(p_map); + NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, false); return active_maps.find(map) >= 0; } COMMAND_2(map_set_up, RID, p_map, Vector3, p_up) { - NavMap *map = map_owner.getornull(p_map); + NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND(map == nullptr); map->set_up(p_up); } Vector3 GodotNavigationServer::map_get_up(RID p_map) const { - const NavMap *map = map_owner.getornull(p_map); + const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, Vector3()); return map->get_up(); } COMMAND_2(map_set_cell_size, RID, p_map, real_t, p_cell_size) { - NavMap *map = map_owner.getornull(p_map); + NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND(map == nullptr); map->set_cell_size(p_cell_size); } real_t GodotNavigationServer::map_get_cell_size(RID p_map) const { - const NavMap *map = map_owner.getornull(p_map); + const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, 0); return map->get_cell_size(); } COMMAND_2(map_set_edge_connection_margin, RID, p_map, real_t, p_connection_margin) { - NavMap *map = map_owner.getornull(p_map); + NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND(map == nullptr); map->set_edge_connection_margin(p_connection_margin); } real_t GodotNavigationServer::map_get_edge_connection_margin(RID p_map) const { - const NavMap *map = map_owner.getornull(p_map); + const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, 0); return map->get_edge_connection_margin(); } Vector<Vector3> GodotNavigationServer::map_get_path(RID p_map, Vector3 p_origin, Vector3 p_destination, bool p_optimize, uint32_t p_layers) const { - const NavMap *map = map_owner.getornull(p_map); + const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, Vector<Vector3>()); return map->get_path(p_origin, p_destination, p_optimize, p_layers); } Vector3 GodotNavigationServer::map_get_closest_point_to_segment(RID p_map, const Vector3 &p_from, const Vector3 &p_to, const bool p_use_collision) const { - const NavMap *map = map_owner.getornull(p_map); + const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, Vector3()); return map->get_closest_point_to_segment(p_from, p_to, p_use_collision); } Vector3 GodotNavigationServer::map_get_closest_point(RID p_map, const Vector3 &p_point) const { - const NavMap *map = map_owner.getornull(p_map); + const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, Vector3()); return map->get_closest_point(p_point); } Vector3 GodotNavigationServer::map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const { - const NavMap *map = map_owner.getornull(p_map); + const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, Vector3()); return map->get_closest_point_normal(p_point); } RID GodotNavigationServer::map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const { - const NavMap *map = map_owner.getornull(p_map); + const NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND_V(map == nullptr, RID()); return map->get_closest_point_owner(p_point); @@ -243,13 +243,13 @@ RID GodotNavigationServer::region_create() const { GodotNavigationServer *mut_this = const_cast<GodotNavigationServer *>(this); MutexLock lock(mut_this->operations_mutex); RID rid = region_owner.make_rid(); - NavRegion *reg = region_owner.getornull(rid); + NavRegion *reg = region_owner.get_or_null(rid); reg->set_self(rid); return rid; } COMMAND_2(region_set_map, RID, p_region, RID, p_map) { - NavRegion *region = region_owner.getornull(p_region); + NavRegion *region = region_owner.get_or_null(p_region); ERR_FAIL_COND(region == nullptr); if (region->get_map() != nullptr) { @@ -262,7 +262,7 @@ COMMAND_2(region_set_map, RID, p_region, RID, p_map) { } if (p_map.is_valid()) { - NavMap *map = map_owner.getornull(p_map); + NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND(map == nullptr); map->add_region(region); @@ -271,28 +271,28 @@ COMMAND_2(region_set_map, RID, p_region, RID, p_map) { } COMMAND_2(region_set_transform, RID, p_region, Transform3D, p_transform) { - NavRegion *region = region_owner.getornull(p_region); + NavRegion *region = region_owner.get_or_null(p_region); ERR_FAIL_COND(region == nullptr); region->set_transform(p_transform); } COMMAND_2(region_set_layers, RID, p_region, uint32_t, p_layers) { - NavRegion *region = region_owner.getornull(p_region); + NavRegion *region = region_owner.get_or_null(p_region); ERR_FAIL_COND(region == nullptr); region->set_layers(p_layers); } uint32_t GodotNavigationServer::region_get_layers(RID p_region) const { - NavRegion *region = region_owner.getornull(p_region); + NavRegion *region = region_owner.get_or_null(p_region); ERR_FAIL_COND_V(region == nullptr, 0); return region->get_layers(); } COMMAND_2(region_set_navmesh, RID, p_region, Ref<NavigationMesh>, p_nav_mesh) { - NavRegion *region = region_owner.getornull(p_region); + NavRegion *region = region_owner.get_or_null(p_region); ERR_FAIL_COND(region == nullptr); region->set_mesh(p_nav_mesh); @@ -309,21 +309,21 @@ void GodotNavigationServer::region_bake_navmesh(Ref<NavigationMesh> r_mesh, Node } int GodotNavigationServer::region_get_connections_count(RID p_region) const { - NavRegion *region = region_owner.getornull(p_region); + NavRegion *region = region_owner.get_or_null(p_region); ERR_FAIL_COND_V(!region, 0); return region->get_connections_count(); } Vector3 GodotNavigationServer::region_get_connection_pathway_start(RID p_region, int p_connection_id) const { - NavRegion *region = region_owner.getornull(p_region); + NavRegion *region = region_owner.get_or_null(p_region); ERR_FAIL_COND_V(!region, Vector3()); return region->get_connection_pathway_start(p_connection_id); } Vector3 GodotNavigationServer::region_get_connection_pathway_end(RID p_region, int p_connection_id) const { - NavRegion *region = region_owner.getornull(p_region); + NavRegion *region = region_owner.get_or_null(p_region); ERR_FAIL_COND_V(!region, Vector3()); return region->get_connection_pathway_end(p_connection_id); @@ -333,13 +333,13 @@ RID GodotNavigationServer::agent_create() const { GodotNavigationServer *mut_this = const_cast<GodotNavigationServer *>(this); MutexLock lock(mut_this->operations_mutex); RID rid = agent_owner.make_rid(); - RvoAgent *agent = agent_owner.getornull(rid); + RvoAgent *agent = agent_owner.get_or_null(rid); agent->set_self(rid); return rid; } COMMAND_2(agent_set_map, RID, p_agent, RID, p_map) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); if (agent->get_map()) { @@ -353,7 +353,7 @@ COMMAND_2(agent_set_map, RID, p_agent, RID, p_map) { agent->set_map(nullptr); if (p_map.is_valid()) { - NavMap *map = map_owner.getornull(p_map); + NavMap *map = map_owner.get_or_null(p_map); ERR_FAIL_COND(map == nullptr); agent->set_map(map); @@ -366,77 +366,77 @@ COMMAND_2(agent_set_map, RID, p_agent, RID, p_map) { } COMMAND_2(agent_set_neighbor_dist, RID, p_agent, real_t, p_dist) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->neighborDist_ = p_dist; } COMMAND_2(agent_set_max_neighbors, RID, p_agent, int, p_count) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->maxNeighbors_ = p_count; } COMMAND_2(agent_set_time_horizon, RID, p_agent, real_t, p_time) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->timeHorizon_ = p_time; } COMMAND_2(agent_set_radius, RID, p_agent, real_t, p_radius) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->radius_ = p_radius; } COMMAND_2(agent_set_max_speed, RID, p_agent, real_t, p_max_speed) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->maxSpeed_ = p_max_speed; } COMMAND_2(agent_set_velocity, RID, p_agent, Vector3, p_velocity) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->velocity_ = RVO::Vector3(p_velocity.x, p_velocity.y, p_velocity.z); } COMMAND_2(agent_set_target_velocity, RID, p_agent, Vector3, p_velocity) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->prefVelocity_ = RVO::Vector3(p_velocity.x, p_velocity.y, p_velocity.z); } COMMAND_2(agent_set_position, RID, p_agent, Vector3, p_position) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->position_ = RVO::Vector3(p_position.x, p_position.y, p_position.z); } COMMAND_2(agent_set_ignore_y, RID, p_agent, bool, p_ignore) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->get_agent()->ignore_y_ = p_ignore; } bool GodotNavigationServer::agent_is_map_changed(RID p_agent) const { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND_V(agent == nullptr, false); return agent->is_map_changed(); } COMMAND_4(agent_set_callback, RID, p_agent, Object *, p_receiver, StringName, p_method, Variant, p_udata) { - RvoAgent *agent = agent_owner.getornull(p_agent); + RvoAgent *agent = agent_owner.get_or_null(p_agent); ERR_FAIL_COND(agent == nullptr); agent->set_callback(p_receiver == nullptr ? ObjectID() : p_receiver->get_instance_id(), p_method, p_udata); @@ -452,7 +452,7 @@ COMMAND_4(agent_set_callback, RID, p_agent, Object *, p_receiver, StringName, p_ COMMAND_1(free, RID, p_object) { if (map_owner.owns(p_object)) { - NavMap *map = map_owner.getornull(p_object); + NavMap *map = map_owner.get_or_null(p_object); // Removes any assigned region std::vector<NavRegion *> regions = map->get_regions(); @@ -474,7 +474,7 @@ COMMAND_1(free, RID, p_object) { map_owner.free(p_object); } else if (region_owner.owns(p_object)) { - NavRegion *region = region_owner.getornull(p_object); + NavRegion *region = region_owner.get_or_null(p_object); // Removes this region from the map if assigned if (region->get_map() != nullptr) { @@ -485,7 +485,7 @@ COMMAND_1(free, RID, p_object) { region_owner.free(p_object); } else if (agent_owner.owns(p_object)) { - RvoAgent *agent = agent_owner.getornull(p_object); + RvoAgent *agent = agent_owner.get_or_null(p_object); // Removes this agent from the map if assigned if (agent->get_map() != nullptr) { diff --git a/modules/raycast/raycast_occlusion_cull.cpp b/modules/raycast/raycast_occlusion_cull.cpp index a55b81c05d..3975e83797 100644 --- a/modules/raycast/raycast_occlusion_cull.cpp +++ b/modules/raycast/raycast_occlusion_cull.cpp @@ -207,7 +207,7 @@ void RaycastOcclusionCull::occluder_initialize(RID p_occluder) { } void RaycastOcclusionCull::occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) { - Occluder *occluder = occluder_owner.getornull(p_occluder); + Occluder *occluder = occluder_owner.get_or_null(p_occluder); ERR_FAIL_COND(!occluder); occluder->vertices = p_vertices; @@ -228,7 +228,7 @@ void RaycastOcclusionCull::occluder_set_mesh(RID p_occluder, const PackedVector3 } void RaycastOcclusionCull::free_occluder(RID p_occluder) { - Occluder *occluder = occluder_owner.getornull(p_occluder); + Occluder *occluder = occluder_owner.get_or_null(p_occluder); ERR_FAIL_COND(!occluder); memdelete(occluder); occluder_owner.free(p_occluder); @@ -268,7 +268,7 @@ void RaycastOcclusionCull::scenario_set_instance(RID p_scenario, RID p_instance, bool changed = false; if (instance.occluder != p_occluder) { - Occluder *old_occluder = occluder_owner.getornull(instance.occluder); + Occluder *old_occluder = occluder_owner.get_or_null(instance.occluder); if (old_occluder) { old_occluder->users.erase(InstanceID(p_scenario, p_instance)); } @@ -276,7 +276,7 @@ void RaycastOcclusionCull::scenario_set_instance(RID p_scenario, RID p_instance, instance.occluder = p_occluder; if (p_occluder.is_valid()) { - Occluder *occluder = occluder_owner.getornull(p_occluder); + Occluder *occluder = occluder_owner.get_or_null(p_occluder); ERR_FAIL_COND(!occluder); occluder->users.insert(InstanceID(p_scenario, p_instance)); } @@ -308,7 +308,7 @@ void RaycastOcclusionCull::scenario_remove_instance(RID p_scenario, RID p_instan OccluderInstance &instance = scenario.instances[p_instance]; if (!instance.removed) { - Occluder *occluder = occluder_owner.getornull(instance.occluder); + Occluder *occluder = occluder_owner.get_or_null(instance.occluder); if (occluder) { occluder->users.erase(InstanceID(p_scenario, p_instance)); } @@ -330,7 +330,7 @@ void RaycastOcclusionCull::Scenario::_update_dirty_instance(int p_idx, RID *p_in return; } - Occluder *occ = raycast_singleton->occluder_owner.getornull(occ_inst->occluder); + Occluder *occ = raycast_singleton->occluder_owner.get_or_null(occ_inst->occluder); if (!occ) { return; @@ -446,7 +446,7 @@ bool RaycastOcclusionCull::Scenario::update(ThreadWorkPool &p_thread_pool) { const RID *inst_rid = nullptr; while ((inst_rid = instances.next(inst_rid))) { OccluderInstance *occ_inst = instances.getptr(*inst_rid); - Occluder *occ = raycast_singleton->occluder_owner.getornull(occ_inst->occluder); + Occluder *occ = raycast_singleton->occluder_owner.get_or_null(occ_inst->occluder); if (!occ || !occ_inst->enabled) { continue; diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index c93f353cea..acc447018d 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -333,11 +333,11 @@ String TextServerAdvanced::get_name() const { void TextServerAdvanced::free(RID p_rid) { _THREAD_SAFE_METHOD_ if (font_owner.owns(p_rid)) { - FontDataAdvanced *fd = font_owner.getornull(p_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_rid); font_owner.free(p_rid); memdelete(fd); } else if (shaped_owner.owns(p_rid)) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_rid); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_rid); shaped_owner.free(p_rid); memdelete(sd); } @@ -1596,7 +1596,7 @@ _FORCE_INLINE_ void TextServerAdvanced::_font_clear_cache(FontDataAdvanced *p_fo } hb_font_t *TextServerAdvanced::_font_get_hb_handle(RID p_font_rid, int p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, nullptr); MutexLock lock(fd->mutex); @@ -1614,7 +1614,7 @@ RID TextServerAdvanced::create_font() { } void TextServerAdvanced::font_set_data(RID p_font_rid, const PackedByteArray &p_data) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1625,7 +1625,7 @@ void TextServerAdvanced::font_set_data(RID p_font_rid, const PackedByteArray &p_ } void TextServerAdvanced::font_set_data_ptr(RID p_font_rid, const uint8_t *p_data_ptr, size_t p_data_size) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1636,7 +1636,7 @@ void TextServerAdvanced::font_set_data_ptr(RID p_font_rid, const uint8_t *p_data } void TextServerAdvanced::font_set_antialiased(RID p_font_rid, bool p_antialiased) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1647,7 +1647,7 @@ void TextServerAdvanced::font_set_antialiased(RID p_font_rid, bool p_antialiased } bool TextServerAdvanced::font_is_antialiased(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1655,7 +1655,7 @@ bool TextServerAdvanced::font_is_antialiased(RID p_font_rid) const { } void TextServerAdvanced::font_set_multichannel_signed_distance_field(RID p_font_rid, bool p_msdf) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1666,7 +1666,7 @@ void TextServerAdvanced::font_set_multichannel_signed_distance_field(RID p_font_ } bool TextServerAdvanced::font_is_multichannel_signed_distance_field(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1674,7 +1674,7 @@ bool TextServerAdvanced::font_is_multichannel_signed_distance_field(RID p_font_r } void TextServerAdvanced::font_set_msdf_pixel_range(RID p_font_rid, int p_msdf_pixel_range) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1685,7 +1685,7 @@ void TextServerAdvanced::font_set_msdf_pixel_range(RID p_font_rid, int p_msdf_pi } int TextServerAdvanced::font_get_msdf_pixel_range(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1693,7 +1693,7 @@ int TextServerAdvanced::font_get_msdf_pixel_range(RID p_font_rid) const { } void TextServerAdvanced::font_set_msdf_size(RID p_font_rid, int p_msdf_size) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1704,7 +1704,7 @@ void TextServerAdvanced::font_set_msdf_size(RID p_font_rid, int p_msdf_size) { } int TextServerAdvanced::font_get_msdf_size(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1712,7 +1712,7 @@ int TextServerAdvanced::font_get_msdf_size(RID p_font_rid) const { } void TextServerAdvanced::font_set_fixed_size(RID p_font_rid, int p_fixed_size) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1722,7 +1722,7 @@ void TextServerAdvanced::font_set_fixed_size(RID p_font_rid, int p_fixed_size) { } int TextServerAdvanced::font_get_fixed_size(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1730,7 +1730,7 @@ int TextServerAdvanced::font_get_fixed_size(RID p_font_rid) const { } void TextServerAdvanced::font_set_force_autohinter(RID p_font_rid, bool p_force_autohinter) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1741,7 +1741,7 @@ void TextServerAdvanced::font_set_force_autohinter(RID p_font_rid, bool p_force_ } bool TextServerAdvanced::font_is_force_autohinter(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1749,7 +1749,7 @@ bool TextServerAdvanced::font_is_force_autohinter(RID p_font_rid) const { } void TextServerAdvanced::font_set_hinting(RID p_font_rid, TextServer::Hinting p_hinting) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1760,7 +1760,7 @@ void TextServerAdvanced::font_set_hinting(RID p_font_rid, TextServer::Hinting p_ } TextServer::Hinting TextServerAdvanced::font_get_hinting(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, HINTING_NONE); MutexLock lock(fd->mutex); @@ -1768,7 +1768,7 @@ TextServer::Hinting TextServerAdvanced::font_get_hinting(RID p_font_rid) const { } void TextServerAdvanced::font_set_variation_coordinates(RID p_font_rid, const Dictionary &p_variation_coordinates) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1779,7 +1779,7 @@ void TextServerAdvanced::font_set_variation_coordinates(RID p_font_rid, const Di } Dictionary TextServerAdvanced::font_get_variation_coordinates(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -1787,7 +1787,7 @@ Dictionary TextServerAdvanced::font_get_variation_coordinates(RID p_font_rid) co } void TextServerAdvanced::font_set_oversampling(RID p_font_rid, real_t p_oversampling) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1798,7 +1798,7 @@ void TextServerAdvanced::font_set_oversampling(RID p_font_rid, real_t p_oversamp } real_t TextServerAdvanced::font_get_oversampling(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1806,7 +1806,7 @@ real_t TextServerAdvanced::font_get_oversampling(RID p_font_rid) const { } Array TextServerAdvanced::font_get_size_cache_list(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -1818,7 +1818,7 @@ Array TextServerAdvanced::font_get_size_cache_list(RID p_font_rid) const { } void TextServerAdvanced::font_clear_size_cache(RID p_font_rid) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1829,7 +1829,7 @@ void TextServerAdvanced::font_clear_size_cache(RID p_font_rid) { } void TextServerAdvanced::font_remove_size_cache(RID p_font_rid, const Vector2i &p_size) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1840,7 +1840,7 @@ void TextServerAdvanced::font_remove_size_cache(RID p_font_rid, const Vector2i & } void TextServerAdvanced::font_set_ascent(RID p_font_rid, int p_size, real_t p_ascent) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1851,7 +1851,7 @@ void TextServerAdvanced::font_set_ascent(RID p_font_rid, int p_size, real_t p_as } real_t TextServerAdvanced::font_get_ascent(RID p_font_rid, int p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1867,7 +1867,7 @@ real_t TextServerAdvanced::font_get_ascent(RID p_font_rid, int p_size) const { } void TextServerAdvanced::font_set_descent(RID p_font_rid, int p_size, real_t p_descent) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); Vector2i size = _get_size(fd, p_size); @@ -1877,7 +1877,7 @@ void TextServerAdvanced::font_set_descent(RID p_font_rid, int p_size, real_t p_d } real_t TextServerAdvanced::font_get_descent(RID p_font_rid, int p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1893,7 +1893,7 @@ real_t TextServerAdvanced::font_get_descent(RID p_font_rid, int p_size) const { } void TextServerAdvanced::font_set_underline_position(RID p_font_rid, int p_size, real_t p_underline_position) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1904,7 +1904,7 @@ void TextServerAdvanced::font_set_underline_position(RID p_font_rid, int p_size, } real_t TextServerAdvanced::font_get_underline_position(RID p_font_rid, int p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1920,7 +1920,7 @@ real_t TextServerAdvanced::font_get_underline_position(RID p_font_rid, int p_siz } void TextServerAdvanced::font_set_underline_thickness(RID p_font_rid, int p_size, real_t p_underline_thickness) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1931,7 +1931,7 @@ void TextServerAdvanced::font_set_underline_thickness(RID p_font_rid, int p_size } real_t TextServerAdvanced::font_get_underline_thickness(RID p_font_rid, int p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1947,7 +1947,7 @@ real_t TextServerAdvanced::font_get_underline_thickness(RID p_font_rid, int p_si } void TextServerAdvanced::font_set_scale(RID p_font_rid, int p_size, real_t p_scale) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1958,7 +1958,7 @@ void TextServerAdvanced::font_set_scale(RID p_font_rid, int p_size, real_t p_sca } real_t TextServerAdvanced::font_get_scale(RID p_font_rid, int p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1974,7 +1974,7 @@ real_t TextServerAdvanced::font_get_scale(RID p_font_rid, int p_size) const { } void TextServerAdvanced::font_set_spacing(RID p_font_rid, int p_size, TextServer::SpacingType p_spacing, int p_value) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1995,7 +1995,7 @@ void TextServerAdvanced::font_set_spacing(RID p_font_rid, int p_size, TextServer } int TextServerAdvanced::font_get_spacing(RID p_font_rid, int p_size, TextServer::SpacingType p_spacing) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -2026,7 +2026,7 @@ int TextServerAdvanced::font_get_spacing(RID p_font_rid, int p_size, TextServer: } int TextServerAdvanced::font_get_texture_count(RID p_font_rid, const Vector2i &p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -2038,7 +2038,7 @@ int TextServerAdvanced::font_get_texture_count(RID p_font_rid, const Vector2i &p } void TextServerAdvanced::font_clear_textures(RID p_font_rid, const Vector2i &p_size) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); Vector2i size = _get_size_outline(fd, p_size); @@ -2048,7 +2048,7 @@ void TextServerAdvanced::font_clear_textures(RID p_font_rid, const Vector2i &p_s } void TextServerAdvanced::font_remove_texture(RID p_font_rid, const Vector2i &p_size, int p_texture_index) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2060,7 +2060,7 @@ void TextServerAdvanced::font_remove_texture(RID p_font_rid, const Vector2i &p_s } void TextServerAdvanced::font_set_texture_image(RID p_font_rid, const Vector2i &p_size, int p_texture_index, const Ref<Image> &p_image) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND(p_image.is_null()); @@ -2086,7 +2086,7 @@ void TextServerAdvanced::font_set_texture_image(RID p_font_rid, const Vector2i & } Ref<Image> TextServerAdvanced::font_get_texture_image(RID p_font_rid, const Vector2i &p_size, int p_texture_index) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Ref<Image>()); MutexLock lock(fd->mutex); @@ -2101,7 +2101,7 @@ Ref<Image> TextServerAdvanced::font_get_texture_image(RID p_font_rid, const Vect } void TextServerAdvanced::font_set_texture_offsets(RID p_font_rid, const Vector2i &p_size, int p_texture_index, const PackedInt32Array &p_offset) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2116,7 +2116,7 @@ void TextServerAdvanced::font_set_texture_offsets(RID p_font_rid, const Vector2i } PackedInt32Array TextServerAdvanced::font_get_texture_offsets(RID p_font_rid, const Vector2i &p_size, int p_texture_index) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedInt32Array()); MutexLock lock(fd->mutex); @@ -2129,7 +2129,7 @@ PackedInt32Array TextServerAdvanced::font_get_texture_offsets(RID p_font_rid, co } Array TextServerAdvanced::font_get_glyph_list(RID p_font_rid, const Vector2i &p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -2146,7 +2146,7 @@ Array TextServerAdvanced::font_get_glyph_list(RID p_font_rid, const Vector2i &p_ } void TextServerAdvanced::font_clear_glyphs(RID p_font_rid, const Vector2i &p_size) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2157,7 +2157,7 @@ void TextServerAdvanced::font_clear_glyphs(RID p_font_rid, const Vector2i &p_siz } void TextServerAdvanced::font_remove_glyph(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2168,7 +2168,7 @@ void TextServerAdvanced::font_remove_glyph(RID p_font_rid, const Vector2i &p_siz } Vector2 TextServerAdvanced::font_get_glyph_advance(RID p_font_rid, int p_size, int32_t p_glyph) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2189,7 +2189,7 @@ Vector2 TextServerAdvanced::font_get_glyph_advance(RID p_font_rid, int p_size, i } void TextServerAdvanced::font_set_glyph_advance(RID p_font_rid, int p_size, int32_t p_glyph, const Vector2 &p_advance) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2204,7 +2204,7 @@ void TextServerAdvanced::font_set_glyph_advance(RID p_font_rid, int p_size, int3 } Vector2 TextServerAdvanced::font_get_glyph_offset(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2225,7 +2225,7 @@ Vector2 TextServerAdvanced::font_get_glyph_offset(RID p_font_rid, const Vector2i } void TextServerAdvanced::font_set_glyph_offset(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph, const Vector2 &p_offset) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2240,7 +2240,7 @@ void TextServerAdvanced::font_set_glyph_offset(RID p_font_rid, const Vector2i &p } Vector2 TextServerAdvanced::font_get_glyph_size(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2261,7 +2261,7 @@ Vector2 TextServerAdvanced::font_get_glyph_size(RID p_font_rid, const Vector2i & } void TextServerAdvanced::font_set_glyph_size(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph, const Vector2 &p_gl_size) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2276,7 +2276,7 @@ void TextServerAdvanced::font_set_glyph_size(RID p_font_rid, const Vector2i &p_s } Rect2 TextServerAdvanced::font_get_glyph_uv_rect(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Rect2()); MutexLock lock(fd->mutex); @@ -2292,7 +2292,7 @@ Rect2 TextServerAdvanced::font_get_glyph_uv_rect(RID p_font_rid, const Vector2i } void TextServerAdvanced::font_set_glyph_uv_rect(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph, const Rect2 &p_uv_rect) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2307,7 +2307,7 @@ void TextServerAdvanced::font_set_glyph_uv_rect(RID p_font_rid, const Vector2i & } int TextServerAdvanced::font_get_glyph_texture_idx(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, -1); MutexLock lock(fd->mutex); @@ -2323,7 +2323,7 @@ int TextServerAdvanced::font_get_glyph_texture_idx(RID p_font_rid, const Vector2 } void TextServerAdvanced::font_set_glyph_texture_idx(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph, int p_texture_idx) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2338,7 +2338,7 @@ void TextServerAdvanced::font_set_glyph_texture_idx(RID p_font_rid, const Vector } bool TextServerAdvanced::font_get_glyph_contours(RID p_font_rid, int p_size, int32_t p_index, Vector<Vector3> &r_points, Vector<int32_t> &r_contours, bool &r_orientation) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2372,7 +2372,7 @@ bool TextServerAdvanced::font_get_glyph_contours(RID p_font_rid, int p_size, int } Array TextServerAdvanced::font_get_kerning_list(RID p_font_rid, int p_size) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -2388,7 +2388,7 @@ Array TextServerAdvanced::font_get_kerning_list(RID p_font_rid, int p_size) cons } void TextServerAdvanced::font_clear_kerning_map(RID p_font_rid, int p_size) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2399,7 +2399,7 @@ void TextServerAdvanced::font_clear_kerning_map(RID p_font_rid, int p_size) { } void TextServerAdvanced::font_remove_kerning(RID p_font_rid, int p_size, const Vector2i &p_glyph_pair) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2410,7 +2410,7 @@ void TextServerAdvanced::font_remove_kerning(RID p_font_rid, int p_size, const V } void TextServerAdvanced::font_set_kerning(RID p_font_rid, int p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2421,7 +2421,7 @@ void TextServerAdvanced::font_set_kerning(RID p_font_rid, int p_size, const Vect } Vector2 TextServerAdvanced::font_get_kerning(RID p_font_rid, int p_size, const Vector2i &p_glyph_pair) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2454,7 +2454,7 @@ Vector2 TextServerAdvanced::font_get_kerning(RID p_font_rid, int p_size, const V } int32_t TextServerAdvanced::font_get_glyph_index(RID p_font_rid, int p_size, char32_t p_char, char32_t p_variation_selector) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -2477,7 +2477,7 @@ int32_t TextServerAdvanced::font_get_glyph_index(RID p_font_rid, int p_size, cha } bool TextServerAdvanced::font_has_char(RID p_font_rid, char32_t p_char) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2495,7 +2495,7 @@ bool TextServerAdvanced::font_has_char(RID p_font_rid, char32_t p_char) const { } String TextServerAdvanced::font_get_supported_chars(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); MutexLock lock(fd->mutex); @@ -2529,7 +2529,7 @@ String TextServerAdvanced::font_get_supported_chars(RID p_font_rid) const { } void TextServerAdvanced::font_render_range(RID p_font_rid, const Vector2i &p_size, char32_t p_start, char32_t p_end) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2547,7 +2547,7 @@ void TextServerAdvanced::font_render_range(RID p_font_rid, const Vector2i &p_siz } void TextServerAdvanced::font_render_glyph(RID p_font_rid, const Vector2i &p_size, int32_t p_index) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2557,7 +2557,7 @@ void TextServerAdvanced::font_render_glyph(RID p_font_rid, const Vector2i &p_siz } void TextServerAdvanced::font_draw_glyph(RID p_font_rid, RID p_canvas, int p_size, const Vector2 &p_pos, int32_t p_index, const Color &p_color) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2597,7 +2597,7 @@ void TextServerAdvanced::font_draw_glyph(RID p_font_rid, RID p_canvas, int p_siz } void TextServerAdvanced::font_draw_glyph_outline(RID p_font_rid, RID p_canvas, int p_size, int p_outline_size, const Vector2 &p_pos, int32_t p_index, const Color &p_color) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2637,7 +2637,7 @@ void TextServerAdvanced::font_draw_glyph_outline(RID p_font_rid, RID p_canvas, i } bool TextServerAdvanced::font_is_language_supported(RID p_font_rid, const String &p_language) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2649,7 +2649,7 @@ bool TextServerAdvanced::font_is_language_supported(RID p_font_rid, const String } void TextServerAdvanced::font_set_language_support_override(RID p_font_rid, const String &p_language, bool p_supported) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2657,7 +2657,7 @@ void TextServerAdvanced::font_set_language_support_override(RID p_font_rid, cons } bool TextServerAdvanced::font_get_language_support_override(RID p_font_rid, const String &p_language) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2665,7 +2665,7 @@ bool TextServerAdvanced::font_get_language_support_override(RID p_font_rid, cons } void TextServerAdvanced::font_remove_language_support_override(RID p_font_rid, const String &p_language) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2673,7 +2673,7 @@ void TextServerAdvanced::font_remove_language_support_override(RID p_font_rid, c } Vector<String> TextServerAdvanced::font_get_language_support_overrides(RID p_font_rid) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector<String>()); MutexLock lock(fd->mutex); @@ -2685,7 +2685,7 @@ Vector<String> TextServerAdvanced::font_get_language_support_overrides(RID p_fon } bool TextServerAdvanced::font_is_script_supported(RID p_font_rid, const String &p_script) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2699,7 +2699,7 @@ bool TextServerAdvanced::font_is_script_supported(RID p_font_rid, const String & } void TextServerAdvanced::font_set_script_support_override(RID p_font_rid, const String &p_script, bool p_supported) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2707,7 +2707,7 @@ void TextServerAdvanced::font_set_script_support_override(RID p_font_rid, const } bool TextServerAdvanced::font_get_script_support_override(RID p_font_rid, const String &p_script) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2715,7 +2715,7 @@ bool TextServerAdvanced::font_get_script_support_override(RID p_font_rid, const } void TextServerAdvanced::font_remove_script_support_override(RID p_font_rid, const String &p_script) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2723,7 +2723,7 @@ void TextServerAdvanced::font_remove_script_support_override(RID p_font_rid, con } Vector<String> TextServerAdvanced::font_get_script_support_overrides(RID p_font_rid) { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector<String>()); MutexLock lock(fd->mutex); @@ -2735,7 +2735,7 @@ Vector<String> TextServerAdvanced::font_get_script_support_overrides(RID p_font_ } Dictionary TextServerAdvanced::font_supported_feature_list(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -2745,7 +2745,7 @@ Dictionary TextServerAdvanced::font_supported_feature_list(RID p_font_rid) const } Dictionary TextServerAdvanced::font_supported_variation_list(RID p_font_rid) const { - FontDataAdvanced *fd = font_owner.getornull(p_font_rid); + FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -2776,7 +2776,7 @@ void TextServerAdvanced::font_set_global_oversampling(real_t p_oversampling) { List<RID> text_bufs; shaped_owner.get_owned_list(&text_bufs); for (const RID &E : text_bufs) { - invalidate(shaped_owner.getornull(E)); + invalidate(shaped_owner.get_or_null(E)); } } } @@ -2837,7 +2837,7 @@ void TextServerAdvanced::invalidate(TextServerAdvanced::ShapedTextDataAdvanced * } void TextServerAdvanced::full_copy(ShapedTextDataAdvanced *p_shaped) { - ShapedTextDataAdvanced *parent = shaped_owner.getornull(p_shaped->parent); + ShapedTextDataAdvanced *parent = shaped_owner.get_or_null(p_shaped->parent); for (Map<Variant, ShapedTextData::EmbeddedObject>::Element *E = parent->objects.front(); E; E = E->next()) { if (E->get().pos >= p_shaped->start && E->get().pos < p_shaped->end) { @@ -2868,7 +2868,7 @@ RID TextServerAdvanced::create_shaped_text(TextServer::Direction p_direction, Te } void TextServerAdvanced::shaped_text_clear(RID p_shaped) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2883,7 +2883,7 @@ void TextServerAdvanced::shaped_text_clear(RID p_shaped) { } void TextServerAdvanced::shaped_text_set_direction(RID p_shaped, TextServer::Direction p_direction) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2897,7 +2897,7 @@ void TextServerAdvanced::shaped_text_set_direction(RID p_shaped, TextServer::Dir } TextServer::Direction TextServerAdvanced::shaped_text_get_direction(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, TextServer::DIRECTION_LTR); MutexLock lock(sd->mutex); @@ -2905,7 +2905,7 @@ TextServer::Direction TextServerAdvanced::shaped_text_get_direction(RID p_shaped } void TextServerAdvanced::shaped_text_set_bidi_override(RID p_shaped, const Vector<Vector2i> &p_override) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2917,7 +2917,7 @@ void TextServerAdvanced::shaped_text_set_bidi_override(RID p_shaped, const Vecto } void TextServerAdvanced::shaped_text_set_orientation(RID p_shaped, TextServer::Orientation p_orientation) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2931,7 +2931,7 @@ void TextServerAdvanced::shaped_text_set_orientation(RID p_shaped, TextServer::O } void TextServerAdvanced::shaped_text_set_preserve_invalid(RID p_shaped, bool p_enabled) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2943,7 +2943,7 @@ void TextServerAdvanced::shaped_text_set_preserve_invalid(RID p_shaped, bool p_e } bool TextServerAdvanced::shaped_text_get_preserve_invalid(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2951,7 +2951,7 @@ bool TextServerAdvanced::shaped_text_get_preserve_invalid(RID p_shaped) const { } void TextServerAdvanced::shaped_text_set_preserve_control(RID p_shaped, bool p_enabled) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2965,7 +2965,7 @@ void TextServerAdvanced::shaped_text_set_preserve_control(RID p_shaped, bool p_e } bool TextServerAdvanced::shaped_text_get_preserve_control(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2973,7 +2973,7 @@ bool TextServerAdvanced::shaped_text_get_preserve_control(RID p_shaped) const { } TextServer::Orientation TextServerAdvanced::shaped_text_get_orientation(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, TextServer::ORIENTATION_HORIZONTAL); MutexLock lock(sd->mutex); @@ -2981,13 +2981,13 @@ TextServer::Orientation TextServerAdvanced::shaped_text_get_orientation(RID p_sh } bool TextServerAdvanced::shaped_text_add_string(RID p_shaped, const String &p_text, const Vector<RID> &p_fonts, int p_size, const Dictionary &p_opentype_features, const String &p_language) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); ERR_FAIL_COND_V(p_size <= 0, false); MutexLock lock(sd->mutex); for (int i = 0; i < p_fonts.size(); i++) { - ERR_FAIL_COND_V(!font_owner.getornull(p_fonts[i]), false); + ERR_FAIL_COND_V(!font_owner.get_or_null(p_fonts[i]), false); } if (p_text.is_empty()) { @@ -3016,7 +3016,7 @@ bool TextServerAdvanced::shaped_text_add_string(RID p_shaped, const String &p_te bool TextServerAdvanced::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align, int p_length) { _THREAD_SAFE_METHOD_ - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); ERR_FAIL_COND_V(p_key == Variant(), false); ERR_FAIL_COND_V(sd->objects.has(p_key), false); @@ -3045,7 +3045,7 @@ bool TextServerAdvanced::shaped_text_add_object(RID p_shaped, Variant p_key, con } bool TextServerAdvanced::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -3178,7 +3178,7 @@ bool TextServerAdvanced::shaped_text_resize_object(RID p_shaped, Variant p_key, } RID TextServerAdvanced::shaped_text_substr(RID p_shaped, int p_start, int p_length) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, RID()); MutexLock lock(sd->mutex); @@ -3371,7 +3371,7 @@ RID TextServerAdvanced::shaped_text_substr(RID p_shaped, int p_start, int p_leng } RID TextServerAdvanced::shaped_text_get_parent(RID p_shaped) const { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, RID()); MutexLock lock(sd->mutex); @@ -3379,7 +3379,7 @@ RID TextServerAdvanced::shaped_text_get_parent(RID p_shaped) const { } real_t TextServerAdvanced::shaped_text_fit_to_width(RID p_shaped, real_t p_width, uint8_t /*JustificationFlag*/ p_jst_flags) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -3515,7 +3515,7 @@ real_t TextServerAdvanced::shaped_text_fit_to_width(RID p_shaped, real_t p_width } real_t TextServerAdvanced::shaped_text_tab_align(RID p_shaped, const Vector<real_t> &p_tab_stops) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -3565,7 +3565,7 @@ real_t TextServerAdvanced::shaped_text_tab_align(RID p_shaped, const Vector<real } void TextServerAdvanced::shaped_text_overrun_trim_to_width(RID p_shaped_line, real_t p_width, uint8_t p_trim_flags) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped_line); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped_line); ERR_FAIL_COND_MSG(!sd, "ShapedTextDataAdvanced invalid."); MutexLock lock(sd->mutex); @@ -3692,7 +3692,7 @@ void TextServerAdvanced::shaped_text_overrun_trim_to_width(RID p_shaped_line, re } TextServer::TrimData TextServerAdvanced::shaped_text_get_trim_data(RID p_shaped) const { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, TrimData(), "ShapedTextDataAdvanced invalid."); MutexLock lock(sd->mutex); @@ -3700,7 +3700,7 @@ TextServer::TrimData TextServerAdvanced::shaped_text_get_trim_data(RID p_shaped) } bool TextServerAdvanced::shaped_text_update_breaks(RID p_shaped) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -3892,7 +3892,7 @@ _FORCE_INLINE_ int _generate_kashida_justification_opportunies(const String &p_d } bool TextServerAdvanced::shaped_text_update_justification_ops(RID p_shaped) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -4249,7 +4249,7 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int32_t p_star } bool TextServerAdvanced::shaped_text_shape(RID p_shaped) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -4479,7 +4479,7 @@ bool TextServerAdvanced::shaped_text_shape(RID p_shaped) { } bool TextServerAdvanced::shaped_text_is_ready(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -4487,7 +4487,7 @@ bool TextServerAdvanced::shaped_text_is_ready(RID p_shaped) const { } Vector<TextServer::Glyph> TextServerAdvanced::shaped_text_get_glyphs(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Vector<TextServer::Glyph>()); MutexLock lock(sd->mutex); @@ -4498,7 +4498,7 @@ Vector<TextServer::Glyph> TextServerAdvanced::shaped_text_get_glyphs(RID p_shape } Vector2i TextServerAdvanced::shaped_text_get_range(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Vector2i()); MutexLock lock(sd->mutex); @@ -4506,7 +4506,7 @@ Vector2i TextServerAdvanced::shaped_text_get_range(RID p_shaped) const { } Vector<TextServer::Glyph> TextServerAdvanced::shaped_text_sort_logical(RID p_shaped) { - ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Vector<TextServer::Glyph>()); MutexLock lock(sd->mutex); @@ -4525,7 +4525,7 @@ Vector<TextServer::Glyph> TextServerAdvanced::shaped_text_sort_logical(RID p_sha Array TextServerAdvanced::shaped_text_get_objects(RID p_shaped) const { Array ret; - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, ret); MutexLock lock(sd->mutex); @@ -4537,7 +4537,7 @@ Array TextServerAdvanced::shaped_text_get_objects(RID p_shaped) const { } Rect2 TextServerAdvanced::shaped_text_get_object_rect(RID p_shaped, Variant p_key) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Rect2()); MutexLock lock(sd->mutex); @@ -4549,7 +4549,7 @@ Rect2 TextServerAdvanced::shaped_text_get_object_rect(RID p_shaped, Variant p_ke } Size2 TextServerAdvanced::shaped_text_get_size(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Size2()); MutexLock lock(sd->mutex); @@ -4564,7 +4564,7 @@ Size2 TextServerAdvanced::shaped_text_get_size(RID p_shaped) const { } real_t TextServerAdvanced::shaped_text_get_ascent(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -4575,7 +4575,7 @@ real_t TextServerAdvanced::shaped_text_get_ascent(RID p_shaped) const { } real_t TextServerAdvanced::shaped_text_get_descent(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -4586,7 +4586,7 @@ real_t TextServerAdvanced::shaped_text_get_descent(RID p_shaped) const { } real_t TextServerAdvanced::shaped_text_get_width(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -4597,7 +4597,7 @@ real_t TextServerAdvanced::shaped_text_get_width(RID p_shaped) const { } real_t TextServerAdvanced::shaped_text_get_underline_position(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -4609,7 +4609,7 @@ real_t TextServerAdvanced::shaped_text_get_underline_position(RID p_shaped) cons } real_t TextServerAdvanced::shaped_text_get_underline_thickness(RID p_shaped) const { - const ShapedTextDataAdvanced *sd = shaped_owner.getornull(p_shaped); + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index 0dd48f98e2..b1ce85d505 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -80,11 +80,11 @@ String TextServerFallback::get_name() const { void TextServerFallback::free(RID p_rid) { _THREAD_SAFE_METHOD_ if (font_owner.owns(p_rid)) { - FontDataFallback *fd = font_owner.getornull(p_rid); + FontDataFallback *fd = font_owner.get_or_null(p_rid); font_owner.free(p_rid); memdelete(fd); } else if (shaped_owner.owns(p_rid)) { - ShapedTextData *sd = shaped_owner.getornull(p_rid); + ShapedTextData *sd = shaped_owner.get_or_null(p_rid); shaped_owner.free(p_rid); memdelete(sd); } @@ -811,7 +811,7 @@ RID TextServerFallback::create_font() { } void TextServerFallback::font_set_data(RID p_font_rid, const PackedByteArray &p_data) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -822,7 +822,7 @@ void TextServerFallback::font_set_data(RID p_font_rid, const PackedByteArray &p_ } void TextServerFallback::font_set_data_ptr(RID p_font_rid, const uint8_t *p_data_ptr, size_t p_data_size) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -833,7 +833,7 @@ void TextServerFallback::font_set_data_ptr(RID p_font_rid, const uint8_t *p_data } void TextServerFallback::font_set_antialiased(RID p_font_rid, bool p_antialiased) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -844,7 +844,7 @@ void TextServerFallback::font_set_antialiased(RID p_font_rid, bool p_antialiased } bool TextServerFallback::font_is_antialiased(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -852,7 +852,7 @@ bool TextServerFallback::font_is_antialiased(RID p_font_rid) const { } void TextServerFallback::font_set_multichannel_signed_distance_field(RID p_font_rid, bool p_msdf) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -863,7 +863,7 @@ void TextServerFallback::font_set_multichannel_signed_distance_field(RID p_font_ } bool TextServerFallback::font_is_multichannel_signed_distance_field(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -871,7 +871,7 @@ bool TextServerFallback::font_is_multichannel_signed_distance_field(RID p_font_r } void TextServerFallback::font_set_msdf_pixel_range(RID p_font_rid, int p_msdf_pixel_range) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -882,7 +882,7 @@ void TextServerFallback::font_set_msdf_pixel_range(RID p_font_rid, int p_msdf_pi } int TextServerFallback::font_get_msdf_pixel_range(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -890,7 +890,7 @@ int TextServerFallback::font_get_msdf_pixel_range(RID p_font_rid) const { } void TextServerFallback::font_set_msdf_size(RID p_font_rid, int p_msdf_size) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -901,7 +901,7 @@ void TextServerFallback::font_set_msdf_size(RID p_font_rid, int p_msdf_size) { } int TextServerFallback::font_get_msdf_size(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -909,7 +909,7 @@ int TextServerFallback::font_get_msdf_size(RID p_font_rid) const { } void TextServerFallback::font_set_fixed_size(RID p_font_rid, int p_fixed_size) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -919,7 +919,7 @@ void TextServerFallback::font_set_fixed_size(RID p_font_rid, int p_fixed_size) { } int TextServerFallback::font_get_fixed_size(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -927,7 +927,7 @@ int TextServerFallback::font_get_fixed_size(RID p_font_rid) const { } void TextServerFallback::font_set_force_autohinter(RID p_font_rid, bool p_force_autohinter) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -938,7 +938,7 @@ void TextServerFallback::font_set_force_autohinter(RID p_font_rid, bool p_force_ } bool TextServerFallback::font_is_force_autohinter(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -946,7 +946,7 @@ bool TextServerFallback::font_is_force_autohinter(RID p_font_rid) const { } void TextServerFallback::font_set_hinting(RID p_font_rid, TextServer::Hinting p_hinting) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -957,7 +957,7 @@ void TextServerFallback::font_set_hinting(RID p_font_rid, TextServer::Hinting p_ } TextServer::Hinting TextServerFallback::font_get_hinting(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, HINTING_NONE); MutexLock lock(fd->mutex); @@ -965,7 +965,7 @@ TextServer::Hinting TextServerFallback::font_get_hinting(RID p_font_rid) const { } void TextServerFallback::font_set_variation_coordinates(RID p_font_rid, const Dictionary &p_variation_coordinates) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -976,7 +976,7 @@ void TextServerFallback::font_set_variation_coordinates(RID p_font_rid, const Di } Dictionary TextServerFallback::font_get_variation_coordinates(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -984,7 +984,7 @@ Dictionary TextServerFallback::font_get_variation_coordinates(RID p_font_rid) co } void TextServerFallback::font_set_oversampling(RID p_font_rid, real_t p_oversampling) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -995,7 +995,7 @@ void TextServerFallback::font_set_oversampling(RID p_font_rid, real_t p_oversamp } real_t TextServerFallback::font_get_oversampling(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1003,7 +1003,7 @@ real_t TextServerFallback::font_get_oversampling(RID p_font_rid) const { } Array TextServerFallback::font_get_size_cache_list(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -1015,7 +1015,7 @@ Array TextServerFallback::font_get_size_cache_list(RID p_font_rid) const { } void TextServerFallback::font_clear_size_cache(RID p_font_rid) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1026,7 +1026,7 @@ void TextServerFallback::font_clear_size_cache(RID p_font_rid) { } void TextServerFallback::font_remove_size_cache(RID p_font_rid, const Vector2i &p_size) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1037,7 +1037,7 @@ void TextServerFallback::font_remove_size_cache(RID p_font_rid, const Vector2i & } void TextServerFallback::font_set_ascent(RID p_font_rid, int p_size, real_t p_ascent) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1048,7 +1048,7 @@ void TextServerFallback::font_set_ascent(RID p_font_rid, int p_size, real_t p_as } real_t TextServerFallback::font_get_ascent(RID p_font_rid, int p_size) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1064,7 +1064,7 @@ real_t TextServerFallback::font_get_ascent(RID p_font_rid, int p_size) const { } void TextServerFallback::font_set_descent(RID p_font_rid, int p_size, real_t p_descent) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); Vector2i size = _get_size(fd, p_size); @@ -1074,7 +1074,7 @@ void TextServerFallback::font_set_descent(RID p_font_rid, int p_size, real_t p_d } real_t TextServerFallback::font_get_descent(RID p_font_rid, int p_size) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1090,7 +1090,7 @@ real_t TextServerFallback::font_get_descent(RID p_font_rid, int p_size) const { } void TextServerFallback::font_set_underline_position(RID p_font_rid, int p_size, real_t p_underline_position) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1101,7 +1101,7 @@ void TextServerFallback::font_set_underline_position(RID p_font_rid, int p_size, } real_t TextServerFallback::font_get_underline_position(RID p_font_rid, int p_size) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1117,7 +1117,7 @@ real_t TextServerFallback::font_get_underline_position(RID p_font_rid, int p_siz } void TextServerFallback::font_set_underline_thickness(RID p_font_rid, int p_size, real_t p_underline_thickness) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1128,7 +1128,7 @@ void TextServerFallback::font_set_underline_thickness(RID p_font_rid, int p_size } real_t TextServerFallback::font_get_underline_thickness(RID p_font_rid, int p_size) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1144,7 +1144,7 @@ real_t TextServerFallback::font_get_underline_thickness(RID p_font_rid, int p_si } void TextServerFallback::font_set_scale(RID p_font_rid, int p_size, real_t p_scale) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1155,7 +1155,7 @@ void TextServerFallback::font_set_scale(RID p_font_rid, int p_size, real_t p_sca } real_t TextServerFallback::font_get_scale(RID p_font_rid, int p_size) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.f); MutexLock lock(fd->mutex); @@ -1171,7 +1171,7 @@ real_t TextServerFallback::font_get_scale(RID p_font_rid, int p_size) const { } void TextServerFallback::font_set_spacing(RID p_font_rid, int p_size, TextServer::SpacingType p_spacing, int p_value) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1192,7 +1192,7 @@ void TextServerFallback::font_set_spacing(RID p_font_rid, int p_size, TextServer } int TextServerFallback::font_get_spacing(RID p_font_rid, int p_size, TextServer::SpacingType p_spacing) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -1223,7 +1223,7 @@ int TextServerFallback::font_get_spacing(RID p_font_rid, int p_size, TextServer: } int TextServerFallback::font_get_texture_count(RID p_font_rid, const Vector2i &p_size) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -1235,7 +1235,7 @@ int TextServerFallback::font_get_texture_count(RID p_font_rid, const Vector2i &p } void TextServerFallback::font_clear_textures(RID p_font_rid, const Vector2i &p_size) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); Vector2i size = _get_size_outline(fd, p_size); @@ -1245,7 +1245,7 @@ void TextServerFallback::font_clear_textures(RID p_font_rid, const Vector2i &p_s } void TextServerFallback::font_remove_texture(RID p_font_rid, const Vector2i &p_size, int p_texture_index) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1257,7 +1257,7 @@ void TextServerFallback::font_remove_texture(RID p_font_rid, const Vector2i &p_s } void TextServerFallback::font_set_texture_image(RID p_font_rid, const Vector2i &p_size, int p_texture_index, const Ref<Image> &p_image) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND(p_image.is_null()); @@ -1283,7 +1283,7 @@ void TextServerFallback::font_set_texture_image(RID p_font_rid, const Vector2i & } Ref<Image> TextServerFallback::font_get_texture_image(RID p_font_rid, const Vector2i &p_size, int p_texture_index) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Ref<Image>()); MutexLock lock(fd->mutex); @@ -1298,7 +1298,7 @@ Ref<Image> TextServerFallback::font_get_texture_image(RID p_font_rid, const Vect } void TextServerFallback::font_set_texture_offsets(RID p_font_rid, const Vector2i &p_size, int p_texture_index, const PackedInt32Array &p_offset) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1313,7 +1313,7 @@ void TextServerFallback::font_set_texture_offsets(RID p_font_rid, const Vector2i } PackedInt32Array TextServerFallback::font_get_texture_offsets(RID p_font_rid, const Vector2i &p_size, int p_texture_index) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedInt32Array()); MutexLock lock(fd->mutex); @@ -1326,7 +1326,7 @@ PackedInt32Array TextServerFallback::font_get_texture_offsets(RID p_font_rid, co } Array TextServerFallback::font_get_glyph_list(RID p_font_rid, const Vector2i &p_size) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -1343,7 +1343,7 @@ Array TextServerFallback::font_get_glyph_list(RID p_font_rid, const Vector2i &p_ } void TextServerFallback::font_clear_glyphs(RID p_font_rid, const Vector2i &p_size) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1354,7 +1354,7 @@ void TextServerFallback::font_clear_glyphs(RID p_font_rid, const Vector2i &p_siz } void TextServerFallback::font_remove_glyph(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1365,7 +1365,7 @@ void TextServerFallback::font_remove_glyph(RID p_font_rid, const Vector2i &p_siz } Vector2 TextServerFallback::font_get_glyph_advance(RID p_font_rid, int p_size, int32_t p_glyph) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -1386,7 +1386,7 @@ Vector2 TextServerFallback::font_get_glyph_advance(RID p_font_rid, int p_size, i } void TextServerFallback::font_set_glyph_advance(RID p_font_rid, int p_size, int32_t p_glyph, const Vector2 &p_advance) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1401,7 +1401,7 @@ void TextServerFallback::font_set_glyph_advance(RID p_font_rid, int p_size, int3 } Vector2 TextServerFallback::font_get_glyph_offset(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -1422,7 +1422,7 @@ Vector2 TextServerFallback::font_get_glyph_offset(RID p_font_rid, const Vector2i } void TextServerFallback::font_set_glyph_offset(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph, const Vector2 &p_offset) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1437,7 +1437,7 @@ void TextServerFallback::font_set_glyph_offset(RID p_font_rid, const Vector2i &p } Vector2 TextServerFallback::font_get_glyph_size(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -1458,7 +1458,7 @@ Vector2 TextServerFallback::font_get_glyph_size(RID p_font_rid, const Vector2i & } void TextServerFallback::font_set_glyph_size(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph, const Vector2 &p_gl_size) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1473,7 +1473,7 @@ void TextServerFallback::font_set_glyph_size(RID p_font_rid, const Vector2i &p_s } Rect2 TextServerFallback::font_get_glyph_uv_rect(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Rect2()); MutexLock lock(fd->mutex); @@ -1489,7 +1489,7 @@ Rect2 TextServerFallback::font_get_glyph_uv_rect(RID p_font_rid, const Vector2i } void TextServerFallback::font_set_glyph_uv_rect(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph, const Rect2 &p_uv_rect) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1504,7 +1504,7 @@ void TextServerFallback::font_set_glyph_uv_rect(RID p_font_rid, const Vector2i & } int TextServerFallback::font_get_glyph_texture_idx(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, -1); MutexLock lock(fd->mutex); @@ -1520,7 +1520,7 @@ int TextServerFallback::font_get_glyph_texture_idx(RID p_font_rid, const Vector2 } void TextServerFallback::font_set_glyph_texture_idx(RID p_font_rid, const Vector2i &p_size, int32_t p_glyph, int p_texture_idx) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1535,7 +1535,7 @@ void TextServerFallback::font_set_glyph_texture_idx(RID p_font_rid, const Vector } bool TextServerFallback::font_get_glyph_contours(RID p_font_rid, int p_size, int32_t p_index, Vector<Vector3> &r_points, Vector<int32_t> &r_contours, bool &r_orientation) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1569,7 +1569,7 @@ bool TextServerFallback::font_get_glyph_contours(RID p_font_rid, int p_size, int } Array TextServerFallback::font_get_kerning_list(RID p_font_rid, int p_size) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -1585,7 +1585,7 @@ Array TextServerFallback::font_get_kerning_list(RID p_font_rid, int p_size) cons } void TextServerFallback::font_clear_kerning_map(RID p_font_rid, int p_size) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1596,7 +1596,7 @@ void TextServerFallback::font_clear_kerning_map(RID p_font_rid, int p_size) { } void TextServerFallback::font_remove_kerning(RID p_font_rid, int p_size, const Vector2i &p_glyph_pair) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1607,7 +1607,7 @@ void TextServerFallback::font_remove_kerning(RID p_font_rid, int p_size, const V } void TextServerFallback::font_set_kerning(RID p_font_rid, int p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1618,7 +1618,7 @@ void TextServerFallback::font_set_kerning(RID p_font_rid, int p_size, const Vect } Vector2 TextServerFallback::font_get_kerning(RID p_font_rid, int p_size, const Vector2i &p_glyph_pair) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -1657,7 +1657,7 @@ int32_t TextServerFallback::font_get_glyph_index(RID p_font_rid, int p_size, cha } bool TextServerFallback::font_has_char(RID p_font_rid, char32_t p_char) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1675,7 +1675,7 @@ bool TextServerFallback::font_has_char(RID p_font_rid, char32_t p_char) const { } String TextServerFallback::font_get_supported_chars(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); MutexLock lock(fd->mutex); @@ -1709,7 +1709,7 @@ String TextServerFallback::font_get_supported_chars(RID p_font_rid) const { } void TextServerFallback::font_render_range(RID p_font_rid, const Vector2i &p_size, char32_t p_start, char32_t p_end) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1721,7 +1721,7 @@ void TextServerFallback::font_render_range(RID p_font_rid, const Vector2i &p_siz } void TextServerFallback::font_render_glyph(RID p_font_rid, const Vector2i &p_size, int32_t p_index) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1731,7 +1731,7 @@ void TextServerFallback::font_render_glyph(RID p_font_rid, const Vector2i &p_siz } void TextServerFallback::font_draw_glyph(RID p_font_rid, RID p_canvas, int p_size, const Vector2 &p_pos, int32_t p_index, const Color &p_color) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1771,7 +1771,7 @@ void TextServerFallback::font_draw_glyph(RID p_font_rid, RID p_canvas, int p_siz } void TextServerFallback::font_draw_glyph_outline(RID p_font_rid, RID p_canvas, int p_size, int p_outline_size, const Vector2 &p_pos, int32_t p_index, const Color &p_color) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1811,7 +1811,7 @@ void TextServerFallback::font_draw_glyph_outline(RID p_font_rid, RID p_canvas, i } bool TextServerFallback::font_is_language_supported(RID p_font_rid, const String &p_language) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1823,7 +1823,7 @@ bool TextServerFallback::font_is_language_supported(RID p_font_rid, const String } void TextServerFallback::font_set_language_support_override(RID p_font_rid, const String &p_language, bool p_supported) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1831,7 +1831,7 @@ void TextServerFallback::font_set_language_support_override(RID p_font_rid, cons } bool TextServerFallback::font_get_language_support_override(RID p_font_rid, const String &p_language) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1839,7 +1839,7 @@ bool TextServerFallback::font_get_language_support_override(RID p_font_rid, cons } void TextServerFallback::font_remove_language_support_override(RID p_font_rid, const String &p_language) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1847,7 +1847,7 @@ void TextServerFallback::font_remove_language_support_override(RID p_font_rid, c } Vector<String> TextServerFallback::font_get_language_support_overrides(RID p_font_rid) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector<String>()); MutexLock lock(fd->mutex); @@ -1859,7 +1859,7 @@ Vector<String> TextServerFallback::font_get_language_support_overrides(RID p_fon } bool TextServerFallback::font_is_script_supported(RID p_font_rid, const String &p_script) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1871,7 +1871,7 @@ bool TextServerFallback::font_is_script_supported(RID p_font_rid, const String & } void TextServerFallback::font_set_script_support_override(RID p_font_rid, const String &p_script, bool p_supported) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1879,7 +1879,7 @@ void TextServerFallback::font_set_script_support_override(RID p_font_rid, const } bool TextServerFallback::font_get_script_support_override(RID p_font_rid, const String &p_script) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1887,7 +1887,7 @@ bool TextServerFallback::font_get_script_support_override(RID p_font_rid, const } void TextServerFallback::font_remove_script_support_override(RID p_font_rid, const String &p_script) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1897,7 +1897,7 @@ void TextServerFallback::font_remove_script_support_override(RID p_font_rid, con } Vector<String> TextServerFallback::font_get_script_support_overrides(RID p_font_rid) { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector<String>()); MutexLock lock(fd->mutex); @@ -1913,7 +1913,7 @@ Dictionary TextServerFallback::font_supported_feature_list(RID p_font_rid) const } Dictionary TextServerFallback::font_supported_variation_list(RID p_font_rid) const { - FontDataFallback *fd = font_owner.getornull(p_font_rid); + FontDataFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -1944,7 +1944,7 @@ void TextServerFallback::font_set_global_oversampling(real_t p_oversampling) { List<RID> text_bufs; shaped_owner.get_owned_list(&text_bufs); for (const RID &E : text_bufs) { - invalidate(shaped_owner.getornull(E)); + invalidate(shaped_owner.get_or_null(E)); } } } @@ -1969,7 +1969,7 @@ void TextServerFallback::invalidate(ShapedTextData *p_shaped) { } void TextServerFallback::full_copy(ShapedTextData *p_shaped) { - ShapedTextData *parent = shaped_owner.getornull(p_shaped->parent); + ShapedTextData *parent = shaped_owner.get_or_null(p_shaped->parent); for (Map<Variant, ShapedTextData::EmbeddedObject>::Element *E = parent->objects.front(); E; E = E->next()) { if (E->get().pos >= p_shaped->start && E->get().pos < p_shaped->end) { @@ -2000,7 +2000,7 @@ RID TextServerFallback::create_shaped_text(TextServer::Direction p_direction, Te } void TextServerFallback::shaped_text_clear(RID p_shaped) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2024,7 +2024,7 @@ TextServer::Direction TextServerFallback::shaped_text_get_direction(RID p_shaped } void TextServerFallback::shaped_text_set_orientation(RID p_shaped, TextServer::Orientation p_orientation) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2042,7 +2042,7 @@ void TextServerFallback::shaped_text_set_bidi_override(RID p_shaped, const Vecto } TextServer::Orientation TextServerFallback::shaped_text_get_orientation(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, TextServer::ORIENTATION_HORIZONTAL); MutexLock lock(sd->mutex); @@ -2050,7 +2050,7 @@ TextServer::Orientation TextServerFallback::shaped_text_get_orientation(RID p_sh } void TextServerFallback::shaped_text_set_preserve_invalid(RID p_shaped, bool p_enabled) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); MutexLock lock(sd->mutex); ERR_FAIL_COND(!sd); @@ -2064,7 +2064,7 @@ void TextServerFallback::shaped_text_set_preserve_invalid(RID p_shaped, bool p_e } bool TextServerFallback::shaped_text_get_preserve_invalid(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2072,7 +2072,7 @@ bool TextServerFallback::shaped_text_get_preserve_invalid(RID p_shaped) const { } void TextServerFallback::shaped_text_set_preserve_control(RID p_shaped, bool p_enabled) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND(!sd); MutexLock lock(sd->mutex); @@ -2086,7 +2086,7 @@ void TextServerFallback::shaped_text_set_preserve_control(RID p_shaped, bool p_e } bool TextServerFallback::shaped_text_get_preserve_control(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2094,14 +2094,14 @@ bool TextServerFallback::shaped_text_get_preserve_control(RID p_shaped) const { } bool TextServerFallback::shaped_text_add_string(RID p_shaped, const String &p_text, const Vector<RID> &p_fonts, int p_size, const Dictionary &p_opentype_features, const String &p_language) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); ERR_FAIL_COND_V(p_size <= 0, false); for (int i = 0; i < p_fonts.size(); i++) { - ERR_FAIL_COND_V(!font_owner.getornull(p_fonts[i]), false); + ERR_FAIL_COND_V(!font_owner.get_or_null(p_fonts[i]), false); } if (p_text.is_empty()) { @@ -2141,7 +2141,7 @@ bool TextServerFallback::shaped_text_add_string(RID p_shaped, const String &p_te } bool TextServerFallback::shaped_text_add_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align, int p_length) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2172,7 +2172,7 @@ bool TextServerFallback::shaped_text_add_object(RID p_shaped, Variant p_key, con } bool TextServerFallback::shaped_text_resize_object(RID p_shaped, Variant p_key, const Size2 &p_size, InlineAlign p_inline_align) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2305,7 +2305,7 @@ bool TextServerFallback::shaped_text_resize_object(RID p_shaped, Variant p_key, } RID TextServerFallback::shaped_text_substr(RID p_shaped, int p_start, int p_length) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, RID()); MutexLock lock(sd->mutex); @@ -2459,7 +2459,7 @@ RID TextServerFallback::shaped_text_substr(RID p_shaped, int p_start, int p_leng } RID TextServerFallback::shaped_text_get_parent(RID p_shaped) const { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, RID()); MutexLock lock(sd->mutex); @@ -2467,7 +2467,7 @@ RID TextServerFallback::shaped_text_get_parent(RID p_shaped) const { } real_t TextServerFallback::shaped_text_fit_to_width(RID p_shaped, real_t p_width, uint8_t /*JustificationFlag*/ p_jst_flags) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -2547,7 +2547,7 @@ real_t TextServerFallback::shaped_text_fit_to_width(RID p_shaped, real_t p_width } real_t TextServerFallback::shaped_text_tab_align(RID p_shaped, const Vector<real_t> &p_tab_stops) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -2597,7 +2597,7 @@ real_t TextServerFallback::shaped_text_tab_align(RID p_shaped, const Vector<real } bool TextServerFallback::shaped_text_update_breaks(RID p_shaped) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2638,7 +2638,7 @@ bool TextServerFallback::shaped_text_update_breaks(RID p_shaped) { } bool TextServerFallback::shaped_text_update_justification_ops(RID p_shaped) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2654,7 +2654,7 @@ bool TextServerFallback::shaped_text_update_justification_ops(RID p_shaped) { } void TextServerFallback::shaped_text_overrun_trim_to_width(RID p_shaped_line, real_t p_width, uint8_t p_trim_flags) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped_line); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped_line); ERR_FAIL_COND_MSG(!sd, "ShapedTextDataFallback invalid."); MutexLock lock(sd->mutex); @@ -2771,7 +2771,7 @@ void TextServerFallback::shaped_text_overrun_trim_to_width(RID p_shaped_line, re } TextServer::TrimData TextServerFallback::shaped_text_get_trim_data(RID p_shaped) const { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V_MSG(!sd, TrimData(), "ShapedTextDataFallback invalid."); MutexLock lock(sd->mutex); @@ -2779,7 +2779,7 @@ TextServer::TrimData TextServerFallback::shaped_text_get_trim_data(RID p_shaped) } bool TextServerFallback::shaped_text_shape(RID p_shaped) { - ShapedTextData *sd = shaped_owner.getornull(p_shaped); + ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2973,7 +2973,7 @@ bool TextServerFallback::shaped_text_shape(RID p_shaped) { } bool TextServerFallback::shaped_text_is_ready(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, false); MutexLock lock(sd->mutex); @@ -2981,7 +2981,7 @@ bool TextServerFallback::shaped_text_is_ready(RID p_shaped) const { } Vector<TextServer::Glyph> TextServerFallback::shaped_text_get_glyphs(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Vector<TextServer::Glyph>()); MutexLock lock(sd->mutex); @@ -2992,7 +2992,7 @@ Vector<TextServer::Glyph> TextServerFallback::shaped_text_get_glyphs(RID p_shape } Vector2i TextServerFallback::shaped_text_get_range(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Vector2i()); MutexLock lock(sd->mutex); @@ -3000,7 +3000,7 @@ Vector2i TextServerFallback::shaped_text_get_range(RID p_shaped) const { } Vector<TextServer::Glyph> TextServerFallback::shaped_text_sort_logical(RID p_shaped) { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Vector<TextServer::Glyph>()); MutexLock lock(sd->mutex); @@ -3013,7 +3013,7 @@ Vector<TextServer::Glyph> TextServerFallback::shaped_text_sort_logical(RID p_sha Array TextServerFallback::shaped_text_get_objects(RID p_shaped) const { Array ret; - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, ret); MutexLock lock(sd->mutex); @@ -3025,7 +3025,7 @@ Array TextServerFallback::shaped_text_get_objects(RID p_shaped) const { } Rect2 TextServerFallback::shaped_text_get_object_rect(RID p_shaped, Variant p_key) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Rect2()); MutexLock lock(sd->mutex); @@ -3037,7 +3037,7 @@ Rect2 TextServerFallback::shaped_text_get_object_rect(RID p_shaped, Variant p_ke } Size2 TextServerFallback::shaped_text_get_size(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, Size2()); MutexLock lock(sd->mutex); @@ -3052,7 +3052,7 @@ Size2 TextServerFallback::shaped_text_get_size(RID p_shaped) const { } real_t TextServerFallback::shaped_text_get_ascent(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -3063,7 +3063,7 @@ real_t TextServerFallback::shaped_text_get_ascent(RID p_shaped) const { } real_t TextServerFallback::shaped_text_get_descent(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -3074,7 +3074,7 @@ real_t TextServerFallback::shaped_text_get_descent(RID p_shaped) const { } real_t TextServerFallback::shaped_text_get_width(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -3085,7 +3085,7 @@ real_t TextServerFallback::shaped_text_get_width(RID p_shaped) const { } real_t TextServerFallback::shaped_text_get_underline_position(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); @@ -3097,7 +3097,7 @@ real_t TextServerFallback::shaped_text_get_underline_position(RID p_shaped) cons } real_t TextServerFallback::shaped_text_get_underline_thickness(RID p_shaped) const { - const ShapedTextData *sd = shaped_owner.getornull(p_shaped); + const ShapedTextData *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0.f); MutexLock lock(sd->mutex); |