summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/bullet/area_bullet.cpp4
-rw-r--r--modules/bullet/area_bullet.h10
-rw-r--r--modules/bullet/btRayShape.cpp4
-rw-r--r--modules/bullet/btRayShape.h4
-rw-r--r--modules/bullet/bullet_physics_server.cpp4
-rw-r--r--modules/bullet/bullet_physics_server.h6
-rw-r--r--modules/bullet/bullet_types_converter.cpp4
-rw-r--r--modules/bullet/bullet_types_converter.h7
-rw-r--r--modules/bullet/bullet_utilities.h7
-rw-r--r--modules/bullet/collision_object_bullet.cpp4
-rw-r--r--modules/bullet/collision_object_bullet.h6
-rw-r--r--modules/bullet/cone_twist_joint_bullet.cpp4
-rw-r--r--modules/bullet/cone_twist_joint_bullet.h7
-rw-r--r--modules/bullet/constraint_bullet.cpp4
-rw-r--r--modules/bullet/constraint_bullet.h7
-rw-r--r--modules/bullet/generic_6dof_joint_bullet.cpp4
-rw-r--r--modules/bullet/generic_6dof_joint_bullet.h6
-rw-r--r--modules/bullet/godot_collision_configuration.cpp4
-rw-r--r--modules/bullet/godot_collision_configuration.h7
-rw-r--r--modules/bullet/godot_collision_dispatcher.cpp4
-rw-r--r--modules/bullet/godot_collision_dispatcher.h9
-rw-r--r--modules/bullet/godot_motion_state.h7
-rw-r--r--modules/bullet/godot_ray_world_algorithm.cpp4
-rw-r--r--modules/bullet/godot_ray_world_algorithm.h4
-rw-r--r--modules/bullet/godot_result_callbacks.cpp5
-rw-r--r--modules/bullet/godot_result_callbacks.h5
-rw-r--r--modules/bullet/hinge_joint_bullet.cpp4
-rw-r--r--modules/bullet/hinge_joint_bullet.h7
-rw-r--r--modules/bullet/joint_bullet.cpp42
-rw-r--r--modules/bullet/joint_bullet.h11
-rw-r--r--modules/bullet/pin_joint_bullet.cpp4
-rw-r--r--modules/bullet/pin_joint_bullet.h7
-rw-r--r--modules/bullet/register_types.cpp4
-rw-r--r--modules/bullet/register_types.h7
-rw-r--r--modules/bullet/rid_bullet.h7
-rw-r--r--modules/bullet/rigid_body_bullet.cpp6
-rw-r--r--modules/bullet/rigid_body_bullet.h10
-rw-r--r--modules/bullet/shape_bullet.cpp4
-rw-r--r--modules/bullet/shape_bullet.h7
-rw-r--r--modules/bullet/shape_owner_bullet.cpp35
-rw-r--r--modules/bullet/shape_owner_bullet.h7
-rw-r--r--modules/bullet/slider_joint_bullet.cpp4
-rw-r--r--modules/bullet/slider_joint_bullet.h7
-rw-r--r--modules/bullet/soft_body_bullet.h4
-rw-r--r--modules/bullet/space_bullet.cpp4
-rw-r--r--modules/bullet/space_bullet.h7
-rw-r--r--modules/csg/csg_gizmos.cpp8
-rw-r--r--modules/csg/csg_gizmos.h8
-rw-r--r--modules/freetype/SCsub1
-rw-r--r--modules/glslang/SCsub9
-rw-r--r--modules/glslang/glslang_resource_limits.h147
-rw-r--r--modules/glslang/register_types.cpp13
-rw-r--r--modules/mobile_vr/mobile_vr_interface.h4
-rw-r--r--modules/navigation/godot_navigation_server.cpp4
-rw-r--r--modules/navigation/godot_navigation_server.h4
-rw-r--r--modules/navigation/nav_map.cpp4
-rw-r--r--modules/navigation/nav_map.h5
-rw-r--r--modules/navigation/nav_region.cpp4
-rw-r--r--modules/navigation/nav_region.h5
-rw-r--r--modules/navigation/nav_rid.h4
-rw-r--r--modules/navigation/nav_utils.h4
-rw-r--r--modules/navigation/rvo_agent.cpp4
-rw-r--r--modules/navigation/rvo_agent.h4
-rw-r--r--modules/svg/image_loader_svg.h6
-rw-r--r--modules/text_server_adv/text_server_adv.cpp263
-rw-r--r--modules/text_server_adv/text_server_adv.h1
-rw-r--r--modules/text_server_fb/text_server_fb.cpp117
-rw-r--r--modules/text_server_fb/text_server_fb.h1
-rw-r--r--modules/tga/image_loader_tga.h5
-rw-r--r--modules/visual_script/editor/visual_script_editor.cpp58
-rw-r--r--modules/visual_script/editor/visual_script_editor.h21
-rw-r--r--modules/webxr/webxr_interface.h2
-rw-r--r--modules/webxr/webxr_interface_js.h2
73 files changed, 558 insertions, 479 deletions
diff --git a/modules/bullet/area_bullet.cpp b/modules/bullet/area_bullet.cpp
index d17e880fc0..f816691cde 100644
--- a/modules/bullet/area_bullet.cpp
+++ b/modules/bullet/area_bullet.cpp
@@ -39,10 +39,6 @@
#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include <btBulletCollisionCommon.h>
-/**
- @author AndreaCatania
-*/
-
AreaBullet::AreaBullet() :
RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_AREA) {
btGhost = bulletnew(btGhostObject);
diff --git a/modules/bullet/area_bullet.h b/modules/bullet/area_bullet.h
index caf81ef1be..740378d0e3 100644
--- a/modules/bullet/area_bullet.h
+++ b/modules/bullet/area_bullet.h
@@ -28,18 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef AREABULLET_H
-#define AREABULLET_H
+#ifndef AREA_BULLET_H
+#define AREA_BULLET_H
#include "collision_object_bullet.h"
#include "core/templates/vector.h"
#include "servers/physics_server_3d.h"
#include "space_bullet.h"
-/**
- @author AndreaCatania
-*/
-
class btGhostObject;
class AreaBullet : public RigidCollisionObjectBullet {
@@ -163,4 +159,4 @@ public:
virtual void on_exit_area(AreaBullet *p_area);
};
-#endif
+#endif // AREA_BULLET_H
diff --git a/modules/bullet/btRayShape.cpp b/modules/bullet/btRayShape.cpp
index e67c9baacd..14bc7442a7 100644
--- a/modules/bullet/btRayShape.cpp
+++ b/modules/bullet/btRayShape.cpp
@@ -34,10 +34,6 @@
#include <LinearMath/btAabbUtil2.h>
-/**
- @author AndreaCatania
-*/
-
btRayShape::btRayShape(btScalar length) :
btConvexInternalShape() {
m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE;
diff --git a/modules/bullet/btRayShape.h b/modules/bullet/btRayShape.h
index 5d0a05b369..90e4524d64 100644
--- a/modules/bullet/btRayShape.h
+++ b/modules/bullet/btRayShape.h
@@ -35,10 +35,6 @@
#include <BulletCollision/CollisionShapes/btConvexInternalShape.h>
-/**
- @author AndreaCatania
-*/
-
/// Ray shape around z axis
ATTRIBUTE_ALIGNED16(class)
btRayShape : public btConvexInternalShape {
diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp
index 9bf3e186ee..7e9e621032 100644
--- a/modules/bullet/bullet_physics_server.cpp
+++ b/modules/bullet/bullet_physics_server.cpp
@@ -45,10 +45,6 @@
#include <assert.h>
-/**
- @author AndreaCatania
-*/
-
#define CreateThenReturnRID(owner, ridData) \
RID rid = owner.make_rid(ridData); \
ridData->set_self(rid); \
diff --git a/modules/bullet/bullet_physics_server.h b/modules/bullet/bullet_physics_server.h
index 5840eff815..06a6f62bcd 100644
--- a/modules/bullet/bullet_physics_server.h
+++ b/modules/bullet/bullet_physics_server.h
@@ -41,10 +41,6 @@
#include "soft_body_bullet.h"
#include "space_bullet.h"
-/**
- @author AndreaCatania
-*/
-
class BulletPhysicsServer3D : public PhysicsServer3D {
GDCLASS(BulletPhysicsServer3D, PhysicsServer3D);
@@ -395,4 +391,4 @@ public:
JointBullet *get_joint(RID p_rid) const;
};
-#endif
+#endif // BULLET_PHYSICS_SERVER_H
diff --git a/modules/bullet/bullet_types_converter.cpp b/modules/bullet/bullet_types_converter.cpp
index 571457f48f..a0698683e8 100644
--- a/modules/bullet/bullet_types_converter.cpp
+++ b/modules/bullet/bullet_types_converter.cpp
@@ -30,10 +30,6 @@
#include "bullet_types_converter.h"
-/**
- @author AndreaCatania
-*/
-
// ++ BULLET to GODOT ++++++++++
void B_TO_G(btVector3 const &inVal, Vector3 &outVal) {
outVal[0] = inVal[0];
diff --git a/modules/bullet/bullet_types_converter.h b/modules/bullet/bullet_types_converter.h
index b4d6dccc05..4ee855c266 100644
--- a/modules/bullet/bullet_types_converter.h
+++ b/modules/bullet/bullet_types_converter.h
@@ -40,10 +40,6 @@
#include <LinearMath/btTransform.h>
#include <LinearMath/btVector3.h>
-/**
- @author AndreaCatania
-*/
-
// Bullet to Godot
extern void B_TO_G(btVector3 const &inVal, Vector3 &outVal);
extern void INVERT_B_TO_G(btVector3 const &inVal, Vector3 &outVal);
@@ -59,4 +55,5 @@ extern void INVERT_G_TO_B(Basis const &inVal, btMatrix3x3 &outVal);
extern void G_TO_B(Transform3D const &inVal, btTransform &outVal);
extern void UNSCALE_BT_BASIS(btTransform &scaledBasis);
-#endif
+
+#endif // BULLET_TYPES_CONVERTER_H
diff --git a/modules/bullet/bullet_utilities.h b/modules/bullet/bullet_utilities.h
index b832d3fc61..ab24cb5de6 100644
--- a/modules/bullet/bullet_utilities.h
+++ b/modules/bullet/bullet_utilities.h
@@ -31,10 +31,6 @@
#ifndef BULLET_UTILITIES_H
#define BULLET_UTILITIES_H
-/**
- @author AndreaCatania
-*/
-
#define bulletnew(cl) \
new cl
@@ -43,4 +39,5 @@
delete cl; \
cl = nullptr; \
}
-#endif
+
+#endif // BULLET_UTILITIES_H
diff --git a/modules/bullet/collision_object_bullet.cpp b/modules/bullet/collision_object_bullet.cpp
index 6bf01a63df..bc8e1a0718 100644
--- a/modules/bullet/collision_object_bullet.cpp
+++ b/modules/bullet/collision_object_bullet.cpp
@@ -39,10 +39,6 @@
#include <btBulletCollisionCommon.h>
-/**
- @author AndreaCatania
-*/
-
// We enable dynamic AABB tree so that we can actually perform a broadphase on bodies with compound collision shapes.
// This is crucial for the performance of kinematic bodies and for bodies with transforming shapes.
#define enableDynamicAabbTree true
diff --git a/modules/bullet/collision_object_bullet.h b/modules/bullet/collision_object_bullet.h
index 09be2d99d2..8e9c34df27 100644
--- a/modules/bullet/collision_object_bullet.h
+++ b/modules/bullet/collision_object_bullet.h
@@ -39,10 +39,6 @@
#include <LinearMath/btTransform.h>
-/**
- @author AndreaCatania
-*/
-
class AreaBullet;
class ShapeBullet;
class btCollisionObject;
@@ -256,4 +252,4 @@ private:
void internal_shape_destroy(int p_index, bool p_permanentlyFromThisBody = false);
};
-#endif
+#endif // COLLISION_OBJECT_BULLET_H
diff --git a/modules/bullet/cone_twist_joint_bullet.cpp b/modules/bullet/cone_twist_joint_bullet.cpp
index 544d711259..fc73036713 100644
--- a/modules/bullet/cone_twist_joint_bullet.cpp
+++ b/modules/bullet/cone_twist_joint_bullet.cpp
@@ -36,10 +36,6 @@
#include <BulletDynamics/ConstraintSolver/btConeTwistConstraint.h>
-/**
- @author AndreaCatania
-*/
-
ConeTwistJointBullet::ConeTwistJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform3D &rbAFrame, const Transform3D &rbBFrame) :
JointBullet() {
Transform3D scaled_AFrame(rbAFrame.scaled(rbA->get_body_scale()));
diff --git a/modules/bullet/cone_twist_joint_bullet.h b/modules/bullet/cone_twist_joint_bullet.h
index ebb51868f4..c81e11f144 100644
--- a/modules/bullet/cone_twist_joint_bullet.h
+++ b/modules/bullet/cone_twist_joint_bullet.h
@@ -33,10 +33,6 @@
#include "joint_bullet.h"
-/**
- @author AndreaCatania
-*/
-
class RigidBodyBullet;
class ConeTwistJointBullet : public JointBullet {
@@ -50,4 +46,5 @@ public:
void set_param(PhysicsServer3D::ConeTwistJointParam p_param, real_t p_value);
real_t get_param(PhysicsServer3D::ConeTwistJointParam p_param) const;
};
-#endif
+
+#endif // CONE_TWIST_JOINT_BULLET_H
diff --git a/modules/bullet/constraint_bullet.cpp b/modules/bullet/constraint_bullet.cpp
index 5b4b0e75bc..c788f09cb9 100644
--- a/modules/bullet/constraint_bullet.cpp
+++ b/modules/bullet/constraint_bullet.cpp
@@ -33,10 +33,6 @@
#include "collision_object_bullet.h"
#include "space_bullet.h"
-/**
- @author AndreaCatania
-*/
-
ConstraintBullet::ConstraintBullet() {}
void ConstraintBullet::setup(btTypedConstraint *p_constraint) {
diff --git a/modules/bullet/constraint_bullet.h b/modules/bullet/constraint_bullet.h
index 5e63d7a1b5..5dc3958ee1 100644
--- a/modules/bullet/constraint_bullet.h
+++ b/modules/bullet/constraint_bullet.h
@@ -36,10 +36,6 @@
#include <BulletDynamics/ConstraintSolver/btTypedConstraint.h>
-/**
- @author AndreaCatania
-*/
-
class RigidBodyBullet;
class SpaceBullet;
class btTypedConstraint;
@@ -68,4 +64,5 @@ public:
_FORCE_INLINE_ btTypedConstraint *get_bt_constraint() { return constraint; }
};
-#endif
+
+#endif // CONSTRAINT_BULLET_H
diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp
index 01e1ecbdf6..0210064dc8 100644
--- a/modules/bullet/generic_6dof_joint_bullet.cpp
+++ b/modules/bullet/generic_6dof_joint_bullet.cpp
@@ -36,10 +36,6 @@
#include <BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.h>
-/**
- @author AndreaCatania
-*/
-
Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform3D &frameInA, const Transform3D &frameInB) :
JointBullet() {
for (int i = 0; i < 3; i++) {
diff --git a/modules/bullet/generic_6dof_joint_bullet.h b/modules/bullet/generic_6dof_joint_bullet.h
index b5d1db8fd6..cc4ccf7ac4 100644
--- a/modules/bullet/generic_6dof_joint_bullet.h
+++ b/modules/bullet/generic_6dof_joint_bullet.h
@@ -33,10 +33,6 @@
#include "joint_bullet.h"
-/**
- @author AndreaCatania
-*/
-
class RigidBodyBullet;
class Generic6DOFJointBullet : public JointBullet {
@@ -70,4 +66,4 @@ public:
bool get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6DOFJointAxisFlag p_flag) const;
};
-#endif
+#endif // GENERIC_6DOF_JOINT_BULLET_H
diff --git a/modules/bullet/godot_collision_configuration.cpp b/modules/bullet/godot_collision_configuration.cpp
index 0e872fa1c1..354c4e271b 100644
--- a/modules/bullet/godot_collision_configuration.cpp
+++ b/modules/bullet/godot_collision_configuration.cpp
@@ -35,10 +35,6 @@
#include <BulletCollision/BroadphaseCollision/btBroadphaseProxy.h>
#include <BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h>
-/**
- @author AndreaCatania
-*/
-
GodotCollisionConfiguration::GodotCollisionConfiguration(const btDiscreteDynamicsWorld *world, const btDefaultCollisionConstructionInfo &constructionInfo) :
btDefaultCollisionConfiguration(constructionInfo) {
void *mem = nullptr;
diff --git a/modules/bullet/godot_collision_configuration.h b/modules/bullet/godot_collision_configuration.h
index 3b1bc3a97d..7e29f6e03a 100644
--- a/modules/bullet/godot_collision_configuration.h
+++ b/modules/bullet/godot_collision_configuration.h
@@ -34,10 +34,6 @@
#include <BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h>
#include <BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h>
-/**
- @author AndreaCatania
-*/
-
class btDiscreteDynamicsWorld;
class GodotCollisionConfiguration : public btDefaultCollisionConfiguration {
@@ -63,4 +59,5 @@ public:
virtual btCollisionAlgorithmCreateFunc *getCollisionAlgorithmCreateFunc(int proxyType0, int proxyType1);
virtual btCollisionAlgorithmCreateFunc *getClosestPointsAlgorithmCreateFunc(int proxyType0, int proxyType1);
};
-#endif
+
+#endif // GODOT_COLLISION_CONFIGURATION_H
diff --git a/modules/bullet/godot_collision_dispatcher.cpp b/modules/bullet/godot_collision_dispatcher.cpp
index c926462eda..2ab1c7dd84 100644
--- a/modules/bullet/godot_collision_dispatcher.cpp
+++ b/modules/bullet/godot_collision_dispatcher.cpp
@@ -32,10 +32,6 @@
#include "collision_object_bullet.h"
-/**
- @author AndreaCatania
-*/
-
const int GodotCollisionDispatcher::CASTED_TYPE_AREA = static_cast<int>(CollisionObjectBullet::TYPE_AREA);
GodotCollisionDispatcher::GodotCollisionDispatcher(btCollisionConfiguration *collisionConfiguration) :
diff --git a/modules/bullet/godot_collision_dispatcher.h b/modules/bullet/godot_collision_dispatcher.h
index 77b8cee0a6..97cae1ce6a 100644
--- a/modules/bullet/godot_collision_dispatcher.h
+++ b/modules/bullet/godot_collision_dispatcher.h
@@ -31,14 +31,8 @@
#ifndef GODOT_COLLISION_DISPATCHER_H
#define GODOT_COLLISION_DISPATCHER_H
-#include <cstdint>
-
#include <btBulletDynamicsCommon.h>
-/**
- @author AndreaCatania
-*/
-
/// This class is required to implement custom collision behaviour in the narrowphase
class GodotCollisionDispatcher : public btCollisionDispatcher {
private:
@@ -49,4 +43,5 @@ public:
virtual bool needsCollision(const btCollisionObject *body0, const btCollisionObject *body1);
virtual bool needsResponse(const btCollisionObject *body0, const btCollisionObject *body1);
};
-#endif
+
+#endif // GODOT_COLLISION_DISPATCHER_H
diff --git a/modules/bullet/godot_motion_state.h b/modules/bullet/godot_motion_state.h
index a37fef9d90..f1a5e0e3b5 100644
--- a/modules/bullet/godot_motion_state.h
+++ b/modules/bullet/godot_motion_state.h
@@ -35,10 +35,6 @@
#include <LinearMath/btMotionState.h>
-/**
- @author AndreaCatania
-*/
-
class RigidBodyBullet;
// This class is responsible to move kinematic actor
@@ -96,4 +92,5 @@ public:
return bodyCurrentWorldTransform;
}
};
-#endif
+
+#endif // GODOT_MOTION_STATE_H
diff --git a/modules/bullet/godot_ray_world_algorithm.cpp b/modules/bullet/godot_ray_world_algorithm.cpp
index 3b7513916d..697ca12e7b 100644
--- a/modules/bullet/godot_ray_world_algorithm.cpp
+++ b/modules/bullet/godot_ray_world_algorithm.cpp
@@ -35,10 +35,6 @@
#include <BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h>
-/**
- @author AndreaCatania
-*/
-
// Epsilon to account for floating point inaccuracies
#define RAY_PENETRATION_DEPTH_EPSILON 0.01
diff --git a/modules/bullet/godot_ray_world_algorithm.h b/modules/bullet/godot_ray_world_algorithm.h
index f554108a75..94bdefb720 100644
--- a/modules/bullet/godot_ray_world_algorithm.h
+++ b/modules/bullet/godot_ray_world_algorithm.h
@@ -35,10 +35,6 @@
#include <BulletCollision/CollisionDispatch/btCollisionCreateFunc.h>
#include <BulletCollision/CollisionDispatch/btCollisionDispatcher.h>
-/**
- @author AndreaCatania
-*/
-
class btDiscreteDynamicsWorld;
class GodotRayWorldAlgorithm : public btActivatingCollisionAlgorithm {
diff --git a/modules/bullet/godot_result_callbacks.cpp b/modules/bullet/godot_result_callbacks.cpp
index d4b6e90117..35b26fc2ec 100644
--- a/modules/bullet/godot_result_callbacks.cpp
+++ b/modules/bullet/godot_result_callbacks.cpp
@@ -34,11 +34,8 @@
#include "bullet_types_converter.h"
#include "collision_object_bullet.h"
#include "rigid_body_bullet.h"
-#include <BulletCollision/CollisionDispatch/btInternalEdgeUtility.h>
-/**
- @author AndreaCatania
-*/
+#include <BulletCollision/CollisionDispatch/btInternalEdgeUtility.h>
bool godotContactAddedCallback(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1) {
if (!colObj1Wrap->getCollisionObject()->getCollisionShape()->isCompound()) {
diff --git a/modules/bullet/godot_result_callbacks.h b/modules/bullet/godot_result_callbacks.h
index 94be993212..dd64762529 100644
--- a/modules/bullet/godot_result_callbacks.h
+++ b/modules/bullet/godot_result_callbacks.h
@@ -36,10 +36,6 @@
#include <BulletCollision/BroadphaseCollision/btBroadphaseProxy.h>
#include <btBulletDynamicsCommon.h>
-/**
- @author AndreaCatania
-*/
-
class RigidBodyBullet;
/// This callback is injected inside bullet server and allow me to smooth contacts against trimesh
@@ -225,4 +221,5 @@ struct GodotDeepPenetrationContactResultCallback : public btManifoldResult {
virtual void addContactPoint(const btVector3 &normalOnBInWorld, const btVector3 &pointInWorldOnB, btScalar depth);
};
+
#endif // GODOT_RESULT_CALLBACKS_H
diff --git a/modules/bullet/hinge_joint_bullet.cpp b/modules/bullet/hinge_joint_bullet.cpp
index 116d8caba7..0b1bb7890d 100644
--- a/modules/bullet/hinge_joint_bullet.cpp
+++ b/modules/bullet/hinge_joint_bullet.cpp
@@ -36,10 +36,6 @@
#include <BulletDynamics/ConstraintSolver/btHingeConstraint.h>
-/**
- @author AndreaCatania
-*/
-
HingeJointBullet::HingeJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform3D &frameA, const Transform3D &frameB) :
JointBullet() {
Transform3D scaled_AFrame(frameA.scaled(rbA->get_body_scale()));
diff --git a/modules/bullet/hinge_joint_bullet.h b/modules/bullet/hinge_joint_bullet.h
index 7b87576442..5575be564f 100644
--- a/modules/bullet/hinge_joint_bullet.h
+++ b/modules/bullet/hinge_joint_bullet.h
@@ -33,10 +33,6 @@
#include "joint_bullet.h"
-/**
- @author AndreaCatania
-*/
-
class HingeJointBullet : public JointBullet {
class btHingeConstraint *hingeConstraint;
@@ -54,4 +50,5 @@ public:
void set_flag(PhysicsServer3D::HingeJointFlag p_flag, bool p_value);
bool get_flag(PhysicsServer3D::HingeJointFlag p_flag) const;
};
-#endif
+
+#endif // HINGE_JOINT_BULLET_H
diff --git a/modules/bullet/joint_bullet.cpp b/modules/bullet/joint_bullet.cpp
deleted file mode 100644
index 65a891e890..0000000000
--- a/modules/bullet/joint_bullet.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*************************************************************************/
-/* joint_bullet.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "joint_bullet.h"
-
-#include "space_bullet.h"
-
-/**
- @author AndreaCatania
-*/
-
-JointBullet::JointBullet() :
- ConstraintBullet() {}
-
-JointBullet::~JointBullet() {}
diff --git a/modules/bullet/joint_bullet.h b/modules/bullet/joint_bullet.h
index 75f6055b2f..427221dd77 100644
--- a/modules/bullet/joint_bullet.h
+++ b/modules/bullet/joint_bullet.h
@@ -34,18 +34,15 @@
#include "constraint_bullet.h"
#include "servers/physics_server_3d.h"
-/**
- @author AndreaCatania
-*/
-
class RigidBodyBullet;
class btTypedConstraint;
class JointBullet : public ConstraintBullet {
public:
- JointBullet();
- virtual ~JointBullet();
+ JointBullet() {}
+ virtual ~JointBullet() {}
virtual PhysicsServer3D::JointType get_type() const = 0;
};
-#endif
+
+#endif // JOINT_BULLET_H
diff --git a/modules/bullet/pin_joint_bullet.cpp b/modules/bullet/pin_joint_bullet.cpp
index 03853cc830..72fdd5c408 100644
--- a/modules/bullet/pin_joint_bullet.cpp
+++ b/modules/bullet/pin_joint_bullet.cpp
@@ -35,10 +35,6 @@
#include <BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h>
-/**
- @author AndreaCatania
-*/
-
PinJointBullet::PinJointBullet(RigidBodyBullet *p_body_a, const Vector3 &p_pos_a, RigidBodyBullet *p_body_b, const Vector3 &p_pos_b) :
JointBullet() {
if (p_body_b) {
diff --git a/modules/bullet/pin_joint_bullet.h b/modules/bullet/pin_joint_bullet.h
index 0510cf99ad..0a688d55f9 100644
--- a/modules/bullet/pin_joint_bullet.h
+++ b/modules/bullet/pin_joint_bullet.h
@@ -33,10 +33,6 @@
#include "joint_bullet.h"
-/**
- @author AndreaCatania
-*/
-
class RigidBodyBullet;
class PinJointBullet : public JointBullet {
@@ -57,4 +53,5 @@ public:
Vector3 getPivotInA();
Vector3 getPivotInB();
};
-#endif
+
+#endif // PIN_JOINT_BULLET_H
diff --git a/modules/bullet/register_types.cpp b/modules/bullet/register_types.cpp
index 675a5c8491..d5d0ee2cf4 100644
--- a/modules/bullet/register_types.cpp
+++ b/modules/bullet/register_types.cpp
@@ -34,10 +34,6 @@
#include "core/config/project_settings.h"
#include "core/object/class_db.h"
-/**
- @author AndreaCatania
-*/
-
#ifndef _3D_DISABLED
PhysicsServer3D *_createBulletPhysicsCallback() {
return memnew(BulletPhysicsServer3D);
diff --git a/modules/bullet/register_types.h b/modules/bullet/register_types.h
index 739614dc52..93847d6dc3 100644
--- a/modules/bullet/register_types.h
+++ b/modules/bullet/register_types.h
@@ -31,10 +31,7 @@
#ifndef REGISTER_BULLET_TYPES_H
#define REGISTER_BULLET_TYPES_H
-/**
- @author AndreaCatania
-*/
-
void register_bullet_types();
void unregister_bullet_types();
-#endif
+
+#endif // REGISTER_BULLET_TYPES_H
diff --git a/modules/bullet/rid_bullet.h b/modules/bullet/rid_bullet.h
index 982654441e..260d303cac 100644
--- a/modules/bullet/rid_bullet.h
+++ b/modules/bullet/rid_bullet.h
@@ -33,10 +33,6 @@
#include "core/templates/rid.h"
-/**
- @author AndreaCatania
-*/
-
class BulletPhysicsServer3D;
class RIDBullet {
@@ -50,4 +46,5 @@ public:
_FORCE_INLINE_ void _set_physics_server(BulletPhysicsServer3D *p_physicsServer) { physicsServer = p_physicsServer; }
_FORCE_INLINE_ BulletPhysicsServer3D *get_physics_server() const { return physicsServer; }
};
-#endif
+
+#endif // RID_BULLET_H
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index 0112712736..0603963332 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -42,12 +42,6 @@
#include <BulletDynamics/Dynamics/btRigidBody.h>
#include <btBulletCollisionCommon.h>
-#include <assert.h>
-
-/**
- @author AndreaCatania
-*/
-
BulletPhysicsDirectBodyState3D *BulletPhysicsDirectBodyState3D::singleton = nullptr;
Vector3 BulletPhysicsDirectBodyState3D::get_total_gravity() const {
diff --git a/modules/bullet/rigid_body_bullet.h b/modules/bullet/rigid_body_bullet.h
index f41c5ca1c9..cd433c968f 100644
--- a/modules/bullet/rigid_body_bullet.h
+++ b/modules/bullet/rigid_body_bullet.h
@@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef BODYBULLET_H
-#define BODYBULLET_H
+#ifndef RIGID_BODY_BULLET_H
+#define RIGID_BODY_BULLET_H
#include "collision_object_bullet.h"
#include "space_bullet.h"
@@ -37,10 +37,6 @@
#include <BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h>
#include <LinearMath/btTransform.h>
-/**
- @author AndreaCatania
-*/
-
class AreaBullet;
class SpaceBullet;
class btRigidBody;
@@ -329,4 +325,4 @@ private:
void _internal_set_mass(real_t p_mass);
};
-#endif
+#endif // RIGID_BODY_BULLET_H
diff --git a/modules/bullet/shape_bullet.cpp b/modules/bullet/shape_bullet.cpp
index 2b2a7dd8f1..77a583ad86 100644
--- a/modules/bullet/shape_bullet.cpp
+++ b/modules/bullet/shape_bullet.cpp
@@ -42,10 +42,6 @@
#include <BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h>
#include <btBulletCollisionCommon.h>
-/**
- @author AndreaCatania
-*/
-
ShapeBullet::ShapeBullet() {}
ShapeBullet::~ShapeBullet() {}
diff --git a/modules/bullet/shape_bullet.h b/modules/bullet/shape_bullet.h
index 93e9bed201..6377f8915d 100644
--- a/modules/bullet/shape_bullet.h
+++ b/modules/bullet/shape_bullet.h
@@ -40,10 +40,6 @@
#include <LinearMath/btScalar.h>
#include <LinearMath/btVector3.h>
-/**
- @author AndreaCatania
-*/
-
class ShapeBullet;
class btCollisionShape;
class ShapeOwnerBullet;
@@ -244,4 +240,5 @@ public:
private:
void setup(real_t p_length, bool p_slips_on_slope);
};
-#endif
+
+#endif // SHAPE_BULLET_H
diff --git a/modules/bullet/shape_owner_bullet.cpp b/modules/bullet/shape_owner_bullet.cpp
deleted file mode 100644
index 7f516e83c0..0000000000
--- a/modules/bullet/shape_owner_bullet.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*************************************************************************/
-/* shape_owner_bullet.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/*************************************************************************/
-
-#include "shape_owner_bullet.h"
-
-/**
- @author AndreaCatania
-*/
diff --git a/modules/bullet/shape_owner_bullet.h b/modules/bullet/shape_owner_bullet.h
index 5f8bb61503..11cf1bc2d5 100644
--- a/modules/bullet/shape_owner_bullet.h
+++ b/modules/bullet/shape_owner_bullet.h
@@ -33,10 +33,6 @@
#include "rid_bullet.h"
-/**
- @author AndreaCatania
-*/
-
class ShapeBullet;
class btCollisionShape;
class CollisionObjectBullet;
@@ -51,4 +47,5 @@ public:
virtual void remove_shape_full(class ShapeBullet *p_shape) = 0;
virtual ~ShapeOwnerBullet() {}
};
-#endif
+
+#endif // SHAPE_OWNER_BULLET_H
diff --git a/modules/bullet/slider_joint_bullet.cpp b/modules/bullet/slider_joint_bullet.cpp
index a3190609a1..61c3b3b0a3 100644
--- a/modules/bullet/slider_joint_bullet.cpp
+++ b/modules/bullet/slider_joint_bullet.cpp
@@ -36,10 +36,6 @@
#include <BulletDynamics/ConstraintSolver/btSliderConstraint.h>
-/**
- @author AndreaCatania
-*/
-
SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform3D &frameInA, const Transform3D &frameInB) :
JointBullet() {
Transform3D scaled_AFrame(frameInA.scaled(rbA->get_body_scale()));
diff --git a/modules/bullet/slider_joint_bullet.h b/modules/bullet/slider_joint_bullet.h
index 556f4e9e64..c355eb340b 100644
--- a/modules/bullet/slider_joint_bullet.h
+++ b/modules/bullet/slider_joint_bullet.h
@@ -33,10 +33,6 @@
#include "joint_bullet.h"
-/**
- @author AndreaCatania
-*/
-
class RigidBodyBullet;
class SliderJointBullet : public JointBullet {
@@ -118,4 +114,5 @@ public:
void set_param(PhysicsServer3D::SliderJointParam p_param, real_t p_value);
real_t get_param(PhysicsServer3D::SliderJointParam p_param) const;
};
-#endif
+
+#endif // SLIDER_JOINT_BULLET_H
diff --git a/modules/bullet/soft_body_bullet.h b/modules/bullet/soft_body_bullet.h
index fea26e9449..82a7bb3b0c 100644
--- a/modules/bullet/soft_body_bullet.h
+++ b/modules/bullet/soft_body_bullet.h
@@ -49,10 +49,6 @@
#define None 0L
#endif
-/**
- @author AndreaCatania
-*/
-
class RenderingServerHandler;
class SoftBodyBullet : public CollisionObjectBullet {
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp
index 55e822ba5a..460b78d778 100644
--- a/modules/bullet/space_bullet.cpp
+++ b/modules/bullet/space_bullet.cpp
@@ -54,10 +54,6 @@
#include <assert.h>
-/**
- @author AndreaCatania
-*/
-
BulletPhysicsDirectSpaceState::BulletPhysicsDirectSpaceState(SpaceBullet *p_space) :
PhysicsDirectSpaceState3D(),
space(p_space) {}
diff --git a/modules/bullet/space_bullet.h b/modules/bullet/space_bullet.h
index 154bb6f01b..f858c5fcb5 100644
--- a/modules/bullet/space_bullet.h
+++ b/modules/bullet/space_bullet.h
@@ -43,10 +43,6 @@
#include <LinearMath/btTransform.h>
#include <LinearMath/btVector3.h>
-/**
- @author AndreaCatania
-*/
-
class AreaBullet;
class btBroadphaseInterface;
class btCollisionDispatcher;
@@ -220,4 +216,5 @@ private:
int add_separation_result(PhysicsServer3D::SeparationResult *r_results, const SpaceBullet::RecoverResult &p_recover_result, int p_shape_id, const btCollisionObject *p_other_object) const;
int recover_from_penetration_ray(RigidBodyBullet *p_body, const btTransform &p_body_position, btScalar p_recover_movement_scale, bool p_infinite_inertia, int p_result_max, btVector3 &r_delta_recover_movement, PhysicsServer3D::SeparationResult *r_results);
};
-#endif
+
+#endif // SPACE_BULLET_H
diff --git a/modules/csg/csg_gizmos.cpp b/modules/csg/csg_gizmos.cpp
index f6e09067d2..9a6a33fad3 100644
--- a/modules/csg/csg_gizmos.cpp
+++ b/modules/csg/csg_gizmos.cpp
@@ -50,7 +50,7 @@ CSGShape3DGizmoPlugin::CSGShape3DGizmoPlugin() {
create_handle_material("handles");
}
-String CSGShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String CSGShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
CSGShape3D *cs = Object::cast_to<CSGShape3D>(p_gizmo->get_spatial_node());
if (Object::cast_to<CSGSphere3D>(cs)) {
@@ -72,7 +72,7 @@ String CSGShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo,
return "";
}
-Variant CSGShape3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant CSGShape3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
CSGShape3D *cs = Object::cast_to<CSGShape3D>(p_gizmo->get_spatial_node());
if (Object::cast_to<CSGSphere3D>(cs)) {
@@ -98,7 +98,7 @@ Variant CSGShape3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo
return Variant();
}
-void CSGShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void CSGShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
CSGShape3D *cs = Object::cast_to<CSGShape3D>(p_gizmo->get_spatial_node());
Transform3D gt = cs->get_global_transform();
@@ -201,7 +201,7 @@ void CSGShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_i
}
}
-void CSGShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void CSGShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
CSGShape3D *cs = Object::cast_to<CSGShape3D>(p_gizmo->get_spatial_node());
if (Object::cast_to<CSGSphere3D>(cs)) {
diff --git a/modules/csg/csg_gizmos.h b/modules/csg/csg_gizmos.h
index 1dcee642c7..46761370dd 100644
--- a/modules/csg/csg_gizmos.h
+++ b/modules/csg/csg_gizmos.h
@@ -45,10 +45,10 @@ public:
virtual bool is_selectable_when_hidden() const override;
virtual void redraw(EditorNode3DGizmo *p_gizmo) override;
- virtual String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- virtual Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- virtual void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- virtual void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) override;
+ virtual String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ virtual Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ virtual void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ virtual void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) override;
CSGShape3DGizmoPlugin();
};
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
index 476cb9cf2a..27d0777c17 100644
--- a/modules/freetype/SCsub
+++ b/modules/freetype/SCsub
@@ -48,6 +48,7 @@ if env["builtin_freetype"]:
"src/pshinter/pshinter.c",
"src/psnames/psnames.c",
"src/raster/raster.c",
+ "src/sdf/sdf.c",
"src/smooth/smooth.c",
"src/truetype/truetype.c",
"src/type1/type1.c",
diff --git a/modules/glslang/SCsub b/modules/glslang/SCsub
index 1954a32697..22ef1b5ea9 100644
--- a/modules/glslang/SCsub
+++ b/modules/glslang/SCsub
@@ -12,7 +12,6 @@ thirdparty_obj = []
if env["builtin_glslang"]:
thirdparty_dir = "#thirdparty/glslang/"
thirdparty_sources = [
- "glslang/CInterface/glslang_c_interface.cpp",
"glslang/MachineIndependent/attribute.cpp",
"glslang/MachineIndependent/Constant.cpp",
"glslang/MachineIndependent/glslang_tab.cpp",
@@ -44,7 +43,6 @@ if env["builtin_glslang"]:
"glslang/GenericCodeGen/CodeGen.cpp",
"glslang/GenericCodeGen/Link.cpp",
"OGLCompilersDLL/InitializeDll.cpp",
- "SPIRV/CInterface/spirv_c_interface.cpp",
"SPIRV/disassemble.cpp",
"SPIRV/doc.cpp",
"SPIRV/GlslangToSpv.cpp",
@@ -54,7 +52,6 @@ if env["builtin_glslang"]:
"SPIRV/SpvPostProcess.cpp",
"SPIRV/SPVRemapper.cpp",
"SPIRV/SpvTools.cpp",
- "StandAlone/ResourceLimits.cpp",
]
if env["platform"] == "windows":
@@ -65,10 +62,12 @@ if env["builtin_glslang"]:
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
# Treat glslang headers as system headers to avoid raising warnings. Not supported on MSVC.
+ # Include `#thirdparty` to workaround mismatch between location of `SPIRV` in library source
+ # and in installed public headers.
if not env.msvc:
- env_glslang.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path])
+ env_glslang.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path, "-isystem", Dir("#thirdparty").path])
else:
- env_glslang.Prepend(CPPPATH=[thirdparty_dir])
+ env_glslang.Prepend(CPPPATH=[thirdparty_dir, "#thirdparty"])
env_glslang.Append(CPPDEFINES=["ENABLE_OPT=0"])
diff --git a/modules/glslang/glslang_resource_limits.h b/modules/glslang/glslang_resource_limits.h
new file mode 100644
index 0000000000..05390f95ad
--- /dev/null
+++ b/modules/glslang/glslang_resource_limits.h
@@ -0,0 +1,147 @@
+/*************************************************************************/
+/* glslang_resource_limits.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifndef GLSLANG_RESOURCE_LIMITS_H
+#define GLSLANG_RESOURCE_LIMITS_H
+
+#include <glslang/Include/ResourceLimits.h>
+
+// Synchronized with upstream glslang/StandAlone/ResourceLimits.cpp which is not
+// part of the public API.
+
+const TBuiltInResource DefaultTBuiltInResource = {
+ /* .MaxLights = */ 32,
+ /* .MaxClipPlanes = */ 6,
+ /* .MaxTextureUnits = */ 32,
+ /* .MaxTextureCoords = */ 32,
+ /* .MaxVertexAttribs = */ 64,
+ /* .MaxVertexUniformComponents = */ 4096,
+ /* .MaxVaryingFloats = */ 64,
+ /* .MaxVertexTextureImageUnits = */ 32,
+ /* .MaxCombinedTextureImageUnits = */ 80,
+ /* .MaxTextureImageUnits = */ 32,
+ /* .MaxFragmentUniformComponents = */ 4096,
+ /* .MaxDrawBuffers = */ 32,
+ /* .MaxVertexUniformVectors = */ 128,
+ /* .MaxVaryingVectors = */ 8,
+ /* .MaxFragmentUniformVectors = */ 16,
+ /* .MaxVertexOutputVectors = */ 16,
+ /* .MaxFragmentInputVectors = */ 15,
+ /* .MinProgramTexelOffset = */ -8,
+ /* .MaxProgramTexelOffset = */ 7,
+ /* .MaxClipDistances = */ 8,
+ /* .MaxComputeWorkGroupCountX = */ 65535,
+ /* .MaxComputeWorkGroupCountY = */ 65535,
+ /* .MaxComputeWorkGroupCountZ = */ 65535,
+ /* .MaxComputeWorkGroupSizeX = */ 1024,
+ /* .MaxComputeWorkGroupSizeY = */ 1024,
+ /* .MaxComputeWorkGroupSizeZ = */ 64,
+ /* .MaxComputeUniformComponents = */ 1024,
+ /* .MaxComputeTextureImageUnits = */ 16,
+ /* .MaxComputeImageUniforms = */ 8,
+ /* .MaxComputeAtomicCounters = */ 8,
+ /* .MaxComputeAtomicCounterBuffers = */ 1,
+ /* .MaxVaryingComponents = */ 60,
+ /* .MaxVertexOutputComponents = */ 64,
+ /* .MaxGeometryInputComponents = */ 64,
+ /* .MaxGeometryOutputComponents = */ 128,
+ /* .MaxFragmentInputComponents = */ 128,
+ /* .MaxImageUnits = */ 8,
+ /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8,
+ /* .MaxCombinedShaderOutputResources = */ 8,
+ /* .MaxImageSamples = */ 0,
+ /* .MaxVertexImageUniforms = */ 0,
+ /* .MaxTessControlImageUniforms = */ 0,
+ /* .MaxTessEvaluationImageUniforms = */ 0,
+ /* .MaxGeometryImageUniforms = */ 0,
+ /* .MaxFragmentImageUniforms = */ 8,
+ /* .MaxCombinedImageUniforms = */ 8,
+ /* .MaxGeometryTextureImageUnits = */ 16,
+ /* .MaxGeometryOutputVertices = */ 256,
+ /* .MaxGeometryTotalOutputComponents = */ 1024,
+ /* .MaxGeometryUniformComponents = */ 1024,
+ /* .MaxGeometryVaryingComponents = */ 64,
+ /* .MaxTessControlInputComponents = */ 128,
+ /* .MaxTessControlOutputComponents = */ 128,
+ /* .MaxTessControlTextureImageUnits = */ 16,
+ /* .MaxTessControlUniformComponents = */ 1024,
+ /* .MaxTessControlTotalOutputComponents = */ 4096,
+ /* .MaxTessEvaluationInputComponents = */ 128,
+ /* .MaxTessEvaluationOutputComponents = */ 128,
+ /* .MaxTessEvaluationTextureImageUnits = */ 16,
+ /* .MaxTessEvaluationUniformComponents = */ 1024,
+ /* .MaxTessPatchComponents = */ 120,
+ /* .MaxPatchVertices = */ 32,
+ /* .MaxTessGenLevel = */ 64,
+ /* .MaxViewports = */ 16,
+ /* .MaxVertexAtomicCounters = */ 0,
+ /* .MaxTessControlAtomicCounters = */ 0,
+ /* .MaxTessEvaluationAtomicCounters = */ 0,
+ /* .MaxGeometryAtomicCounters = */ 0,
+ /* .MaxFragmentAtomicCounters = */ 8,
+ /* .MaxCombinedAtomicCounters = */ 8,
+ /* .MaxAtomicCounterBindings = */ 1,
+ /* .MaxVertexAtomicCounterBuffers = */ 0,
+ /* .MaxTessControlAtomicCounterBuffers = */ 0,
+ /* .MaxTessEvaluationAtomicCounterBuffers = */ 0,
+ /* .MaxGeometryAtomicCounterBuffers = */ 0,
+ /* .MaxFragmentAtomicCounterBuffers = */ 1,
+ /* .MaxCombinedAtomicCounterBuffers = */ 1,
+ /* .MaxAtomicCounterBufferSize = */ 16384,
+ /* .MaxTransformFeedbackBuffers = */ 4,
+ /* .MaxTransformFeedbackInterleavedComponents = */ 64,
+ /* .MaxCullDistances = */ 8,
+ /* .MaxCombinedClipAndCullDistances = */ 8,
+ /* .MaxSamples = */ 4,
+ /* .maxMeshOutputVerticesNV = */ 256,
+ /* .maxMeshOutputPrimitivesNV = */ 512,
+ /* .maxMeshWorkGroupSizeX_NV = */ 32,
+ /* .maxMeshWorkGroupSizeY_NV = */ 1,
+ /* .maxMeshWorkGroupSizeZ_NV = */ 1,
+ /* .maxTaskWorkGroupSizeX_NV = */ 32,
+ /* .maxTaskWorkGroupSizeY_NV = */ 1,
+ /* .maxTaskWorkGroupSizeZ_NV = */ 1,
+ /* .maxMeshViewCountNV = */ 4,
+ /* .maxDualSourceDrawBuffersEXT = */ 1,
+
+ /* .limits = */ {
+ /* .nonInductiveForLoops = */ 1,
+ /* .whileLoops = */ 1,
+ /* .doWhileLoops = */ 1,
+ /* .generalUniformIndexing = */ 1,
+ /* .generalAttributeMatrixVectorIndexing = */ 1,
+ /* .generalVaryingIndexing = */ 1,
+ /* .generalSamplerIndexing = */ 1,
+ /* .generalVariableIndexing = */ 1,
+ /* .generalConstantMatrixVectorIndexing = */ 1,
+ }
+};
+
+#endif // GLSLANG_RESOURCE_LIMITS_H
diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp
index c67d5ff5ab..8e69ba78c7 100644
--- a/modules/glslang/register_types.cpp
+++ b/modules/glslang/register_types.cpp
@@ -32,10 +32,11 @@
#include "servers/rendering/rendering_device.h"
-#include <SPIRV/GlslangToSpv.h>
-#include <StandAlone/ResourceLimits.h>
+#include "glslang_resource_limits.h"
+
#include <glslang/Include/Types.h>
#include <glslang/Public/ShaderLang.h>
+#include <glslang/SPIRV/GlslangToSpv.h>
static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage, const String &p_source_code, RenderingDevice::ShaderLanguage p_language, String *r_error, const RenderingDevice::Capabilities *p_capabilities) {
Vector<uint8_t> ret;
@@ -129,7 +130,7 @@ static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage
std::string pre_processed_code;
//preprocess
- if (!shader.preprocess(&glslang::DefaultTBuiltInResource, DefaultVersion, ENoProfile, false, false, messages, &pre_processed_code, includer)) {
+ if (!shader.preprocess(&DefaultTBuiltInResource, DefaultVersion, ENoProfile, false, false, messages, &pre_processed_code, includer)) {
if (r_error) {
(*r_error) = "Failed pre-process:\n";
(*r_error) += shader.getInfoLog();
@@ -144,7 +145,7 @@ static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage
shader.setStrings(&cs_strings, 1);
//parse
- if (!shader.parse(&glslang::DefaultTBuiltInResource, DefaultVersion, false, messages)) {
+ if (!shader.parse(&DefaultTBuiltInResource, DefaultVersion, false, messages)) {
if (r_error) {
(*r_error) = "Failed parse:\n";
(*r_error) += shader.getInfoLog();
@@ -190,8 +191,8 @@ static String _get_cache_key_function_glsl(const RenderingDevice::Capabilities *
}
void preregister_glslang_types() {
- // initialize in case it's not initialized. This is done once per thread
- // and it's safe to call multiple times
+ // Initialize in case it's not initialized. This is done once per thread
+ // and it's safe to call multiple times.
glslang::InitializeProcess();
RenderingDevice::shader_set_compile_to_spirv_function(_compile_shader_glsl);
RenderingDevice::shader_set_get_cache_key_function(_get_cache_key_function_glsl);
diff --git a/modules/mobile_vr/mobile_vr_interface.h b/modules/mobile_vr/mobile_vr_interface.h
index 9fcac3afe2..ac04763569 100644
--- a/modules/mobile_vr/mobile_vr_interface.h
+++ b/modules/mobile_vr/mobile_vr_interface.h
@@ -35,8 +35,6 @@
#include "servers/xr/xr_positional_tracker.h"
/**
- @author Bastiaan Olij <mux213@gmail.com>
-
The mobile interface is a native VR interface that can be used on Android and iOS phones.
It contains a basic implementation supporting 3DOF tracking if a gyroscope and accelerometer are
present and sets up the proper projection matrices based on the values provided.
@@ -160,4 +158,4 @@ public:
~MobileVRInterface();
};
-#endif // !MOBILE_VR_INTERFACE_H
+#endif // MOBILE_VR_INTERFACE_H
diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp
index 2b6ae5ef1e..f3da85063a 100644
--- a/modules/navigation/godot_navigation_server.cpp
+++ b/modules/navigation/godot_navigation_server.cpp
@@ -36,10 +36,6 @@
#include "navigation_mesh_generator.h"
#endif
-/**
- @author AndreaCatania
-*/
-
/// Creates a struct for each function and a function that once called creates
/// an instance of that struct with the submitted parameters.
/// Then, that struct is stored in an array; the `sync` function consume that array.
diff --git a/modules/navigation/godot_navigation_server.h b/modules/navigation/godot_navigation_server.h
index 6cc226b086..c555a358db 100644
--- a/modules/navigation/godot_navigation_server.h
+++ b/modules/navigation/godot_navigation_server.h
@@ -40,10 +40,6 @@
#include "nav_region.h"
#include "rvo_agent.h"
-/**
- @author AndreaCatania
-*/
-
/// The commands are functions executed during the `sync` phase.
#define MERGE_INTERNAL(A, B) A##B
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp
index b33b7933a8..76c31a5f42 100644
--- a/modules/navigation/nav_map.cpp
+++ b/modules/navigation/nav_map.cpp
@@ -36,10 +36,6 @@
#include <algorithm>
-/**
- @author AndreaCatania
-*/
-
#define THREE_POINTS_CROSS_PRODUCT(m_a, m_b, m_c) (((m_c) - (m_a)).cross((m_b) - (m_a)))
void NavMap::set_up(Vector3 p_up) {
diff --git a/modules/navigation/nav_map.h b/modules/navigation/nav_map.h
index cd730fe3ef..1802f4e907 100644
--- a/modules/navigation/nav_map.h
+++ b/modules/navigation/nav_map.h
@@ -36,11 +36,8 @@
#include "core/math/math_defs.h"
#include "core/templates/map.h"
#include "nav_utils.h"
-#include <KdTree.h>
-/**
- @author AndreaCatania
-*/
+#include <KdTree.h>
class NavRegion;
class RvoAgent;
diff --git a/modules/navigation/nav_region.cpp b/modules/navigation/nav_region.cpp
index 7d94e22014..fea0ad519a 100644
--- a/modules/navigation/nav_region.cpp
+++ b/modules/navigation/nav_region.cpp
@@ -32,10 +32,6 @@
#include "nav_map.h"
-/**
- @author AndreaCatania
-*/
-
void NavRegion::set_map(NavMap *p_map) {
map = p_map;
polygons_dirty = true;
diff --git a/modules/navigation/nav_region.h b/modules/navigation/nav_region.h
index c344414912..7a6da281c0 100644
--- a/modules/navigation/nav_region.h
+++ b/modules/navigation/nav_region.h
@@ -35,11 +35,8 @@
#include "nav_rid.h"
#include "nav_utils.h"
-#include <vector>
-/**
- @author AndreaCatania
-*/
+#include <vector>
class NavMap;
class NavRegion;
diff --git a/modules/navigation/nav_rid.h b/modules/navigation/nav_rid.h
index 2283973cac..31e20440d2 100644
--- a/modules/navigation/nav_rid.h
+++ b/modules/navigation/nav_rid.h
@@ -33,10 +33,6 @@
#include "core/templates/rid.h"
-/**
- @author AndreaCatania
-*/
-
class NavRid {
RID self;
diff --git a/modules/navigation/nav_utils.h b/modules/navigation/nav_utils.h
index 2d725f214c..a6f51a4698 100644
--- a/modules/navigation/nav_utils.h
+++ b/modules/navigation/nav_utils.h
@@ -35,10 +35,6 @@
#include <vector>
-/**
- @author AndreaCatania
-*/
-
class NavRegion;
namespace gd {
diff --git a/modules/navigation/rvo_agent.cpp b/modules/navigation/rvo_agent.cpp
index 6c38eaed0f..c967d0bf98 100644
--- a/modules/navigation/rvo_agent.cpp
+++ b/modules/navigation/rvo_agent.cpp
@@ -32,10 +32,6 @@
#include "nav_map.h"
-/**
- @author AndreaCatania
-*/
-
RvoAgent::RvoAgent() {
callback.id = ObjectID();
}
diff --git a/modules/navigation/rvo_agent.h b/modules/navigation/rvo_agent.h
index 2bf824186b..54baab404e 100644
--- a/modules/navigation/rvo_agent.h
+++ b/modules/navigation/rvo_agent.h
@@ -36,10 +36,6 @@
#include <Agent.h>
-/**
- @author AndreaCatania
-*/
-
class NavMap;
class RvoAgent : public NavRid {
diff --git a/modules/svg/image_loader_svg.h b/modules/svg/image_loader_svg.h
index 6052bf9831..03307c319e 100644
--- a/modules/svg/image_loader_svg.h
+++ b/modules/svg/image_loader_svg.h
@@ -34,10 +34,6 @@
#include "core/io/image_loader.h"
#include "core/string/ustring.h"
-/**
- @author Daniel Ramirez <djrmuv@gmail.com>
-*/
-
// Forward declare and include thirdparty headers in .cpp.
struct NSVGrasterizer;
struct NSVGimage;
@@ -70,4 +66,4 @@ public:
ImageLoaderSVG();
};
-#endif
+#endif // IMAGE_LOADER_SVG_H
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index f9997a437f..6002dc80da 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -3029,6 +3029,14 @@ TextServer::Direction TextServerAdvanced::shaped_text_get_direction(RID p_shaped
return sd->direction;
}
+TextServer::Direction TextServerAdvanced::shaped_text_get_inferred_direction(RID p_shaped) const {
+ const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped);
+ ERR_FAIL_COND_V(!sd, TextServer::DIRECTION_LTR);
+
+ MutexLock lock(sd->mutex);
+ return sd->para_direction;
+}
+
void TextServerAdvanced::shaped_text_set_custom_punctuation(RID p_shaped, const String &p_punct) {
_THREAD_SAFE_METHOD_
ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped);
@@ -3582,7 +3590,11 @@ float TextServerAdvanced::shaped_text_fit_to_width(RID p_shaped, float p_width,
float justification_width;
if ((p_jst_flags & JUSTIFICATION_CONSTRAIN_ELLIPSIS) == JUSTIFICATION_CONSTRAIN_ELLIPSIS) {
if (sd->overrun_trim_data.trim_pos >= 0) {
- start_pos = sd->overrun_trim_data.trim_pos;
+ if (sd->para_direction == DIRECTION_RTL) {
+ start_pos = sd->overrun_trim_data.trim_pos;
+ } else {
+ end_pos = sd->overrun_trim_data.trim_pos;
+ }
justification_width = sd->width_trimmed;
} else {
return sd->width;
@@ -3592,6 +3604,7 @@ float TextServerAdvanced::shaped_text_fit_to_width(RID p_shaped, float p_width,
}
if ((p_jst_flags & JUSTIFICATION_TRIM_EDGE_SPACES) == JUSTIFICATION_TRIM_EDGE_SPACES) {
+ // Trim spaces.
while ((start_pos < end_pos) && ((sd->glyphs[start_pos].flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE || (sd->glyphs[start_pos].flags & GRAPHEME_IS_BREAK_HARD) == GRAPHEME_IS_BREAK_HARD || (sd->glyphs[start_pos].flags & GRAPHEME_IS_BREAK_SOFT) == GRAPHEME_IS_BREAK_SOFT)) {
justification_width -= sd->glyphs[start_pos].advance * sd->glyphs[start_pos].repeat;
sd->glyphs.write[start_pos].advance = 0;
@@ -3602,6 +3615,14 @@ float TextServerAdvanced::shaped_text_fit_to_width(RID p_shaped, float p_width,
sd->glyphs.write[end_pos].advance = 0;
end_pos -= sd->glyphs[end_pos].count;
}
+ } else {
+ // Skip breaks, but do not reset size.
+ while ((start_pos < end_pos) && ((sd->glyphs[start_pos].flags & GRAPHEME_IS_BREAK_HARD) == GRAPHEME_IS_BREAK_HARD || (sd->glyphs[start_pos].flags & GRAPHEME_IS_BREAK_SOFT) == GRAPHEME_IS_BREAK_SOFT)) {
+ start_pos += sd->glyphs[start_pos].count;
+ }
+ while ((start_pos < end_pos) && ((sd->glyphs[end_pos].flags & GRAPHEME_IS_BREAK_HARD) == GRAPHEME_IS_BREAK_HARD || (sd->glyphs[end_pos].flags & GRAPHEME_IS_BREAK_SOFT) == GRAPHEME_IS_BREAK_SOFT)) {
+ end_pos -= sd->glyphs[end_pos].count;
+ }
}
int space_count = 0;
@@ -3610,7 +3631,10 @@ float TextServerAdvanced::shaped_text_fit_to_width(RID p_shaped, float p_width,
const Glyph &gl = sd->glyphs[i];
if (gl.count > 0) {
if ((gl.flags & GRAPHEME_IS_ELONGATION) == GRAPHEME_IS_ELONGATION) {
- elongation_count++;
+ if ((i > 0) && ((sd->glyphs[i - 1].flags & GRAPHEME_IS_ELONGATION) != GRAPHEME_IS_ELONGATION)) {
+ // Expand once per elongation sequence.
+ elongation_count++;
+ }
}
if ((gl.flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE) {
space_count++;
@@ -3624,12 +3648,17 @@ float TextServerAdvanced::shaped_text_fit_to_width(RID p_shaped, float p_width,
Glyph &gl = sd->glyphs.write[i];
if (gl.count > 0) {
if (((gl.flags & GRAPHEME_IS_ELONGATION) == GRAPHEME_IS_ELONGATION) && (gl.advance > 0)) {
- int count = delta_width_per_kashida / gl.advance;
- int prev_count = gl.repeat;
- if ((gl.flags & GRAPHEME_IS_VIRTUAL) == GRAPHEME_IS_VIRTUAL) {
- gl.repeat = MAX(count, 0);
+ if ((i > 0) && ((sd->glyphs[i - 1].flags & GRAPHEME_IS_ELONGATION) != GRAPHEME_IS_ELONGATION)) {
+ // Expand once per elongation sequence.
+ int count = delta_width_per_kashida / gl.advance;
+ int prev_count = gl.repeat;
+ if ((gl.flags & GRAPHEME_IS_VIRTUAL) == GRAPHEME_IS_VIRTUAL) {
+ gl.repeat = MAX(count, 0);
+ } else {
+ gl.repeat = MAX(count + 1, 1);
+ }
+ justification_width += (gl.repeat - prev_count) * gl.advance;
}
- justification_width += (gl.repeat - prev_count) * gl.advance;
}
}
}
@@ -3671,7 +3700,7 @@ float TextServerAdvanced::shaped_text_fit_to_width(RID p_shaped, float p_width,
sd->width = justification_width;
}
- return sd->width;
+ return justification_width;
}
float TextServerAdvanced::shaped_text_tab_align(RID p_shaped, const PackedFloat32Array &p_tab_stops) {
@@ -3759,23 +3788,56 @@ void TextServerAdvanced::shaped_text_overrun_trim_to_width(RID p_shaped_line, fl
return;
}
+ Vector<ShapedTextDataAdvanced::Span> &spans = sd->spans;
+ if (sd->parent != RID()) {
+ ShapedTextDataAdvanced *parent_sd = shaped_owner.get_or_null(sd->parent);
+ ERR_FAIL_COND(!parent_sd->valid);
+ spans = parent_sd->spans;
+ }
+
+ if (spans.size() == 0) {
+ return;
+ }
+
int sd_size = sd->glyphs.size();
- RID last_gl_font_rid = sd_glyphs[sd_size - 1].font_rid;
int last_gl_font_size = sd_glyphs[sd_size - 1].font_size;
- int32_t dot_gl_idx = font_get_glyph_index(last_gl_font_rid, last_gl_font_size, '.');
- Vector2 dot_adv = font_get_glyph_advance(last_gl_font_rid, last_gl_font_size, dot_gl_idx);
- int32_t whitespace_gl_idx = font_get_glyph_index(last_gl_font_rid, last_gl_font_size, ' ');
- Vector2 whitespace_adv = font_get_glyph_advance(last_gl_font_rid, last_gl_font_size, whitespace_gl_idx);
+
+ // Find usable fonts, if fonts from the last glyph do not have required chars.
+ RID dot_gl_font_rid = sd_glyphs[sd_size - 1].font_rid;
+ if (!font_has_char(dot_gl_font_rid, '.')) {
+ const Vector<RID> &fonts = spans[spans.size() - 1].fonts;
+ for (const RID &font : fonts) {
+ if (font_has_char(font, '.')) {
+ dot_gl_font_rid = font;
+ break;
+ }
+ }
+ }
+ RID whitespace_gl_font_rid = sd_glyphs[sd_size - 1].font_rid;
+ if (!font_has_char(whitespace_gl_font_rid, '.')) {
+ const Vector<RID> &fonts = spans[spans.size() - 1].fonts;
+ for (const RID &font : fonts) {
+ if (font_has_char(font, ' ')) {
+ whitespace_gl_font_rid = font;
+ break;
+ }
+ }
+ }
+
+ int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, '.') : -10;
+ Vector2 dot_adv = dot_gl_font_rid.is_valid() ? font_get_glyph_advance(dot_gl_font_rid, last_gl_font_size, dot_gl_idx) : Vector2();
+ int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ') : -10;
+ Vector2 whitespace_adv = whitespace_gl_font_rid.is_valid() ? font_get_glyph_advance(whitespace_gl_font_rid, last_gl_font_size, whitespace_gl_idx) : Vector2();
int ellipsis_width = 0;
- if (add_ellipsis) {
- ellipsis_width = 3 * dot_adv.x + font_get_spacing(last_gl_font_rid, last_gl_font_size, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0);
+ if (add_ellipsis && whitespace_gl_font_rid.is_valid()) {
+ ellipsis_width = 3 * dot_adv.x + font_get_spacing(whitespace_gl_font_rid, last_gl_font_size, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0);
}
int ell_min_characters = 6;
float width = sd->width;
- bool is_rtl = sd->direction == DIRECTION_RTL || (sd->direction == DIRECTION_AUTO && sd->para_direction == DIRECTION_RTL);
+ bool is_rtl = sd->para_direction == DIRECTION_RTL;
int trim_pos = (is_rtl) ? sd_size : 0;
int ellipsis_pos = (enforce_ellipsis) ? 0 : -1;
@@ -3833,23 +3895,25 @@ void TextServerAdvanced::shaped_text_overrun_trim_to_width(RID p_shaped_line, fl
gl.count = 1;
gl.advance = whitespace_adv.x;
gl.index = whitespace_gl_idx;
- gl.font_rid = last_gl_font_rid;
+ gl.font_rid = whitespace_gl_font_rid;
gl.font_size = last_gl_font_size;
gl.flags = GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT | GRAPHEME_IS_VIRTUAL | (is_rtl ? GRAPHEME_IS_RTL : 0);
sd->overrun_trim_data.ellipsis_glyph_buf.append(gl);
}
// Add ellipsis dots.
- Glyph gl;
- gl.count = 1;
- gl.repeat = 3;
- gl.advance = dot_adv.x;
- gl.index = dot_gl_idx;
- gl.font_rid = last_gl_font_rid;
- gl.font_size = last_gl_font_size;
- gl.flags = GRAPHEME_IS_PUNCTUATION | GRAPHEME_IS_VIRTUAL | (is_rtl ? GRAPHEME_IS_RTL : 0);
-
- sd->overrun_trim_data.ellipsis_glyph_buf.append(gl);
+ if (dot_gl_idx != 0) {
+ Glyph gl;
+ gl.count = 1;
+ gl.repeat = 3;
+ gl.advance = dot_adv.x;
+ gl.index = dot_gl_idx;
+ gl.font_rid = dot_gl_font_rid;
+ gl.font_size = last_gl_font_size;
+ gl.flags = GRAPHEME_IS_PUNCTUATION | GRAPHEME_IS_VIRTUAL | (is_rtl ? GRAPHEME_IS_RTL : 0);
+
+ sd->overrun_trim_data.ellipsis_glyph_buf.append(gl);
+ }
}
sd->text_trimmed = true;
@@ -3920,21 +3984,19 @@ bool TextServerAdvanced::shaped_text_update_breaks(RID p_shaped) {
for (int j = r_start; j < r_end; j++) {
char32_t c = sd->text[j - sd->start];
if (is_whitespace(c)) {
- breaks[j] = false;
+ breaks[j + 1] = false;
}
if (is_linebreak(c)) {
- breaks[j] = true;
+ breaks[j + 1] = true;
}
}
} else {
while (ubrk_next(bi) != UBRK_DONE) {
- int pos = _convert_pos(sd, ubrk_current(bi)) + r_start - 1;
- if (pos != r_end) {
- if ((ubrk_getRuleStatus(bi) >= UBRK_LINE_HARD) && (ubrk_getRuleStatus(bi) < UBRK_LINE_HARD_LIMIT)) {
- breaks[pos] = true;
- } else if ((ubrk_getRuleStatus(bi) >= UBRK_LINE_SOFT) && (ubrk_getRuleStatus(bi) < UBRK_LINE_SOFT_LIMIT)) {
- breaks[pos] = false;
- }
+ int pos = _convert_pos(sd, ubrk_current(bi)) + r_start;
+ if ((ubrk_getRuleStatus(bi) >= UBRK_LINE_HARD) && (ubrk_getRuleStatus(bi) < UBRK_LINE_HARD_LIMIT)) {
+ breaks[pos] = true;
+ } else if ((ubrk_getRuleStatus(bi) >= UBRK_LINE_SOFT) && (ubrk_getRuleStatus(bi) < UBRK_LINE_SOFT_LIMIT)) {
+ breaks[pos] = false;
}
}
}
@@ -3978,34 +4040,46 @@ bool TextServerAdvanced::shaped_text_update_breaks(RID p_shaped) {
if (is_underscore(c)) {
sd_glyphs[i].flags |= GRAPHEME_IS_UNDERSCORE;
}
- if (breaks.has(sd->glyphs[i].start)) {
- if (breaks[sd->glyphs[i].start]) {
+ if (breaks.has(sd_glyphs[i].end)) {
+ if (breaks[sd_glyphs[i].end] && (is_linebreak(c))) {
sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_HARD;
+ } else if (is_whitespace(c)) {
+ sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_SOFT;
} else {
- if (is_whitespace(c)) {
- sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_SOFT;
+ int count = sd_glyphs[i].count;
+ // Do not add extra space at the end of the line.
+ if (sd_glyphs[i].end == sd->end) {
+ continue;
+ }
+ // Do not add extra space after existing space.
+ if (sd_glyphs[i].flags & GRAPHEME_IS_RTL) {
+ if ((i + count < sd_size - 1) && ((sd_glyphs[i + count].flags & (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT)) == (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT))) {
+ continue;
+ }
} else {
- Glyph gl;
- gl.start = sd_glyphs[i].start;
- gl.end = sd_glyphs[i].end;
- gl.count = 1;
- gl.font_rid = sd_glyphs[i].font_rid;
- gl.font_size = sd_glyphs[i].font_size;
- gl.flags = GRAPHEME_IS_BREAK_SOFT | GRAPHEME_IS_VIRTUAL;
- if (sd->glyphs[i].flags & GRAPHEME_IS_RTL) {
- gl.flags |= GRAPHEME_IS_RTL;
- sd->glyphs.insert(i, gl); // Insert before.
- } else {
- sd->glyphs.insert(i + sd_glyphs[i].count, gl); // Insert after.
+ if ((i > 0) && ((sd_glyphs[i - 1].flags & (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT)) == (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT))) {
+ continue;
}
-
- // Update write pointer and size.
- sd_size = sd->glyphs.size();
- sd_glyphs = sd->glyphs.ptrw();
-
- i += sd_glyphs[i].count;
- continue;
}
+ Glyph gl;
+ gl.start = sd_glyphs[i].start;
+ gl.end = sd_glyphs[i].end;
+ gl.count = 1;
+ gl.font_rid = sd_glyphs[i].font_rid;
+ gl.font_size = sd_glyphs[i].font_size;
+ gl.flags = GRAPHEME_IS_BREAK_SOFT | GRAPHEME_IS_VIRTUAL | GRAPHEME_IS_SPACE;
+ if (sd_glyphs[i].flags & GRAPHEME_IS_RTL) {
+ gl.flags |= GRAPHEME_IS_RTL;
+ sd->glyphs.insert(i, gl); // Insert before.
+ } else {
+ sd->glyphs.insert(i + count, gl); // Insert after.
+ }
+ i += count;
+
+ // Update write pointer and size.
+ sd_size = sd->glyphs.size();
+ sd_glyphs = sd->glyphs.ptrw();
+ continue;
}
}
@@ -4151,53 +4225,80 @@ bool TextServerAdvanced::shaped_text_update_justification_ops(RID p_shaped) {
sd->sort_valid = false;
sd->glyphs_logical.clear();
- int sd_size = sd->glyphs.size();
+ Glyph *sd_glyphs = sd->glyphs.ptrw();
+ int sd_size = sd->glyphs.size();
if (jstops.size() > 0) {
for (int i = 0; i < sd_size; i++) {
- if (sd->glyphs[i].count > 0) {
- if (jstops.has(sd->glyphs[i].start)) {
- char32_t c = sd->text[sd->glyphs[i].start - sd->start];
+ if (sd_glyphs[i].count > 0) {
+ char32_t c = sd->text[sd_glyphs[i].start - sd->start];
+ if (c == 0x0640) {
+ sd_glyphs[i].flags |= GRAPHEME_IS_ELONGATION;
+ }
+ if (jstops.has(sd_glyphs[i].start)) {
if (c == 0xfffc) {
continue;
}
- if (jstops[sd->glyphs[i].start]) {
- if (c == 0x0640) {
- sd->glyphs.write[i].flags |= GRAPHEME_IS_ELONGATION;
- } else {
- if (sd->glyphs[i].font_rid != RID()) {
+ if (jstops[sd_glyphs[i].start]) {
+ if (c != 0x0640) {
+ if (sd_glyphs[i].font_rid != RID()) {
Glyph gl = _shape_single_glyph(sd, 0x0640, HB_SCRIPT_ARABIC, HB_DIRECTION_RTL, sd->glyphs[i].font_rid, sd->glyphs[i].font_size);
- if ((gl.flags & GRAPHEME_IS_VALID) == GRAPHEME_IS_VALID) {
- gl.start = sd->glyphs[i].start;
- gl.end = sd->glyphs[i].end;
+ if ((sd_glyphs[i].flags & GRAPHEME_IS_VALID) == GRAPHEME_IS_VALID) {
+ gl.start = sd_glyphs[i].start;
+ gl.end = sd_glyphs[i].end;
gl.repeat = 0;
gl.count = 1;
if (sd->orientation == ORIENTATION_HORIZONTAL) {
- gl.y_off = sd->glyphs[i].y_off;
+ gl.y_off = sd_glyphs[i].y_off;
} else {
- gl.x_off = sd->glyphs[i].x_off;
+ gl.x_off = sd_glyphs[i].x_off;
}
gl.flags |= GRAPHEME_IS_ELONGATION | GRAPHEME_IS_VIRTUAL;
sd->glyphs.insert(i, gl);
i++;
+
+ // Update write pointer and size.
+ sd_size = sd->glyphs.size();
+ sd_glyphs = sd->glyphs.ptrw();
+ continue;
}
}
}
- } else if (!is_whitespace(c)) {
+ } else if ((sd_glyphs[i].flags & GRAPHEME_IS_SPACE) != GRAPHEME_IS_SPACE) {
+ int count = sd_glyphs[i].count;
+ // Do not add extra spaces at the end of the line.
+ if (sd_glyphs[i].end == sd->end) {
+ continue;
+ }
+ // Do not add extra space after existing space.
+ if (sd_glyphs[i].flags & GRAPHEME_IS_RTL) {
+ if ((i + count < sd_size - 1) && ((sd_glyphs[i + count].flags & (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT)) == (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT))) {
+ continue;
+ }
+ } else {
+ if ((i > 0) && ((sd_glyphs[i - 1].flags & (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT)) == (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT))) {
+ continue;
+ }
+ }
+ // Inject virtual space for alignment.
Glyph gl;
- gl.start = sd->glyphs[i].start;
- gl.end = sd->glyphs[i].end;
+ gl.start = sd_glyphs[i].start;
+ gl.end = sd_glyphs[i].end;
gl.count = 1;
- gl.font_rid = sd->glyphs[i].font_rid;
- gl.font_size = sd->glyphs[i].font_size;
+ gl.font_rid = sd_glyphs[i].font_rid;
+ gl.font_size = sd_glyphs[i].font_size;
gl.flags = GRAPHEME_IS_SPACE | GRAPHEME_IS_VIRTUAL;
- if (sd->glyphs[i].flags & GRAPHEME_IS_RTL) {
+ if (sd_glyphs[i].flags & GRAPHEME_IS_RTL) {
gl.flags |= GRAPHEME_IS_RTL;
sd->glyphs.insert(i, gl); // Insert before.
} else {
- sd->glyphs.insert(i + sd->glyphs[i].count, gl); // Insert after.
+ sd->glyphs.insert(i + count, gl); // Insert after.
}
- i += sd->glyphs[i].count;
+ i += count;
+
+ // Update write pointer and size.
+ sd_size = sd->glyphs.size();
+ sd_glyphs = sd->glyphs.ptrw();
continue;
}
}
diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h
index 6ff9817dcf..d088219d91 100644
--- a/modules/text_server_adv/text_server_adv.h
+++ b/modules/text_server_adv/text_server_adv.h
@@ -466,6 +466,7 @@ public:
virtual void shaped_text_set_direction(RID p_shaped, Direction p_direction = DIRECTION_AUTO) override;
virtual Direction shaped_text_get_direction(RID p_shaped) const override;
+ virtual Direction shaped_text_get_inferred_direction(RID p_shaped) const override;
virtual void shaped_text_set_bidi_override(RID p_shaped, const Array &p_override) override;
diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp
index f28d174c5c..c7a7c4aa70 100644
--- a/modules/text_server_fb/text_server_fb.cpp
+++ b/modules/text_server_fb/text_server_fb.cpp
@@ -2128,6 +2128,10 @@ TextServer::Direction TextServerFallback::shaped_text_get_direction(RID p_shaped
return TextServer::DIRECTION_LTR;
}
+TextServer::Direction TextServerFallback::shaped_text_get_inferred_direction(RID p_shaped) const {
+ return TextServer::DIRECTION_LTR;
+}
+
void TextServerFallback::shaped_text_set_custom_punctuation(RID p_shaped, const String &p_punct) {
_THREAD_SAFE_METHOD_
ShapedTextData *sd = shaped_owner.get_or_null(p_shaped);
@@ -2631,17 +2635,38 @@ float TextServerFallback::shaped_text_fit_to_width(RID p_shaped, float p_width,
}
}
+ float justification_width;
+ if ((p_jst_flags & JUSTIFICATION_CONSTRAIN_ELLIPSIS) == JUSTIFICATION_CONSTRAIN_ELLIPSIS) {
+ if (sd->overrun_trim_data.trim_pos >= 0) {
+ end_pos = sd->overrun_trim_data.trim_pos;
+ justification_width = sd->width_trimmed;
+ } else {
+ return sd->width;
+ }
+ } else {
+ justification_width = sd->width;
+ }
+
if ((p_jst_flags & JUSTIFICATION_TRIM_EDGE_SPACES) == JUSTIFICATION_TRIM_EDGE_SPACES) {
+ // Trim spaces.
while ((start_pos < end_pos) && ((sd->glyphs[start_pos].flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE || (sd->glyphs[start_pos].flags & GRAPHEME_IS_BREAK_HARD) == GRAPHEME_IS_BREAK_HARD || (sd->glyphs[start_pos].flags & GRAPHEME_IS_BREAK_SOFT) == GRAPHEME_IS_BREAK_SOFT)) {
- sd->width -= sd->glyphs[start_pos].advance * sd->glyphs[start_pos].repeat;
+ justification_width -= sd->glyphs[start_pos].advance * sd->glyphs[start_pos].repeat;
sd->glyphs.write[start_pos].advance = 0;
start_pos += sd->glyphs[start_pos].count;
}
while ((start_pos < end_pos) && ((sd->glyphs[end_pos].flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE || (sd->glyphs[end_pos].flags & GRAPHEME_IS_BREAK_HARD) == GRAPHEME_IS_BREAK_HARD || (sd->glyphs[end_pos].flags & GRAPHEME_IS_BREAK_SOFT) == GRAPHEME_IS_BREAK_SOFT)) {
- sd->width -= sd->glyphs[end_pos].advance * sd->glyphs[end_pos].repeat;
+ justification_width -= sd->glyphs[end_pos].advance * sd->glyphs[end_pos].repeat;
sd->glyphs.write[end_pos].advance = 0;
end_pos -= sd->glyphs[end_pos].count;
}
+ } else {
+ // Skip breaks, but do not reset size.
+ while ((start_pos < end_pos) && ((sd->glyphs[start_pos].flags & GRAPHEME_IS_BREAK_HARD) == GRAPHEME_IS_BREAK_HARD)) {
+ start_pos += sd->glyphs[start_pos].count;
+ }
+ while ((start_pos < end_pos) && ((sd->glyphs[end_pos].flags & GRAPHEME_IS_BREAK_HARD) == GRAPHEME_IS_BREAK_HARD)) {
+ end_pos -= sd->glyphs[end_pos].count;
+ }
}
int space_count = 0;
@@ -2655,20 +2680,28 @@ float TextServerFallback::shaped_text_fit_to_width(RID p_shaped, float p_width,
}
if ((space_count > 0) && ((p_jst_flags & JUSTIFICATION_WORD_BOUND) == JUSTIFICATION_WORD_BOUND)) {
- float delta_width_per_space = (p_width - sd->width) / space_count;
+ float delta_width_per_space = (p_width - justification_width) / space_count;
for (int i = start_pos; i <= end_pos; i++) {
Glyph &gl = sd->glyphs.write[i];
if (gl.count > 0) {
if ((gl.flags & GRAPHEME_IS_SPACE) == GRAPHEME_IS_SPACE) {
float old_adv = gl.advance;
gl.advance = MAX(gl.advance + delta_width_per_space, Math::round(0.1 * gl.font_size));
- sd->width += (gl.advance - old_adv);
+ justification_width += (gl.advance - old_adv);
}
}
}
}
- return sd->width;
+ if (Math::floor(p_width) < Math::floor(justification_width)) {
+ sd->fit_width_minimum_reached = true;
+ }
+
+ if ((p_jst_flags & JUSTIFICATION_CONSTRAIN_ELLIPSIS) != JUSTIFICATION_CONSTRAIN_ELLIPSIS) {
+ sd->width = justification_width;
+ }
+
+ return justification_width;
}
float TextServerFallback::shaped_text_tab_align(RID p_shaped, const PackedFloat32Array &p_tab_stops) {
@@ -2769,6 +2802,7 @@ bool TextServerFallback::shaped_text_update_breaks(RID p_shaped) {
sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_SOFT;
}
if (is_linebreak(c)) {
+ sd_glyphs[i].flags |= GRAPHEME_IS_SPACE;
sd_glyphs[i].flags |= GRAPHEME_IS_BREAK_HARD;
}
if (c == 0x0009 || c == 0x000b) {
@@ -2827,17 +2861,50 @@ void TextServerFallback::shaped_text_overrun_trim_to_width(RID p_shaped_line, fl
return;
}
+ Vector<ShapedTextData::Span> &spans = sd->spans;
+ if (sd->parent != RID()) {
+ ShapedTextData *parent_sd = shaped_owner.get_or_null(sd->parent);
+ ERR_FAIL_COND(!parent_sd->valid);
+ spans = parent_sd->spans;
+ }
+
+ if (spans.size() == 0) {
+ return;
+ }
+
int sd_size = sd->glyphs.size();
- RID last_gl_font_rid = sd_glyphs[sd_size - 1].font_rid;
int last_gl_font_size = sd_glyphs[sd_size - 1].font_size;
- int32_t dot_gl_idx = font_get_glyph_index(last_gl_font_rid, '.', 0);
- Vector2 dot_adv = font_get_glyph_advance(last_gl_font_rid, last_gl_font_size, dot_gl_idx);
- int32_t whitespace_gl_idx = font_get_glyph_index(last_gl_font_rid, ' ', 0);
- Vector2 whitespace_adv = font_get_glyph_advance(last_gl_font_rid, last_gl_font_size, whitespace_gl_idx);
+
+ // Find usable fonts, if fonts from the last glyph do not have required chars.
+ RID dot_gl_font_rid = sd_glyphs[sd_size - 1].font_rid;
+ if (!font_has_char(dot_gl_font_rid, '.')) {
+ const Vector<RID> &fonts = spans[spans.size() - 1].fonts;
+ for (const RID &font : fonts) {
+ if (font_has_char(font, '.')) {
+ dot_gl_font_rid = font;
+ break;
+ }
+ }
+ }
+ RID whitespace_gl_font_rid = sd_glyphs[sd_size - 1].font_rid;
+ if (!font_has_char(whitespace_gl_font_rid, '.')) {
+ const Vector<RID> &fonts = spans[spans.size() - 1].fonts;
+ for (const RID &font : fonts) {
+ if (font_has_char(font, ' ')) {
+ whitespace_gl_font_rid = font;
+ break;
+ }
+ }
+ }
+
+ int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, '.') : -10;
+ Vector2 dot_adv = dot_gl_font_rid.is_valid() ? font_get_glyph_advance(dot_gl_font_rid, last_gl_font_size, dot_gl_idx) : Vector2();
+ int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ') : -10;
+ Vector2 whitespace_adv = whitespace_gl_font_rid.is_valid() ? font_get_glyph_advance(whitespace_gl_font_rid, last_gl_font_size, whitespace_gl_idx) : Vector2();
int ellipsis_width = 0;
- if (add_ellipsis) {
- ellipsis_width = 3 * dot_adv.x + font_get_spacing(last_gl_font_rid, last_gl_font_size, TextServer::SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0);
+ if (add_ellipsis && whitespace_gl_font_rid.is_valid()) {
+ ellipsis_width = 3 * dot_adv.x + font_get_spacing(whitespace_gl_font_rid, last_gl_font_size, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0);
}
int ell_min_characters = 6;
@@ -2891,23 +2958,25 @@ void TextServerFallback::shaped_text_overrun_trim_to_width(RID p_shaped_line, fl
gl.count = 1;
gl.advance = whitespace_adv.x;
gl.index = whitespace_gl_idx;
- gl.font_rid = last_gl_font_rid;
+ gl.font_rid = whitespace_gl_font_rid;
gl.font_size = last_gl_font_size;
gl.flags = GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT | GRAPHEME_IS_VIRTUAL;
sd->overrun_trim_data.ellipsis_glyph_buf.append(gl);
}
// Add ellipsis dots.
- Glyph gl;
- gl.count = 1;
- gl.repeat = 3;
- gl.advance = dot_adv.x;
- gl.index = dot_gl_idx;
- gl.font_rid = last_gl_font_rid;
- gl.font_size = last_gl_font_size;
- gl.flags = GRAPHEME_IS_PUNCTUATION | GRAPHEME_IS_VIRTUAL;
+ if (dot_gl_idx != 0) {
+ Glyph gl;
+ gl.count = 1;
+ gl.repeat = 3;
+ gl.advance = dot_adv.x;
+ gl.index = dot_gl_idx;
+ gl.font_rid = dot_gl_font_rid;
+ gl.font_size = last_gl_font_size;
+ gl.flags = GRAPHEME_IS_PUNCTUATION | GRAPHEME_IS_VIRTUAL;
- sd->overrun_trim_data.ellipsis_glyph_buf.append(gl);
+ sd->overrun_trim_data.ellipsis_glyph_buf.append(gl);
+ }
}
sd->text_trimmed = true;
@@ -3023,13 +3092,13 @@ bool TextServerFallback::shaped_text_shape(RID p_shaped) {
if (gl.font_rid.is_valid()) {
if (sd->text[j - sd->start] != 0 && !is_linebreak(sd->text[j - sd->start])) {
if (sd->orientation == ORIENTATION_HORIZONTAL) {
- gl.advance = font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x;
+ gl.advance = Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x);
gl.x_off = 0;
gl.y_off = 0;
sd->ascent = MAX(sd->ascent, font_get_ascent(gl.font_rid, gl.font_size));
sd->descent = MAX(sd->descent, font_get_descent(gl.font_rid, gl.font_size));
} else {
- gl.advance = font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).y;
+ gl.advance = Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).y);
gl.x_off = -Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5);
gl.y_off = font_get_ascent(gl.font_rid, gl.font_size);
sd->ascent = MAX(sd->ascent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5));
diff --git a/modules/text_server_fb/text_server_fb.h b/modules/text_server_fb/text_server_fb.h
index 9d1be50b04..e8619e0825 100644
--- a/modules/text_server_fb/text_server_fb.h
+++ b/modules/text_server_fb/text_server_fb.h
@@ -375,6 +375,7 @@ public:
virtual void shaped_text_set_direction(RID p_shaped, Direction p_direction = DIRECTION_AUTO) override;
virtual Direction shaped_text_get_direction(RID p_shaped) const override;
+ virtual Direction shaped_text_get_inferred_direction(RID p_shaped) const override;
virtual void shaped_text_set_bidi_override(RID p_shaped, const Array &p_override) override;
diff --git a/modules/tga/image_loader_tga.h b/modules/tga/image_loader_tga.h
index feaff5925f..282a2a1662 100644
--- a/modules/tga/image_loader_tga.h
+++ b/modules/tga/image_loader_tga.h
@@ -33,9 +33,6 @@
#include "core/io/image_loader.h"
-/**
- @author SaracenOne
-*/
class ImageLoaderTGA : public ImageFormatLoader {
enum tga_type_e {
TGA_TYPE_NO_DATA = 0,
@@ -81,4 +78,4 @@ public:
ImageLoaderTGA();
};
-#endif
+#endif // IMAGE_LOADER_TGA_H
diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp
index bc40f4f9b4..0436f90c4c 100644
--- a/modules/visual_script/editor/visual_script_editor.cpp
+++ b/modules/visual_script/editor/visual_script_editor.cpp
@@ -1973,7 +1973,7 @@ void VisualScriptEditor::input(const Ref<InputEvent> &p_event) {
// GUI input for VS Editor Plugin
Ref<InputEventMouseButton> key = p_event;
- if (key.is_valid() && !key->is_pressed()) {
+ if (key.is_valid() && key->is_pressed()) {
mouse_up_position = get_screen_position() + get_local_mouse_position();
}
}
@@ -1982,10 +1982,28 @@ void VisualScriptEditor::_graph_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> key = p_event;
if (key.is_valid() && key->is_pressed() && key->get_button_mask() == MouseButton::RIGHT) {
- saved_position = graph->get_local_mouse_position();
+ bool is_empty_selection = true;
- Point2 gpos = get_screen_position() + get_local_mouse_position();
- _generic_search(script->get_instance_base_type(), gpos);
+ for (int i = 0; i < graph->get_child_count(); i++) {
+ GraphNode *gn = Object::cast_to<GraphNode>(graph->get_child(i));
+ if (gn && gn->is_selected()) {
+ is_empty_selection = false;
+ break;
+ }
+ }
+ if (is_empty_selection && clipboard->nodes.is_empty()) {
+ _generic_search(script->get_instance_base_type(), mouse_up_position);
+ } else {
+ popup_menu->set_item_disabled(int(EDIT_CUT_NODES), is_empty_selection);
+ popup_menu->set_item_disabled(int(EDIT_COPY_NODES), is_empty_selection);
+ popup_menu->set_item_disabled(int(EDIT_PASTE_NODES), clipboard->nodes.is_empty());
+ popup_menu->set_item_disabled(int(EDIT_DELETE_NODES), is_empty_selection);
+ popup_menu->set_item_disabled(int(EDIT_DUPLICATE_NODES), is_empty_selection);
+ popup_menu->set_item_disabled(int(EDIT_CLEAR_COPY_BUFFER), clipboard->nodes.is_empty());
+
+ popup_menu->set_position(mouse_up_position);
+ popup_menu->popup();
+ }
}
}
@@ -3753,6 +3771,11 @@ void VisualScriptEditor::_toggle_scripts_pressed() {
void VisualScriptEditor::_notification(int p_what) {
switch (p_what) {
+ case NOTIFICATION_ENTER_TREE:
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ graph->set_panning_scheme((GraphEdit::PanningScheme)EDITOR_GET("interface/editors/sub_editor_panning_scheme").operator int());
+ } break;
+
case NOTIFICATION_READY: {
variable_editor->connect("changed", callable_mp(this, &VisualScriptEditor::_update_members));
variable_editor->connect("changed", callable_mp(this, &VisualScriptEditor::_update_graph), varray(-1), CONNECT_DEFERRED);
@@ -3868,6 +3891,9 @@ void VisualScriptEditor::_comment_node_resized(const Vector2 &p_new_size, int p_
void VisualScriptEditor::_menu_option(int p_what) {
switch (p_what) {
+ case EDIT_ADD_NODE: {
+ _generic_search(script->get_instance_base_type(), mouse_up_position);
+ } break;
case EDIT_DELETE_NODES: {
_on_nodes_delete();
} break;
@@ -3908,6 +3934,9 @@ void VisualScriptEditor::_menu_option(int p_what) {
case EDIT_PASTE_NODES: {
_on_nodes_paste();
} break;
+ case EDIT_DUPLICATE_NODES: {
+ _on_nodes_duplicate();
+ } break;
case EDIT_CREATE_FUNCTION: {
// Create Function.
Map<int, Ref<VisualScriptNode>> nodes;
@@ -4135,6 +4164,12 @@ void VisualScriptEditor::_menu_option(int p_what) {
case REFRESH_GRAPH: {
_update_graph();
} break;
+ case EDIT_CLEAR_COPY_BUFFER: {
+ clipboard->nodes.clear();
+ clipboard->nodes_positions.clear();
+ clipboard->data_connections.clear();
+ clipboard->sequence_connections.clear();
+ } break;
}
}
@@ -4322,9 +4357,6 @@ VisualScriptEditor::VisualScriptEditor() {
if (!clipboard) {
clipboard = memnew(Clipboard);
}
- updating_graph = false;
- saved_pos_dirty = false;
- saved_position = Vector2(0, 0);
edit_menu = memnew(MenuButton);
edit_menu->set_shortcut_context(this);
@@ -4556,6 +4588,18 @@ VisualScriptEditor::VisualScriptEditor() {
new_virtual_method_select = memnew(VisualScriptPropertySelector);
add_child(new_virtual_method_select);
new_virtual_method_select->connect("selected", callable_mp(this, &VisualScriptEditor::_selected_new_virtual_method));
+
+ popup_menu = memnew(PopupMenu);
+ add_child(popup_menu);
+ popup_menu->add_item(TTR("Add Node"), EDIT_ADD_NODE);
+ popup_menu->add_separator();
+ popup_menu->add_item(TTR("Cut"), EDIT_CUT_NODES);
+ popup_menu->add_item(TTR("Copy"), EDIT_COPY_NODES);
+ popup_menu->add_item(TTR("Paste"), EDIT_PASTE_NODES);
+ popup_menu->add_item(TTR("Delete"), EDIT_DELETE_NODES);
+ popup_menu->add_item(TTR("Duplicate"), EDIT_DUPLICATE_NODES);
+ popup_menu->add_item(TTR("Clear Copy Buffer"), EDIT_CLEAR_COPY_BUFFER);
+ popup_menu->connect("id_pressed", callable_mp(this, &VisualScriptEditor::_menu_option));
}
VisualScriptEditor::~VisualScriptEditor() {
diff --git a/modules/visual_script/editor/visual_script_editor.h b/modules/visual_script/editor/visual_script_editor.h
index b232b05391..90e4fb9d56 100644
--- a/modules/visual_script/editor/visual_script_editor.h
+++ b/modules/visual_script/editor/visual_script_editor.h
@@ -54,13 +54,18 @@ class VisualScriptEditor : public ScriptEditorBase {
};
enum {
- EDIT_DELETE_NODES,
- EDIT_TOGGLE_BREAKPOINT,
- EDIT_FIND_NODE_TYPE,
- EDIT_COPY_NODES,
+ EDIT_ADD_NODE,
+ EDIT_SEPARATOR, // popup menu separator - ignored
EDIT_CUT_NODES,
+ EDIT_COPY_NODES,
EDIT_PASTE_NODES,
+ EDIT_DELETE_NODES,
+ EDIT_DUPLICATE_NODES,
+ EDIT_CLEAR_COPY_BUFFER,
+
EDIT_CREATE_FUNCTION,
+ EDIT_TOGGLE_BREAKPOINT,
+ EDIT_FIND_NODE_TYPE,
REFRESH_GRAPH,
};
@@ -123,7 +128,7 @@ class VisualScriptEditor : public ScriptEditorBase {
Label *select_func_text;
- bool updating_graph;
+ bool updating_graph = false;
void _show_hint(const String &p_hint);
void _hide_timer();
@@ -162,7 +167,8 @@ class VisualScriptEditor : public ScriptEditorBase {
static Clipboard *clipboard;
- PopupMenu *member_popup;
+ PopupMenu *popup_menu = nullptr;
+ PopupMenu *member_popup = nullptr;
MemberType member_type;
String member_name;
@@ -172,8 +178,7 @@ class VisualScriptEditor : public ScriptEditorBase {
Vector2 port_action_pos;
int port_action_new_node;
- bool saved_pos_dirty;
- Vector2 saved_position;
+ bool saved_pos_dirty = false;
Vector2 mouse_up_position;
diff --git a/modules/webxr/webxr_interface.h b/modules/webxr/webxr_interface.h
index 291d53044f..801643bfa6 100644
--- a/modules/webxr/webxr_interface.h
+++ b/modules/webxr/webxr_interface.h
@@ -35,8 +35,6 @@
#include "servers/xr/xr_positional_tracker.h"
/**
- @author David Snopek <david.snopek@snopekgames.com>
-
The WebXR interface is a VR/AR interface that can be used on the web.
*/
diff --git a/modules/webxr/webxr_interface_js.h b/modules/webxr/webxr_interface_js.h
index 3eec451d50..8eddfbe484 100644
--- a/modules/webxr/webxr_interface_js.h
+++ b/modules/webxr/webxr_interface_js.h
@@ -36,8 +36,6 @@
#include "webxr_interface.h"
/**
- @author David Snopek <david.snopek@snopekgames.com>
-
The WebXR interface is a VR/AR interface that can be used on the web.
*/