summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/io/image.h2
-rw-r--r--core/math/a_star.h4
-rw-r--r--core/math/disjoint_set.h4
-rw-r--r--core/object/object.h4
-rw-r--r--core/os/pool_allocator.h3
-rw-r--r--core/templates/hash_map.h4
-rw-r--r--core/templates/vector.h1
-rw-r--r--doc/classes/EditorNode3DGizmo.xml22
-rw-r--r--doc/classes/EditorNode3DGizmoPlugin.xml29
-rw-r--r--drivers/windows/dir_access_windows.h8
-rw-r--r--editor/connections_dialog.h6
-rw-r--r--editor/plugins/collision_polygon_3d_editor_plugin.cpp1
-rw-r--r--editor/plugins/node_3d_editor_gizmos.cpp206
-rw-r--r--editor/plugins/node_3d_editor_gizmos.h149
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp29
-rw-r--r--editor/plugins/node_3d_editor_plugin.h13
-rw-r--r--editor/plugins/path_3d_editor_plugin.cpp24
-rw-r--r--editor/plugins/path_3d_editor_plugin.h8
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp4
-rw-r--r--editor/plugins/texture_region_editor_plugin.h4
-rw-r--r--editor/rename_dialog.h4
-rw-r--r--editor/reparent_dialog.h6
-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/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/tga/image_loader_tga.h5
-rw-r--r--modules/webxr/webxr_interface.h2
-rw-r--r--modules/webxr/webxr_interface_js.h2
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java2
-rw-r--r--platform/linuxbsd/joypad_linux.h4
-rw-r--r--scene/3d/skeleton_ik_3d.cpp4
-rw-r--r--scene/3d/xr_nodes.h8
-rw-r--r--scene/gui/check_box.h6
-rw-r--r--scene/gui/check_button.h6
-rw-r--r--scene/resources/primitive_meshes.h3
-rw-r--r--servers/audio/effects/eq.h8
-rw-r--r--servers/audio/effects/reverb.h4
-rw-r--r--servers/camera/camera_feed.h4
-rw-r--r--servers/camera_server.h4
-rw-r--r--servers/navigation_server_2d.cpp5
-rw-r--r--servers/navigation_server_2d.h10
-rw-r--r--servers/navigation_server_3d.cpp4
-rw-r--r--servers/navigation_server_3d.h10
-rw-r--r--servers/rendering/renderer_rd/shader_rd.h7
-rw-r--r--servers/xr/xr_interface.h4
-rw-r--r--servers/xr/xr_positional_tracker.h4
-rw-r--r--servers/xr_server.h4
-rw-r--r--thirdparty/README.md8
-rw-r--r--thirdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp110
-rw-r--r--thirdparty/glslang/StandAlone/DirStackFileIncluder.h149
-rw-r--r--thirdparty/glslang/StandAlone/ResourceLimits.cpp496
-rw-r--r--thirdparty/glslang/StandAlone/ResourceLimits.h57
-rw-r--r--thirdparty/glslang/glslang/CInterface/glslang_c_interface.cpp428
113 files changed, 500 insertions, 1959 deletions
diff --git a/core/io/image.h b/core/io/image.h
index dffc5a6a5f..29236a55e5 100644
--- a/core/io/image.h
+++ b/core/io/image.h
@@ -36,8 +36,6 @@
#include "core/math/rect2.h"
/**
- * @author Juan Linietsky <reduzio@gmail.com>
- *
* Image storage class. This is used to store an image in user memory, as well as
* providing some basic methods for image manipulation.
* Images can be loaded from a file, or registered into the Render object as textures.
diff --git a/core/math/a_star.h b/core/math/a_star.h
index 1839ec7e04..130c202a61 100644
--- a/core/math/a_star.h
+++ b/core/math/a_star.h
@@ -37,9 +37,7 @@
#include "core/templates/oa_hash_map.h"
/**
- A* pathfinding algorithm
-
- @author Juan Linietsky <reduzio@gmail.com>
+ A* pathfinding algorithm.
*/
class AStar : public RefCounted {
diff --git a/core/math/disjoint_set.h b/core/math/disjoint_set.h
index d16c5d3d62..8657dc068e 100644
--- a/core/math/disjoint_set.h
+++ b/core/math/disjoint_set.h
@@ -34,10 +34,6 @@
#include "core/templates/map.h"
#include "core/templates/vector.h"
-/**
- @author Marios Staikopoulos <marios@staik.net>
-*/
-
/* This DisjointSet class uses Find with path compression and Union by rank */
template <typename T, class C = Comparator<T>, class AL = DefaultAllocator>
class DisjointSet {
diff --git a/core/object/object.h b/core/object/object.h
index 4fe2dff19b..602bd3cda1 100644
--- a/core/object/object.h
+++ b/core/object/object.h
@@ -52,10 +52,6 @@
#define VARIANT_ARGPTRS_PASS *argptr[0], *argptr[1], *argptr[2], *argptr[3], *argptr[4], *argptr[5], *argptr[6]], *argptr[7]
#define VARIANT_ARGS_FROM_ARRAY(m_arr) m_arr[0], m_arr[1], m_arr[2], m_arr[3], m_arr[4], m_arr[5], m_arr[6], m_arr[7]
-/**
-@author Juan Linietsky <reduzio@gmail.com>
-*/
-
enum PropertyHint {
PROPERTY_HINT_NONE, ///< no hint provided.
PROPERTY_HINT_RANGE, ///< hint_text = "min,max[,step][,or_greater][,or_lesser][,noslider][,radians][,degrees][,exp][,suffix:<keyword>] range.
diff --git a/core/os/pool_allocator.h b/core/os/pool_allocator.h
index 25b5061f62..11a252bc54 100644
--- a/core/os/pool_allocator.h
+++ b/core/os/pool_allocator.h
@@ -34,13 +34,12 @@
#include "core/typedefs.h"
/**
- @author Juan Linietsky <reduzio@gmail.com>
* Generic Pool Allocator.
* This is a generic memory pool allocator, with locking, compacting and alignment. (@TODO alignment)
* It used as a standard way to manage allocation in a specific region of memory, such as texture memory,
* audio sample memory, or just any kind of memory overall.
* (@TODO) abstraction should be greater, because in many platforms, you need to manage a nonreachable memory.
-*/
+ */
enum {
POOL_ALLOCATOR_INVALID_ID = -1 ///< default invalid value. use INVALID_ID( id ) to test
diff --git a/core/templates/hash_map.h b/core/templates/hash_map.h
index 82b3546f9d..fa5677cc70 100644
--- a/core/templates/hash_map.h
+++ b/core/templates/hash_map.h
@@ -40,7 +40,6 @@
/**
* @class HashMap
- * @author Juan Linietsky <reduzio@gmail.com>
*
* Implementation of a standard Hashing HashMap, for quick lookups of Data associated with a Key.
* The implementation provides hashers for the default types, if you need a special kind of hasher, provide
@@ -48,7 +47,8 @@
* @param TKey Key, search is based on it, needs to be hasheable. It is unique in this container.
* @param TData Data, data associated with the key
* @param Hasher Hasher object, needs to provide a valid static hash function for TKey
- * @param Comparator comparator object, needs to be able to safely compare two TKey values. It needs to ensure that x == x for any items inserted in the map. Bear in mind that nan != nan when implementing an equality check.
+ * @param Comparator comparator object, needs to be able to safely compare two TKey values.
+ * It needs to ensure that x == x for any items inserted in the map. Bear in mind that nan != nan when implementing an equality check.
* @param MIN_HASH_TABLE_POWER Miminum size of the hash table, as a power of two. You rarely need to change this parameter.
* @param RELATIONSHIP Relationship at which the hash table is resized. if amount of elements is RELATIONSHIP
* times bigger than the hash table, table is resized to solve this condition. if RELATIONSHIP is zero, table is always MIN_HASH_TABLE_POWER.
diff --git a/core/templates/vector.h b/core/templates/vector.h
index 4ada3b597a..e53c502f67 100644
--- a/core/templates/vector.h
+++ b/core/templates/vector.h
@@ -33,7 +33,6 @@
/**
* @class Vector
- * @author Juan Linietsky
* Vector container. Regular Vector Container. Use with care and for smaller arrays when possible. Use Vector for large arrays.
*/
diff --git a/doc/classes/EditorNode3DGizmo.xml b/doc/classes/EditorNode3DGizmo.xml
index 60c329935a..6473108866 100644
--- a/doc/classes/EditorNode3DGizmo.xml
+++ b/doc/classes/EditorNode3DGizmo.xml
@@ -12,11 +12,13 @@
<method name="_commit_handle" qualifiers="virtual">
<return type="void" />
<argument index="0" name="id" type="int" />
- <argument index="1" name="restore" type="Variant" />
- <argument index="2" name="cancel" type="bool" />
+ <argument index="1" name="secondary" type="bool" />
+ <argument index="2" name="restore" type="Variant" />
+ <argument index="3" name="cancel" type="bool" />
<description>
Override this method to commit a handle being edited (handles must have been previously added by [method add_handles]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo".
If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action.
+ The [code]secondary[/code] argument is [code]true[/code] when the committed handle is secondary (see [method add_handles] for more information).
</description>
</method>
<method name="_commit_subgizmos" qualifiers="virtual">
@@ -32,16 +34,19 @@
<method name="_get_handle_name" qualifiers="virtual const">
<return type="String" />
<argument index="0" name="id" type="int" />
+ <argument index="1" name="secondary" type="bool" />
<description>
- Override this method to return the name of an edited handle (handles must have been previously added by [method add_handles]).
- Handles can be named for reference to the user when editing.
+ Override this method to return the name of an edited handle (handles must have been previously added by [method add_handles]). Handles can be named for reference to the user when editing.
+ The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
</description>
</method>
<method name="_get_handle_value" qualifiers="virtual const">
<return type="Variant" />
<argument index="0" name="id" type="int" />
+ <argument index="1" name="secondary" type="bool" />
<description>
Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle].
+ The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
</description>
</method>
<method name="_get_subgizmo_transform" qualifiers="virtual const">
@@ -54,8 +59,10 @@
<method name="_is_handle_highlighted" qualifiers="virtual const">
<return type="bool" />
<argument index="0" name="id" type="int" />
+ <argument index="1" name="secondary" type="bool" />
<description>
Override this method to return [code]true[/code] whenever the given handle should be highlighted in the editor.
+ The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
</description>
</method>
<method name="_redraw" qualifiers="virtual">
@@ -67,10 +74,12 @@
<method name="_set_handle" qualifiers="virtual">
<return type="void" />
<argument index="0" name="id" type="int" />
- <argument index="1" name="camera" type="Camera3D" />
- <argument index="2" name="point" type="Vector2" />
+ <argument index="1" name="secondary" type="bool" />
+ <argument index="2" name="camera" type="Camera3D" />
+ <argument index="3" name="point" type="Vector2" />
<description>
Override this method to update the node properties when the user drags a gizmo handle (previously added with [method add_handles]). The provided [code]point[/code] is the mouse position in screen coordinates and the [code]camera[/code] can be used to convert it to raycasts.
+ The [code]secondary[/code] argument is [code]true[/code] when the edited handle is secondary (see [method add_handles] for more information).
</description>
</method>
<method name="_set_subgizmo_transform" qualifiers="virtual">
@@ -120,6 +129,7 @@
<argument index="4" name="secondary" type="bool" default="false" />
<description>
Adds a list of handles (points) which can be used to edit the properties of the gizmo's Node3D. The [code]ids[/code] argument can be used to specify a custom identifier for each handle, if an empty [code]Array[/code] is passed, the ids will be assigned automatically from the [code]handles[/code] argument order.
+ The [code]secondary[/code] argument marks the added handles as secondary, meaning they will normally have less selection priority than regular handles. When the user is holding the shift key secondary handles will switch to have higher priority than regular handles. This change in priority can be used to place multiple handles at the same point while still giving the user control on their selection.
There are virtual methods which will be called upon editing of these handles. Call this method during [method _redraw].
</description>
</method>
diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml
index 3bcd9e7764..aa8237d69f 100644
--- a/doc/classes/EditorNode3DGizmoPlugin.xml
+++ b/doc/classes/EditorNode3DGizmoPlugin.xml
@@ -21,11 +21,14 @@
<return type="void" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
<argument index="1" name="handle_id" type="int" />
- <argument index="2" name="restore" type="Variant" />
- <argument index="3" name="cancel" type="bool" />
+ <argument index="2" name="secondary" type="bool" />
+ <argument index="3" name="restore" type="Variant" />
+ <argument index="4" name="cancel" type="bool" />
<description>
Override this method to commit a handle being edited (handles must have been previously added by [method EditorNode3DGizmo.add_handles] during [method _redraw]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo".
- If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action. Called for this plugin's active gizmos.
+ If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action.
+ The [code]secondary[/code] argument is [code]true[/code] when the committed handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information).
+ Called for this plugin's active gizmos.
</description>
</method>
<method name="_commit_subgizmos" qualifiers="virtual">
@@ -56,16 +59,20 @@
<return type="String" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
<argument index="1" name="handle_id" type="int" />
+ <argument index="2" name="secondary" type="bool" />
<description>
- Override this method to provide gizmo's handle names. Called for this plugin's active gizmos.
+ Override this method to provide gizmo's handle names. The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). Called for this plugin's active gizmos.
</description>
</method>
<method name="_get_handle_value" qualifiers="virtual const">
<return type="Variant" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
<argument index="1" name="handle_id" type="int" />
+ <argument index="2" name="secondary" type="bool" />
<description>
- Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle]. Called for this plugin's active gizmos.
+ Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle].
+ The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information).
+ Called for this plugin's active gizmos.
</description>
</method>
<method name="_get_priority" qualifiers="virtual const">
@@ -94,8 +101,9 @@
<return type="bool" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
<argument index="1" name="handle_id" type="int" />
+ <argument index="2" name="secondary" type="bool" />
<description>
- Override this method to return [code]true[/code] whenever to given handle should be highlighted in the editor. Called for this plugin's active gizmos.
+ Override this method to return [code]true[/code] whenever to given handle should be highlighted in the editor. The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). Called for this plugin's active gizmos.
</description>
</method>
<method name="_is_selectable_when_hidden" qualifiers="virtual const">
@@ -115,10 +123,13 @@
<return type="void" />
<argument index="0" name="gizmo" type="EditorNode3DGizmo" />
<argument index="1" name="handle_id" type="int" />
- <argument index="2" name="camera" type="Camera3D" />
- <argument index="3" name="screen_pos" type="Vector2" />
+ <argument index="2" name="secondary" type="bool" />
+ <argument index="3" name="camera" type="Camera3D" />
+ <argument index="4" name="screen_pos" type="Vector2" />
<description>
- Override this method to update the node's properties when the user drags a gizmo handle (previously added with [method EditorNode3DGizmo.add_handles]). The provided [code]point[/code] is the mouse position in screen coordinates and the [code]camera[/code] can be used to convert it to raycasts. Called for this plugin's active gizmos.
+ Override this method to update the node's properties when the user drags a gizmo handle (previously added with [method EditorNode3DGizmo.add_handles]). The provided [code]point[/code] is the mouse position in screen coordinates and the [code]camera[/code] can be used to convert it to raycasts.
+ The [code]secondary[/code] argument is [code]true[/code] when the edited handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information).
+ Called for this plugin's active gizmos.
</description>
</method>
<method name="_set_subgizmo_transform" qualifiers="virtual">
diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h
index ccd279e694..78d37074e5 100644
--- a/drivers/windows/dir_access_windows.h
+++ b/drivers/windows/dir_access_windows.h
@@ -35,10 +35,6 @@
#include "core/io/dir_access.h"
-/**
- @author Juan Linietsky <reduz@gmail.com>
-*/
-
struct DirAccessWindowsPrivate;
class DirAccessWindows : public DirAccess {
@@ -90,6 +86,6 @@ public:
~DirAccessWindows();
};
-#endif //WINDOWS_ENABLED
+#endif // WINDOWS_ENABLED
-#endif
+#endif // DIR_ACCESS_WINDOWS_H
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index 2759c6cfde..8bad2d9b5b 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -28,10 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-/**
-@author Juan Linietsky <reduzio@gmail.com>
-*/
-
#ifndef CONNECTIONS_DIALOG_H
#define CONNECTIONS_DIALOG_H
@@ -232,4 +228,4 @@ public:
~ConnectionsDock();
};
-#endif
+#endif // CONNECTIONS_DIALOG_H
diff --git a/editor/plugins/collision_polygon_3d_editor_plugin.cpp b/editor/plugins/collision_polygon_3d_editor_plugin.cpp
index bf6485f9ec..52651ae380 100644
--- a/editor/plugins/collision_polygon_3d_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_3d_editor_plugin.cpp
@@ -358,6 +358,7 @@ void CollisionPolygon3DEditor::_polygon_draw() {
float depth = _get_depth() * 0.5;
+ m->clear_surfaces();
imesh->clear_surfaces();
imgeom->set_material_override(line_material);
imesh->surface_begin(Mesh::PRIMITIVE_LINES);
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp
index 79d73c1f00..59ba49232e 100644
--- a/editor/plugins/node_3d_editor_gizmos.cpp
+++ b/editor/plugins/node_3d_editor_gizmos.cpp
@@ -117,52 +117,52 @@ void EditorNode3DGizmo::redraw() {
}
}
-String EditorNode3DGizmo::get_handle_name(int p_id) const {
+String EditorNode3DGizmo::get_handle_name(int p_id, bool p_secondary) const {
String ret;
- if (GDVIRTUAL_CALL(_get_handle_name, p_id, ret)) {
+ if (GDVIRTUAL_CALL(_get_handle_name, p_id, p_secondary, ret)) {
return ret;
}
ERR_FAIL_COND_V(!gizmo_plugin, "");
- return gizmo_plugin->get_handle_name(this, p_id);
+ return gizmo_plugin->get_handle_name(this, p_id, p_secondary);
}
-bool EditorNode3DGizmo::is_handle_highlighted(int p_id) const {
+bool EditorNode3DGizmo::is_handle_highlighted(int p_id, bool p_secondary) const {
bool success;
- if (GDVIRTUAL_CALL(_is_handle_highlighted, p_id, success)) {
+ if (GDVIRTUAL_CALL(_is_handle_highlighted, p_id, p_secondary, success)) {
return success;
}
ERR_FAIL_COND_V(!gizmo_plugin, false);
- return gizmo_plugin->is_handle_highlighted(this, p_id);
+ return gizmo_plugin->is_handle_highlighted(this, p_id, p_secondary);
}
-Variant EditorNode3DGizmo::get_handle_value(int p_id) const {
+Variant EditorNode3DGizmo::get_handle_value(int p_id, bool p_secondary) const {
Variant value;
- if (GDVIRTUAL_CALL(_get_handle_value, p_id, value)) {
+ if (GDVIRTUAL_CALL(_get_handle_value, p_id, p_secondary, value)) {
return value;
}
ERR_FAIL_COND_V(!gizmo_plugin, Variant());
- return gizmo_plugin->get_handle_value(this, p_id);
+ return gizmo_plugin->get_handle_value(this, p_id, p_secondary);
}
-void EditorNode3DGizmo::set_handle(int p_id, Camera3D *p_camera, const Point2 &p_point) {
- if (GDVIRTUAL_CALL(_set_handle, p_id, p_camera, p_point)) {
+void EditorNode3DGizmo::set_handle(int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
+ if (GDVIRTUAL_CALL(_set_handle, p_id, p_secondary, p_camera, p_point)) {
return;
}
ERR_FAIL_COND(!gizmo_plugin);
- gizmo_plugin->set_handle(this, p_id, p_camera, p_point);
+ gizmo_plugin->set_handle(this, p_id, p_secondary, p_camera, p_point);
}
-void EditorNode3DGizmo::commit_handle(int p_id, const Variant &p_restore, bool p_cancel) {
- if (GDVIRTUAL_CALL(_commit_handle, p_id, p_restore, p_cancel)) {
+void EditorNode3DGizmo::commit_handle(int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
+ if (GDVIRTUAL_CALL(_commit_handle, p_id, p_secondary, p_restore, p_cancel)) {
return;
}
ERR_FAIL_COND(!gizmo_plugin);
- gizmo_plugin->commit_handle(this, p_id, p_restore, p_cancel);
+ gizmo_plugin->commit_handle(this, p_id, p_secondary, p_restore, p_cancel);
}
int EditorNode3DGizmo::subgizmos_intersect_ray(Camera3D *p_camera, const Vector2 &p_point) const {
@@ -407,7 +407,8 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
}
bool is_current_hover_gizmo = Node3DEditor::get_singleton()->get_current_hover_gizmo() == this;
- int current_hover_handle = Node3DEditor::get_singleton()->get_current_hover_gizmo_handle();
+ bool current_hover_handle_secondary;
+ int current_hover_handle = Node3DEditor::get_singleton()->get_current_hover_gizmo_handle(current_hover_handle_secondary);
Instance ins;
Ref<ArrayMesh> mesh = memnew(ArrayMesh);
@@ -421,12 +422,12 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
Color *w = colors.ptrw();
for (int i = 0; i < p_handles.size(); i++) {
Color col(1, 1, 1, 1);
- if (is_handle_highlighted(i)) {
+ if (is_handle_highlighted(i, p_secondary)) {
col = Color(0, 0, 1, 0.9);
}
int id = p_ids.is_empty() ? i : p_ids[i];
- if (!is_current_hover_gizmo || current_hover_handle != id) {
+ if (!is_current_hover_gizmo || current_hover_handle != id || p_secondary != current_hover_handle_secondary) {
col.a = 0.8;
}
@@ -571,8 +572,9 @@ bool EditorNode3DGizmo::intersect_frustum(const Camera3D *p_camera, const Vector
return false;
}
-void EditorNode3DGizmo::handles_intersect_ray(Camera3D *p_camera, const Vector2 &p_point, bool p_shift_pressed, int &r_id) {
+void EditorNode3DGizmo::handles_intersect_ray(Camera3D *p_camera, const Vector2 &p_point, bool p_shift_pressed, int &r_id, bool &r_secondary) {
r_id = -1;
+ r_secondary = false;
ERR_FAIL_COND(!spatial_node);
ERR_FAIL_COND(!valid);
@@ -602,6 +604,7 @@ void EditorNode3DGizmo::handles_intersect_ray(Camera3D *p_camera, const Vector2
} else {
r_id = secondary_handle_ids[i];
}
+ r_secondary = true;
}
}
}
@@ -625,6 +628,7 @@ void EditorNode3DGizmo::handles_intersect_ray(Camera3D *p_camera, const Vector2
} else {
r_id = handle_ids[i];
}
+ r_secondary = false;
}
}
}
@@ -836,12 +840,12 @@ void EditorNode3DGizmo::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_subgizmo_selection"), &EditorNode3DGizmo::get_subgizmo_selection);
GDVIRTUAL_BIND(_redraw);
- GDVIRTUAL_BIND(_get_handle_name, "id");
- GDVIRTUAL_BIND(_is_handle_highlighted, "id");
+ GDVIRTUAL_BIND(_get_handle_name, "id", "secondary");
+ GDVIRTUAL_BIND(_is_handle_highlighted, "id", "secondary");
- GDVIRTUAL_BIND(_get_handle_value, "id");
- GDVIRTUAL_BIND(_set_handle, "id", "camera", "point");
- GDVIRTUAL_BIND(_commit_handle, "id", "restore", "cancel");
+ GDVIRTUAL_BIND(_get_handle_value, "id", "secondary");
+ GDVIRTUAL_BIND(_set_handle, "id", "secondary", "camera", "point");
+ GDVIRTUAL_BIND(_commit_handle, "id", "secondary", "restore", "cancel");
GDVIRTUAL_BIND(_subgizmos_intersect_ray, "camera", "point");
GDVIRTUAL_BIND(_subgizmos_intersect_frustum, "camera", "frustum");
@@ -1051,12 +1055,12 @@ void EditorNode3DGizmoPlugin::_bind_methods() {
GDVIRTUAL_BIND(_is_selectable_when_hidden);
GDVIRTUAL_BIND(_redraw, "gizmo");
- GDVIRTUAL_BIND(_get_handle_name, "gizmo", "handle_id");
- GDVIRTUAL_BIND(_is_handle_highlighted, "gizmo", "handle_id");
- GDVIRTUAL_BIND(_get_handle_value, "gizmo", "handle_id");
+ GDVIRTUAL_BIND(_get_handle_name, "gizmo", "handle_id", "secondary");
+ GDVIRTUAL_BIND(_is_handle_highlighted, "gizmo", "handle_id", "secondary");
+ GDVIRTUAL_BIND(_get_handle_value, "gizmo", "handle_id", "secondary");
- GDVIRTUAL_BIND(_set_handle, "gizmo", "handle_id", "camera", "screen_pos");
- GDVIRTUAL_BIND(_commit_handle, "gizmo", "handle_id", "restore", "cancel");
+ GDVIRTUAL_BIND(_set_handle, "gizmo", "handle_id", "secondary", "camera", "screen_pos");
+ GDVIRTUAL_BIND(_commit_handle, "gizmo", "handle_id", "secondary", "restore", "cancel");
GDVIRTUAL_BIND(_subgizmos_intersect_ray, "gizmo", "camera", "screen_pos");
GDVIRTUAL_BIND(_subgizmos_intersect_frustum, "gizmo", "camera", "frustum_planes");
@@ -1107,36 +1111,36 @@ void EditorNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
GDVIRTUAL_CALL(_redraw, p_gizmo);
}
-bool EditorNode3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+bool EditorNode3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
bool ret;
- if (GDVIRTUAL_CALL(_is_handle_highlighted, Ref<EditorNode3DGizmo>(p_gizmo), p_id, ret)) {
+ if (GDVIRTUAL_CALL(_is_handle_highlighted, Ref<EditorNode3DGizmo>(p_gizmo), p_id, p_secondary, ret)) {
return ret;
}
return false;
}
-String EditorNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String EditorNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
String ret;
- if (GDVIRTUAL_CALL(_get_handle_name, Ref<EditorNode3DGizmo>(p_gizmo), p_id, ret)) {
+ if (GDVIRTUAL_CALL(_get_handle_name, Ref<EditorNode3DGizmo>(p_gizmo), p_id, p_secondary, ret)) {
return ret;
}
return "";
}
-Variant EditorNode3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant EditorNode3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
Variant ret;
- if (GDVIRTUAL_CALL(_get_handle_value, Ref<EditorNode3DGizmo>(p_gizmo), p_id, ret)) {
+ if (GDVIRTUAL_CALL(_get_handle_value, Ref<EditorNode3DGizmo>(p_gizmo), p_id, p_secondary, ret)) {
return ret;
}
return Variant();
}
-void EditorNode3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
- GDVIRTUAL_CALL(_set_handle, Ref<EditorNode3DGizmo>(p_gizmo), p_id, p_camera, p_point);
+void EditorNode3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
+ GDVIRTUAL_CALL(_set_handle, Ref<EditorNode3DGizmo>(p_gizmo), p_id, p_secondary, p_camera, p_point);
}
-void EditorNode3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
- GDVIRTUAL_CALL(_commit_handle, Ref<EditorNode3DGizmo>(p_gizmo), p_id, p_restore, p_cancel);
+void EditorNode3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
+ GDVIRTUAL_CALL(_commit_handle, Ref<EditorNode3DGizmo>(p_gizmo), p_id, p_secondary, p_restore, p_cancel);
}
int EditorNode3DGizmoPlugin::subgizmos_intersect_ray(const EditorNode3DGizmo *p_gizmo, Camera3D *p_camera, const Vector2 &p_point) const {
@@ -1241,7 +1245,7 @@ int Light3DGizmoPlugin::get_priority() const {
return -1;
}
-String Light3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String Light3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
if (p_id == 0) {
return "Radius";
} else {
@@ -1249,7 +1253,7 @@ String Light3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int
}
}
-Variant Light3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant Light3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node());
if (p_id == 0) {
return light->get_param(Light3D::PARAM_RANGE);
@@ -1288,7 +1292,7 @@ static float _find_closest_angle_to_half_pi_arc(const Vector3 &p_from, const Vec
return Math::rad2deg(a);
}
-void Light3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void Light3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node());
Transform3D gt = light->get_global_transform();
Transform3D gi = gt.affine_inverse();
@@ -1332,7 +1336,7 @@ void Light3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id,
}
}
-void Light3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void Light3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node());
if (p_cancel) {
light->set_param(p_id == 0 ? Light3D::PARAM_RANGE : Light3D::PARAM_SPOT_ANGLE, p_restore);
@@ -1506,16 +1510,16 @@ int AudioStreamPlayer3DGizmoPlugin::get_priority() const {
return -1;
}
-String AudioStreamPlayer3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String AudioStreamPlayer3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
return "Emission Radius";
}
-Variant AudioStreamPlayer3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant AudioStreamPlayer3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node());
return player->get_emission_angle();
}
-void AudioStreamPlayer3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void AudioStreamPlayer3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node());
Transform3D gt = player->get_global_transform();
@@ -1552,7 +1556,7 @@ void AudioStreamPlayer3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo
}
}
-void AudioStreamPlayer3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void AudioStreamPlayer3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node());
if (p_cancel) {
@@ -1664,7 +1668,7 @@ int Camera3DGizmoPlugin::get_priority() const {
return -1;
}
-String Camera3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String Camera3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) {
@@ -1674,7 +1678,7 @@ String Camera3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, in
}
}
-Variant Camera3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant Camera3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) {
@@ -1684,7 +1688,7 @@ Variant Camera3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo,
}
}
-void Camera3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void Camera3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
Transform3D gt = camera->get_global_transform();
@@ -1713,7 +1717,7 @@ void Camera3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id,
}
}
-void Camera3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void Camera3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) {
@@ -2368,21 +2372,21 @@ void SoftDynamicBody3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
p_gizmo->add_collision_triangles(tm);
}
-String SoftDynamicBody3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String SoftDynamicBody3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
return "SoftDynamicBody3D pin point";
}
-Variant SoftDynamicBody3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant SoftDynamicBody3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
SoftDynamicBody3D *soft_body = Object::cast_to<SoftDynamicBody3D>(p_gizmo->get_spatial_node());
return Variant(soft_body->is_point_pinned(p_id));
}
-void SoftDynamicBody3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void SoftDynamicBody3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
SoftDynamicBody3D *soft_body = Object::cast_to<SoftDynamicBody3D>(p_gizmo->get_spatial_node());
soft_body->pin_point_toggle(p_id);
}
-bool SoftDynamicBody3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+bool SoftDynamicBody3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
SoftDynamicBody3D *soft_body = Object::cast_to<SoftDynamicBody3D>(p_gizmo->get_spatial_node());
return soft_body->is_point_pinned(p_id);
}
@@ -2409,7 +2413,7 @@ int VisibleOnScreenNotifier3DGizmoPlugin::get_priority() const {
return -1;
}
-String VisibleOnScreenNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String VisibleOnScreenNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
switch (p_id) {
case 0:
return "Size X";
@@ -2428,12 +2432,12 @@ String VisibleOnScreenNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DG
return "";
}
-Variant VisibleOnScreenNotifier3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant VisibleOnScreenNotifier3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
VisibleOnScreenNotifier3D *notifier = Object::cast_to<VisibleOnScreenNotifier3D>(p_gizmo->get_spatial_node());
return notifier->get_aabb();
}
-void VisibleOnScreenNotifier3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void VisibleOnScreenNotifier3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
VisibleOnScreenNotifier3D *notifier = Object::cast_to<VisibleOnScreenNotifier3D>(p_gizmo->get_spatial_node());
Transform3D gt = notifier->get_global_transform();
@@ -2485,7 +2489,7 @@ void VisibleOnScreenNotifier3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p
}
}
-void VisibleOnScreenNotifier3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void VisibleOnScreenNotifier3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
VisibleOnScreenNotifier3D *notifier = Object::cast_to<VisibleOnScreenNotifier3D>(p_gizmo->get_spatial_node());
if (p_cancel) {
@@ -2601,7 +2605,7 @@ bool GPUParticles3DGizmoPlugin::is_selectable_when_hidden() const {
return true;
}
-String GPUParticles3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String GPUParticles3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
switch (p_id) {
case 0:
return "Size X";
@@ -2620,12 +2624,12 @@ String GPUParticles3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_giz
return "";
}
-Variant GPUParticles3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant GPUParticles3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node());
return particles->get_visibility_aabb();
}
-void GPUParticles3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void GPUParticles3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node());
Transform3D gt = particles->get_global_transform();
@@ -2676,7 +2680,7 @@ void GPUParticles3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int
}
}
-void GPUParticles3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void GPUParticles3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node());
if (p_cancel) {
@@ -2762,7 +2766,7 @@ int GPUParticlesCollision3DGizmoPlugin::get_priority() const {
return -1;
}
-String GPUParticlesCollision3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String GPUParticlesCollision3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
const Node3D *cs = p_gizmo->get_spatial_node();
if (Object::cast_to<GPUParticlesCollisionSphere3D>(cs) || Object::cast_to<GPUParticlesAttractorSphere3D>(cs)) {
@@ -2776,7 +2780,7 @@ String GPUParticlesCollision3DGizmoPlugin::get_handle_name(const EditorNode3DGiz
return "";
}
-Variant GPUParticlesCollision3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant GPUParticlesCollision3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
const Node3D *cs = p_gizmo->get_spatial_node();
if (Object::cast_to<GPUParticlesCollisionSphere3D>(cs) || Object::cast_to<GPUParticlesAttractorSphere3D>(cs)) {
@@ -2790,7 +2794,7 @@ Variant GPUParticlesCollision3DGizmoPlugin::get_handle_value(const EditorNode3DG
return Variant();
}
-void GPUParticlesCollision3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void GPUParticlesCollision3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
Node3D *sn = p_gizmo->get_spatial_node();
Transform3D gt = sn->get_global_transform();
@@ -2836,7 +2840,7 @@ void GPUParticlesCollision3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_g
}
}
-void GPUParticlesCollision3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void GPUParticlesCollision3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
Node3D *sn = p_gizmo->get_spatial_node();
if (Object::cast_to<GPUParticlesCollisionSphere3D>(sn) || Object::cast_to<GPUParticlesAttractorSphere3D>(sn)) {
@@ -3025,7 +3029,7 @@ int ReflectionProbeGizmoPlugin::get_priority() const {
return -1;
}
-String ReflectionProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String ReflectionProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
switch (p_id) {
case 0:
return "Extents X";
@@ -3044,12 +3048,12 @@ String ReflectionProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gi
return "";
}
-Variant ReflectionProbeGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant ReflectionProbeGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node());
return AABB(probe->get_extents(), probe->get_origin_offset());
}
-void ReflectionProbeGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void ReflectionProbeGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node());
Transform3D gt = probe->get_global_transform();
@@ -3106,7 +3110,7 @@ void ReflectionProbeGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, in
}
}
-void ReflectionProbeGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void ReflectionProbeGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node());
AABB restore = p_restore;
@@ -3210,7 +3214,7 @@ int DecalGizmoPlugin::get_priority() const {
return -1;
}
-String DecalGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String DecalGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
switch (p_id) {
case 0:
return "Extents X";
@@ -3223,12 +3227,12 @@ String DecalGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p
return "";
}
-Variant DecalGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant DecalGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
Decal *decal = Object::cast_to<Decal>(p_gizmo->get_spatial_node());
return decal->get_extents();
}
-void DecalGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void DecalGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
Decal *decal = Object::cast_to<Decal>(p_gizmo->get_spatial_node());
Transform3D gt = decal->get_global_transform();
@@ -3259,7 +3263,7 @@ void DecalGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Ca
decal->set_extents(extents);
}
-void DecalGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void DecalGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
Decal *decal = Object::cast_to<Decal>(p_gizmo->get_spatial_node());
Vector3 restore = p_restore;
@@ -3350,7 +3354,7 @@ int VoxelGIGizmoPlugin::get_priority() const {
return -1;
}
-String VoxelGIGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String VoxelGIGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
switch (p_id) {
case 0:
return "Extents X";
@@ -3363,12 +3367,12 @@ String VoxelGIGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int
return "";
}
-Variant VoxelGIGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant VoxelGIGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
VoxelGI *probe = Object::cast_to<VoxelGI>(p_gizmo->get_spatial_node());
return probe->get_extents();
}
-void VoxelGIGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void VoxelGIGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
VoxelGI *probe = Object::cast_to<VoxelGI>(p_gizmo->get_spatial_node());
Transform3D gt = probe->get_global_transform();
@@ -3399,7 +3403,7 @@ void VoxelGIGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id,
probe->set_extents(extents);
}
-void VoxelGIGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void VoxelGIGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
VoxelGI *probe = Object::cast_to<VoxelGI>(p_gizmo->get_spatial_node());
Vector3 restore = p_restore;
@@ -3519,20 +3523,6 @@ LightmapGIGizmoPlugin::LightmapGIGizmoPlugin() {
create_icon_material("baked_indirect_light_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoLightmapGI"), SNAME("EditorIcons")));
}
-String LightmapGIGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
- return "";
-}
-
-Variant LightmapGIGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
- return Variant();
-}
-
-void LightmapGIGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
-}
-
-void LightmapGIGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
-}
-
bool LightmapGIGizmoPlugin::has_gizmo(Node3D *p_spatial) {
return Object::cast_to<LightmapGI>(p_spatial) != nullptr;
}
@@ -3701,20 +3691,6 @@ LightmapProbeGizmoPlugin::LightmapProbeGizmoPlugin() {
create_material("lightprobe_lines", gizmo_color);
}
-String LightmapProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
- return "";
-}
-
-Variant LightmapProbeGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
- return Variant();
-}
-
-void LightmapProbeGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
-}
-
-void LightmapProbeGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
-}
-
bool LightmapProbeGizmoPlugin::has_gizmo(Node3D *p_spatial) {
return Object::cast_to<LightmapProbe>(p_spatial) != nullptr;
}
@@ -3861,7 +3837,7 @@ int CollisionShape3DGizmoPlugin::get_priority() const {
return -1;
}
-String CollisionShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String CollisionShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
const CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
Ref<Shape3D> s = cs->get_shape();
@@ -3892,7 +3868,7 @@ String CollisionShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_g
return "";
}
-Variant CollisionShape3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant CollisionShape3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
Ref<Shape3D> s = cs->get_shape();
@@ -3928,7 +3904,7 @@ Variant CollisionShape3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p
return Variant();
}
-void CollisionShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void CollisionShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
Ref<Shape3D> s = cs->get_shape();
@@ -4042,7 +4018,7 @@ void CollisionShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, i
}
}
-void CollisionShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void CollisionShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
Ref<Shape3D> s = cs->get_shape();
@@ -5300,15 +5276,15 @@ int FogVolumeGizmoPlugin::get_priority() const {
return -1;
}
-String FogVolumeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+String FogVolumeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
return "Extents";
}
-Variant FogVolumeGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const {
+Variant FogVolumeGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
return Vector3(p_gizmo->get_spatial_node()->call("get_extents"));
}
-void FogVolumeGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void FogVolumeGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
Node3D *sn = p_gizmo->get_spatial_node();
Transform3D gt = sn->get_global_transform();
@@ -5337,7 +5313,7 @@ void FogVolumeGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_id
sn->call("set_extents", he);
}
-void FogVolumeGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel) {
+void FogVolumeGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
Node3D *sn = p_gizmo->get_spatial_node();
if (p_cancel) {
diff --git a/editor/plugins/node_3d_editor_gizmos.h b/editor/plugins/node_3d_editor_gizmos.h
index a8383aefed..66b3f02fcf 100644
--- a/editor/plugins/node_3d_editor_gizmos.h
+++ b/editor/plugins/node_3d_editor_gizmos.h
@@ -80,12 +80,11 @@ protected:
EditorNode3DGizmoPlugin *gizmo_plugin;
GDVIRTUAL0(_redraw)
- GDVIRTUAL1RC(String, _get_handle_name, int)
- GDVIRTUAL1RC(bool, _is_handle_highlighted, int)
-
- GDVIRTUAL1RC(Variant, _get_handle_value, int)
- GDVIRTUAL3(_set_handle, int, const Camera3D *, Vector2)
- GDVIRTUAL3(_commit_handle, int, Variant, bool)
+ GDVIRTUAL2RC(String, _get_handle_name, int, bool)
+ GDVIRTUAL2RC(bool, _is_handle_highlighted, int, bool)
+ GDVIRTUAL2RC(Variant, _get_handle_value, int, bool)
+ GDVIRTUAL4(_set_handle, int, bool, const Camera3D *, Vector2)
+ GDVIRTUAL4(_commit_handle, int, bool, Variant, bool)
GDVIRTUAL2RC(int, _subgizmos_intersect_ray, const Camera3D *, Vector2)
GDVIRTUAL2RC(Vector<int>, _subgizmos_intersect_frustum, const Camera3D *, TypedArray<Plane>)
@@ -102,11 +101,11 @@ public:
void add_handles(const Vector<Vector3> &p_handles, const Ref<Material> &p_material, const Vector<int> &p_ids = Vector<int>(), bool p_billboard = false, bool p_secondary = false);
void add_solid_box(Ref<Material> &p_material, Vector3 p_size, Vector3 p_position = Vector3(), const Transform3D &p_xform = Transform3D());
- virtual bool is_handle_highlighted(int p_id) const;
- virtual String get_handle_name(int p_id) const;
- virtual Variant get_handle_value(int p_id) const;
- virtual void set_handle(int p_id, Camera3D *p_camera, const Point2 &p_point);
- virtual void commit_handle(int p_id, const Variant &p_restore, bool p_cancel = false);
+ virtual bool is_handle_highlighted(int p_id, bool p_secondary) const;
+ virtual String get_handle_name(int p_id, bool p_secondary) const;
+ virtual Variant get_handle_value(int p_id, bool p_secondary) const;
+ virtual void set_handle(int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point);
+ virtual void commit_handle(int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false);
virtual int subgizmos_intersect_ray(Camera3D *p_camera, const Vector2 &p_point) const;
virtual Vector<int> subgizmos_intersect_frustum(const Camera3D *p_camera, const Vector<Plane> &p_frustum) const;
@@ -121,7 +120,7 @@ public:
Node3D *get_spatial_node() const { return spatial_node; }
Ref<EditorNode3DGizmoPlugin> get_plugin() const { return gizmo_plugin; }
bool intersect_frustum(const Camera3D *p_camera, const Vector<Plane> &p_frustum);
- void handles_intersect_ray(Camera3D *p_camera, const Vector2 &p_point, bool p_shift_pressed, int &r_id);
+ void handles_intersect_ray(Camera3D *p_camera, const Vector2 &p_point, bool p_shift_pressed, int &r_id, bool &r_secondary);
bool intersect_ray(Camera3D *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal);
bool is_subgizmo_selected(int p_id) const;
Vector<int> get_subgizmo_selection() const;
@@ -167,12 +166,12 @@ protected:
GDVIRTUAL0RC(bool, _is_selectable_when_hidden)
GDVIRTUAL1(_redraw, Ref<EditorNode3DGizmo>)
- GDVIRTUAL2RC(String, _get_handle_name, Ref<EditorNode3DGizmo>, int)
- GDVIRTUAL2RC(bool, _is_handle_highlighted, Ref<EditorNode3DGizmo>, int)
- GDVIRTUAL2RC(Variant, _get_handle_value, Ref<EditorNode3DGizmo>, int)
+ GDVIRTUAL3RC(String, _get_handle_name, Ref<EditorNode3DGizmo>, int, bool)
+ GDVIRTUAL3RC(bool, _is_handle_highlighted, Ref<EditorNode3DGizmo>, int, bool)
+ GDVIRTUAL3RC(Variant, _get_handle_value, Ref<EditorNode3DGizmo>, int, bool)
- GDVIRTUAL4(_set_handle, Ref<EditorNode3DGizmo>, int, const Camera3D *, Vector2)
- GDVIRTUAL4(_commit_handle, Ref<EditorNode3DGizmo>, int, Variant, bool)
+ GDVIRTUAL5(_set_handle, Ref<EditorNode3DGizmo>, int, bool, const Camera3D *, Vector2)
+ GDVIRTUAL5(_commit_handle, Ref<EditorNode3DGizmo>, int, bool, Variant, bool)
GDVIRTUAL3RC(int, _subgizmos_intersect_ray, Ref<EditorNode3DGizmo>, const Camera3D *, Vector2)
GDVIRTUAL3RC(Vector<int>, _subgizmos_intersect_frustum, Ref<EditorNode3DGizmo>, const Camera3D *, TypedArray<Plane>)
@@ -194,11 +193,11 @@ public:
virtual bool is_selectable_when_hidden() const;
virtual void redraw(EditorNode3DGizmo *p_gizmo);
- virtual bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_id) const;
- virtual String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const;
- virtual Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const;
- virtual void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point);
- virtual void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false);
+ virtual bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const;
+ virtual String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const;
+ virtual Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const;
+ virtual void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point);
+ virtual void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false);
virtual int subgizmos_intersect_ray(const EditorNode3DGizmo *p_gizmo, Camera3D *p_camera, const Vector2 &p_point) const;
virtual Vector<int> subgizmos_intersect_frustum(const EditorNode3DGizmo *p_gizmo, const Camera3D *p_camera, const Vector<Plane> &p_frustum) const;
@@ -223,10 +222,10 @@ public:
String get_gizmo_name() const override;
int get_priority() const override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
Light3DGizmoPlugin();
@@ -240,10 +239,10 @@ public:
String get_gizmo_name() const override;
int get_priority() const override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
AudioStreamPlayer3DGizmoPlugin();
@@ -270,10 +269,10 @@ public:
String get_gizmo_name() const override;
int get_priority() const override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
Camera3DGizmoPlugin();
@@ -390,10 +389,10 @@ public:
bool is_selectable_when_hidden() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
- bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
+ bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
SoftDynamicBody3DGizmoPlugin();
};
@@ -407,10 +406,10 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
VisibleOnScreenNotifier3DGizmoPlugin();
};
@@ -437,10 +436,10 @@ public:
bool is_selectable_when_hidden() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
GPUParticles3DGizmoPlugin();
};
@@ -454,10 +453,10 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
GPUParticlesCollision3DGizmoPlugin();
};
@@ -471,10 +470,10 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
ReflectionProbeGizmoPlugin();
};
@@ -488,10 +487,10 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
DecalGizmoPlugin();
};
@@ -505,10 +504,10 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
VoxelGIGizmoPlugin();
};
@@ -522,11 +521,6 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
-
LightmapGIGizmoPlugin();
};
@@ -539,11 +533,6 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
-
LightmapProbeGizmoPlugin();
};
@@ -568,10 +557,10 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
CollisionShape3DGizmoPlugin();
};
@@ -678,10 +667,10 @@ public:
int get_priority() const override;
void redraw(EditorNode3DGizmo *p_gizmo) override;
- String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id) const override;
- void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ Variant get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const override;
+ void set_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ void commit_handle(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
FogVolumeGizmoPlugin();
};
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 957d1483bc..6ea8fba9b5 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -423,6 +423,7 @@ Vector3 Node3DEditorViewport::_get_ray(const Vector2 &p_pos) const {
void Node3DEditorViewport::_clear_selected() {
_edit.gizmo = Ref<EditorNode3DGizmo>();
_edit.gizmo_handle = -1;
+ _edit.gizmo_handle_secondary = false;
_edit.gizmo_initial_value = Variant();
Node3D *selected = spatial_editor->get_single_selected_node();
@@ -1358,7 +1359,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (b->is_pressed() && _edit.gizmo.is_valid()) {
//restore
- _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, true);
+ _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, true);
_edit.gizmo = Ref<EditorNode3DGizmo>();
}
@@ -1496,11 +1497,13 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
}
int gizmo_handle = -1;
- seg->handles_intersect_ray(camera, _edit.mouse_pos, b->is_shift_pressed(), gizmo_handle);
+ bool gizmo_secondary = false;
+ seg->handles_intersect_ray(camera, _edit.mouse_pos, b->is_shift_pressed(), gizmo_handle, gizmo_secondary);
if (gizmo_handle != -1) {
_edit.gizmo = seg;
_edit.gizmo_handle = gizmo_handle;
- _edit.gizmo_initial_value = seg->get_handle_value(gizmo_handle);
+ _edit.gizmo_handle_secondary = gizmo_secondary;
+ _edit.gizmo_initial_value = seg->get_handle_value(gizmo_handle, gizmo_secondary);
intersected_handle = true;
break;
}
@@ -1612,7 +1615,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
surface->update();
} else {
if (_edit.gizmo.is_valid()) {
- _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, false);
+ _edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, false);
_edit.gizmo = Ref<EditorNode3DGizmo>();
break;
}
@@ -1694,6 +1697,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
Ref<EditorNode3DGizmo> found_gizmo;
int found_handle = -1;
+ bool found_handle_secondary = false;
for (int i = 0; i < gizmos.size(); i++) {
Ref<EditorNode3DGizmo> seg = gizmos[i];
@@ -1701,7 +1705,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
continue;
}
- seg->handles_intersect_ray(camera, _edit.mouse_pos, false, found_handle);
+ seg->handles_intersect_ray(camera, _edit.mouse_pos, false, found_handle, found_handle_secondary);
if (found_handle != -1) {
found_gizmo = seg;
@@ -1713,9 +1717,11 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
spatial_editor->select_gizmo_highlight_axis(-1);
}
- if (found_gizmo != spatial_editor->get_current_hover_gizmo() || found_handle != spatial_editor->get_current_hover_gizmo_handle()) {
+ bool current_hover_handle_secondary = false;
+ int curreny_hover_handle = spatial_editor->get_current_hover_gizmo_handle(current_hover_handle_secondary);
+ if (found_gizmo != spatial_editor->get_current_hover_gizmo() || found_handle != curreny_hover_handle || found_handle_secondary != current_hover_handle_secondary) {
spatial_editor->set_current_hover_gizmo(found_gizmo);
- spatial_editor->set_current_hover_gizmo_handle(found_handle);
+ spatial_editor->set_current_hover_gizmo_handle(found_handle, found_handle_secondary);
spatial_editor->get_single_selected_node()->update_gizmos();
}
}
@@ -1728,9 +1734,9 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
NavigationMode nav_mode = NAVIGATION_NONE;
if (_edit.gizmo.is_valid()) {
- _edit.gizmo->set_handle(_edit.gizmo_handle, camera, m->get_position());
- Variant v = _edit.gizmo->get_handle_value(_edit.gizmo_handle);
- String n = _edit.gizmo->get_handle_name(_edit.gizmo_handle);
+ _edit.gizmo->set_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, camera, m->get_position());
+ Variant v = _edit.gizmo->get_handle_value(_edit.gizmo_handle, _edit.gizmo_handle_secondary);
+ String n = _edit.gizmo->get_handle_name(_edit.gizmo_handle, _edit.gizmo_handle_secondary);
set_message(n + ": " + String(v));
} else if ((m->get_button_mask() & MouseButton::MASK_LEFT) != MouseButton::NONE) {
@@ -4301,6 +4307,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito
_edit.plane = TRANSFORM_VIEW;
_edit.snap = true;
_edit.gizmo_handle = -1;
+ _edit.gizmo_handle_secondary = false;
index = p_index;
editor = p_editor;
@@ -5306,6 +5313,7 @@ void Node3DEditor::edit(Node3D *p_spatial) {
selected = p_spatial;
current_hover_gizmo = Ref<EditorNode3DGizmo>();
current_hover_gizmo_handle = -1;
+ current_hover_gizmo_handle_secondary = false;
if (selected) {
Vector<Ref<Node3DGizmo>> gizmos = selected->get_gizmos();
@@ -7676,6 +7684,7 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
EDITOR_DEF("editors/3d/navigation/show_viewport_rotation_gizmo", true);
current_hover_gizmo_handle = -1;
+ current_hover_gizmo_handle_secondary = false;
{
//sun popup
diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h
index 8d42e88b53..da560f4d83 100644
--- a/editor/plugins/node_3d_editor_plugin.h
+++ b/editor/plugins/node_3d_editor_plugin.h
@@ -312,6 +312,7 @@ private:
bool snap = false;
Ref<EditorNode3DGizmo> gizmo;
int gizmo_handle = 0;
+ bool gizmo_handle_secondary = false;
Variant gizmo_initial_value;
} _edit;
@@ -554,6 +555,7 @@ private:
Ref<Node3DGizmo> current_hover_gizmo;
int current_hover_gizmo_handle;
+ bool current_hover_gizmo_handle_secondary;
real_t snap_translate_value;
real_t snap_rotate_value;
@@ -810,8 +812,15 @@ public:
Ref<EditorNode3DGizmo> get_current_hover_gizmo() const { return current_hover_gizmo; }
void set_current_hover_gizmo(Ref<EditorNode3DGizmo> p_gizmo) { current_hover_gizmo = p_gizmo; }
- void set_current_hover_gizmo_handle(int p_id) { current_hover_gizmo_handle = p_id; }
- int get_current_hover_gizmo_handle() const { return current_hover_gizmo_handle; }
+ void set_current_hover_gizmo_handle(int p_id, bool p_secondary) {
+ current_hover_gizmo_handle = p_id;
+ current_hover_gizmo_handle_secondary = p_secondary;
+ }
+
+ int get_current_hover_gizmo_handle(bool &r_secondary) const {
+ r_secondary = current_hover_gizmo_handle_secondary;
+ return current_hover_gizmo_handle;
+ }
void set_can_preview(Camera3D *p_preview);
diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp
index c31b893498..cb62dcdccc 100644
--- a/editor/plugins/path_3d_editor_plugin.cpp
+++ b/editor/plugins/path_3d_editor_plugin.cpp
@@ -36,17 +36,17 @@
#include "node_3d_editor_plugin.h"
#include "scene/resources/curve.h"
-String Path3DGizmo::get_handle_name(int p_id) const {
+String Path3DGizmo::get_handle_name(int p_id, bool p_secondary) const {
Ref<Curve3D> c = path->get_curve();
if (c.is_null()) {
return "";
}
- if (p_id < c->get_point_count()) {
+ if (!p_secondary) {
return TTR("Curve Point #") + itos(p_id);
}
- p_id = p_id - c->get_point_count() + 1;
+ p_id += 1; // Account for the first point only having an "out" handle
int idx = p_id / 2;
int t = p_id % 2;
@@ -60,18 +60,18 @@ String Path3DGizmo::get_handle_name(int p_id) const {
return n;
}
-Variant Path3DGizmo::get_handle_value(int p_id) const {
+Variant Path3DGizmo::get_handle_value(int p_id, bool p_secondary) const {
Ref<Curve3D> c = path->get_curve();
if (c.is_null()) {
return Variant();
}
- if (p_id < c->get_point_count()) {
+ if (!p_secondary) {
original = c->get_point_position(p_id);
return original;
}
- p_id = p_id - c->get_point_count() + 1;
+ p_id += 1; // Account for the first point only having an "out" handle
int idx = p_id / 2;
int t = p_id % 2;
@@ -88,7 +88,7 @@ Variant Path3DGizmo::get_handle_value(int p_id) const {
return ofs;
}
-void Path3DGizmo::set_handle(int p_id, Camera3D *p_camera, const Point2 &p_point) {
+void Path3DGizmo::set_handle(int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) {
Ref<Curve3D> c = path->get_curve();
if (c.is_null()) {
return;
@@ -100,7 +100,7 @@ void Path3DGizmo::set_handle(int p_id, Camera3D *p_camera, const Point2 &p_point
Vector3 ray_dir = p_camera->project_ray_normal(p_point);
// Setting curve point positions
- if (p_id < c->get_point_count()) {
+ if (!p_secondary) {
const Plane p = Plane(p_camera->get_transform().basis.get_axis(2), gt.xform(original));
Vector3 inters;
@@ -118,7 +118,7 @@ void Path3DGizmo::set_handle(int p_id, Camera3D *p_camera, const Point2 &p_point
return;
}
- p_id = p_id - c->get_point_count() + 1;
+ p_id += 1; // Account for the first point only having an "out" handle
int idx = p_id / 2;
int t = p_id % 2;
@@ -157,7 +157,7 @@ void Path3DGizmo::set_handle(int p_id, Camera3D *p_camera, const Point2 &p_point
}
}
-void Path3DGizmo::commit_handle(int p_id, const Variant &p_restore, bool p_cancel) {
+void Path3DGizmo::commit_handle(int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel) {
Ref<Curve3D> c = path->get_curve();
if (c.is_null()) {
return;
@@ -165,7 +165,7 @@ void Path3DGizmo::commit_handle(int p_id, const Variant &p_restore, bool p_cance
UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
- if (p_id < c->get_point_count()) {
+ if (!p_secondary) {
if (p_cancel) {
c->set_point_position(p_id, p_restore);
return;
@@ -178,7 +178,7 @@ void Path3DGizmo::commit_handle(int p_id, const Variant &p_restore, bool p_cance
return;
}
- p_id = p_id - c->get_point_count() + 1;
+ p_id += 1; // Account for the first point only having an "out" handle
int idx = p_id / 2;
int t = p_id % 2;
diff --git a/editor/plugins/path_3d_editor_plugin.h b/editor/plugins/path_3d_editor_plugin.h
index a7da2c07e5..adda648868 100644
--- a/editor/plugins/path_3d_editor_plugin.h
+++ b/editor/plugins/path_3d_editor_plugin.h
@@ -45,10 +45,10 @@ class Path3DGizmo : public EditorNode3DGizmo {
mutable float orig_out_length;
public:
- virtual String get_handle_name(int p_idx) const override;
- virtual Variant get_handle_value(int p_id) const override;
- virtual void set_handle(int p_id, Camera3D *p_camera, const Point2 &p_point) override;
- virtual void commit_handle(int p_id, const Variant &p_restore, bool p_cancel = false) override;
+ virtual String get_handle_name(int p_id, bool p_secondary) const override;
+ virtual Variant get_handle_value(int p_id, bool p_secondary) const override;
+ virtual void set_handle(int p_id, bool p_secondary, Camera3D *p_camera, const Point2 &p_point) override;
+ virtual void commit_handle(int p_id, bool p_secondary, const Variant &p_restore, bool p_cancel = false) override;
virtual void redraw() override;
Path3DGizmo(Path3D *p_path = nullptr);
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index c03e55be69..900bf4ef57 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -36,10 +36,6 @@
#include "editor/editor_scale.h"
#include "scene/gui/check_box.h"
-/**
- @author Mariano Suligoy
-*/
-
void draw_margin_line(Control *edit_draw, Vector2 from, Vector2 to) {
Vector2 line = (to - from).normalized() * 10;
diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h
index 23981ddb81..bffc6fd9bf 100644
--- a/editor/plugins/texture_region_editor_plugin.h
+++ b/editor/plugins/texture_region_editor_plugin.h
@@ -40,10 +40,6 @@
#include "scene/resources/style_box.h"
#include "scene/resources/texture.h"
-/**
- @author Mariano Suligoy
-*/
-
class TextureRegionEditor : public VBoxContainer {
GDCLASS(TextureRegionEditor, VBoxContainer);
diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h
index 7a882dc693..9d02fb10bd 100644
--- a/editor/rename_dialog.h
+++ b/editor/rename_dialog.h
@@ -41,10 +41,6 @@
#include "scene/gui/option_button.h"
#include "scene/gui/spin_box.h"
-/**
-@author Blazej Floch
-*/
-
class RenameDialog : public ConfirmationDialog {
GDCLASS(RenameDialog, ConfirmationDialog);
diff --git a/editor/reparent_dialog.h b/editor/reparent_dialog.h
index 3d76eb3294..981829a871 100644
--- a/editor/reparent_dialog.h
+++ b/editor/reparent_dialog.h
@@ -37,9 +37,7 @@
#include "scene/gui/check_button.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/line_edit.h"
-/**
-@author Juan Linietsky <reduzio@gmail.com>
-*/
+
class ReparentDialog : public ConfirmationDialog {
GDCLASS(ReparentDialog, ConfirmationDialog);
@@ -60,4 +58,4 @@ public:
~ReparentDialog();
};
-#endif
+#endif // REPARENT_DIALOG_H
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/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/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/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.
*/
diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java
index 9ea787ac86..e5b4f41153 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java
@@ -45,8 +45,8 @@ import java.util.List;
/**
* This class includes utility functions for Android permissions related operations.
- * @author Cagdas Caglak <cagdascaglak@gmail.com>
*/
+
public final class PermissionsUtil {
private static final String TAG = PermissionsUtil.class.getSimpleName();
diff --git a/platform/linuxbsd/joypad_linux.h b/platform/linuxbsd/joypad_linux.h
index 42797afdfa..edbcfcbfa6 100644
--- a/platform/linuxbsd/joypad_linux.h
+++ b/platform/linuxbsd/joypad_linux.h
@@ -28,7 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-//author: Andreas Haas <hondres, liugam3@gmail.com>
#ifndef JOYPAD_LINUX_H
#define JOYPAD_LINUX_H
@@ -100,5 +99,6 @@ private:
Input::JoyAxisValue axis_correct(const input_absinfo *p_abs, int p_value) const;
};
-#endif
+#endif // JOYDEV_ENABLED
+
#endif // JOYPAD_LINUX_H
diff --git a/scene/3d/skeleton_ik_3d.cpp b/scene/3d/skeleton_ik_3d.cpp
index 6089c785a2..c645009c72 100644
--- a/scene/3d/skeleton_ik_3d.cpp
+++ b/scene/3d/skeleton_ik_3d.cpp
@@ -28,10 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-/**
- * @author AndreaCatania
- */
-
#include "skeleton_ik_3d.h"
#ifndef _3D_DISABLED
diff --git a/scene/3d/xr_nodes.h b/scene/3d/xr_nodes.h
index 8e1ef1a4fb..5675cbd944 100644
--- a/scene/3d/xr_nodes.h
+++ b/scene/3d/xr_nodes.h
@@ -34,13 +34,10 @@
#include "scene/3d/camera_3d.h"
#include "servers/xr/xr_positional_tracker.h"
-/**
- @author Bastiaan Olij <mux213@gmail.com>
-**/
-
/*
XRCamera is a subclass of camera which will register itself with its parent XROrigin and as a result is automatically positioned
*/
+
class XRCamera3D : public Camera3D {
GDCLASS(XRCamera3D, Camera3D);
@@ -181,6 +178,7 @@ public:
Our camera and controllers will always be child nodes and thus place relative to this origin point.
This node will automatically locate any camera child nodes and update its position while our XRController3D node will handle tracked controllers.
*/
+
class XROrigin3D : public Node3D {
GDCLASS(XROrigin3D, Node3D);
@@ -204,4 +202,4 @@ public:
~XROrigin3D() {}
};
-#endif /* XR_NODES_H */
+#endif // XR_NODES_H
diff --git a/scene/gui/check_box.h b/scene/gui/check_box.h
index 735c7aedfe..fcdb2ce08c 100644
--- a/scene/gui/check_box.h
+++ b/scene/gui/check_box.h
@@ -32,9 +32,7 @@
#define CHECK_BOX_H
#include "scene/gui/button.h"
-/**
-@author Mariano Suligoy <marianognu.esyrpg@gmail.com>
-*/
+
class CheckBox : public Button {
GDCLASS(CheckBox, Button);
@@ -50,4 +48,4 @@ public:
~CheckBox();
};
-#endif
+#endif // CHECK_BOX_H
diff --git a/scene/gui/check_button.h b/scene/gui/check_button.h
index 5ba81a1027..9a72d04db2 100644
--- a/scene/gui/check_button.h
+++ b/scene/gui/check_button.h
@@ -32,9 +32,7 @@
#define CHECK_BUTTON_H
#include "scene/gui/button.h"
-/**
-@author Juan Linietsky <reduzio@gmail.com>
-*/
+
class CheckButton : public Button {
GDCLASS(CheckButton, Button);
@@ -48,4 +46,4 @@ public:
~CheckButton();
};
-#endif
+#endif // CHECK_BUTTON_H
diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h
index 75ea6a0f12..aa9682bd80 100644
--- a/scene/resources/primitive_meshes.h
+++ b/scene/resources/primitive_meshes.h
@@ -36,11 +36,10 @@
///@TODO probably should change a few integers to unsigned integers...
/**
- @author Bastiaan Olij <mux213@gmail.com>
-
Base class for all the classes in this file, handles a number of code functions that are shared among all meshes.
This class is set apart that it assumes a single surface is always generated for our mesh.
*/
+
class PrimitiveMesh : public Mesh {
GDCLASS(PrimitiveMesh, Mesh);
diff --git a/servers/audio/effects/eq.h b/servers/audio/effects/eq.h
index 74280ee22e..d6293bf875 100644
--- a/servers/audio/effects/eq.h
+++ b/servers/audio/effects/eq.h
@@ -28,18 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-// Author: reduzio@gmail.com (C) 2006
-
#ifndef EQ_FILTER_H
#define EQ_FILTER_H
#include "core/templates/vector.h"
#include "core/typedefs.h"
-/**
-@author Juan Linietsky
-*/
-
class EQ {
public:
enum Preset {
@@ -105,4 +99,4 @@ inline void EQ::BandProcess::process_one(float &p_data) {
history.b2 = history.b1;
}
-#endif
+#endif // EQ_FILTER_H
diff --git a/servers/audio/effects/reverb.h b/servers/audio/effects/reverb.h
index fa06d262a3..ff59ab8d82 100644
--- a/servers/audio/effects/reverb.h
+++ b/servers/audio/effects/reverb.h
@@ -28,8 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-// Author: Juan Linietsky <reduzio@gmail.com>, (C) 2006
-
#ifndef REVERB_H
#define REVERB_H
@@ -120,4 +118,4 @@ public:
~Reverb();
};
-#endif
+#endif // REVERB_H
diff --git a/servers/camera/camera_feed.h b/servers/camera/camera_feed.h
index ea66c5f947..e86605a89b 100644
--- a/servers/camera/camera_feed.h
+++ b/servers/camera/camera_feed.h
@@ -37,8 +37,6 @@
#include "servers/rendering_server.h"
/**
- @author Bastiaan Olij <mux213@gmail.com>
-
The camera server is a singleton object that gives access to the various
camera feeds that can be used as the background for our environment.
**/
@@ -111,4 +109,4 @@ public:
VARIANT_ENUM_CAST(CameraFeed::FeedDataType);
VARIANT_ENUM_CAST(CameraFeed::FeedPosition);
-#endif /* !CAMERA_FEED_H */
+#endif // CAMERA_FEED_H
diff --git a/servers/camera_server.h b/servers/camera_server.h
index 893fdba912..b70938c34f 100644
--- a/servers/camera_server.h
+++ b/servers/camera_server.h
@@ -38,8 +38,6 @@
#include "core/variant/variant.h"
/**
- @author Bastiaan Olij <mux213@gmail.com>
-
The camera server is a singleton object that gives access to the various
camera feeds that can be used as the background for our environment.
**/
@@ -113,4 +111,4 @@ public:
VARIANT_ENUM_CAST(CameraServer::FeedImage);
-#endif /* CAMERA_SERVER_H */
+#endif // CAMERA_SERVER_H
diff --git a/servers/navigation_server_2d.cpp b/servers/navigation_server_2d.cpp
index 53190d7681..ee196673a3 100644
--- a/servers/navigation_server_2d.cpp
+++ b/servers/navigation_server_2d.cpp
@@ -29,14 +29,11 @@
/*************************************************************************/
#include "servers/navigation_server_2d.h"
+
#include "core/math/transform_2d.h"
#include "core/math/transform_3d.h"
#include "servers/navigation_server_3d.h"
-/**
- @author AndreaCatania
-*/
-
NavigationServer2D *NavigationServer2D::singleton = nullptr;
#define FORWARD_0_C(FUNC_NAME) \
diff --git a/servers/navigation_server_2d.h b/servers/navigation_server_2d.h
index 2dd718e09c..7350eeb5b1 100644
--- a/servers/navigation_server_2d.h
+++ b/servers/navigation_server_2d.h
@@ -28,12 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-/**
- @author AndreaCatania
-*/
-
-#ifndef NAVIGATION_2D_SERVER_H
-#define NAVIGATION_2D_SERVER_H
+#ifndef NAVIGATION_SERVER_2D_H
+#define NAVIGATION_SERVER_2D_H
#include "core/object/class_db.h"
#include "core/templates/rid.h"
@@ -171,4 +167,4 @@ public:
virtual ~NavigationServer2D();
};
-#endif
+#endif // NAVIGATION_SERVER_2D_H
diff --git a/servers/navigation_server_3d.cpp b/servers/navigation_server_3d.cpp
index d78e58bea0..d18777869a 100644
--- a/servers/navigation_server_3d.cpp
+++ b/servers/navigation_server_3d.cpp
@@ -28,10 +28,6 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-/**
- @author AndreaCatania
-*/
-
#include "navigation_server_3d.h"
NavigationServer3D *NavigationServer3D::singleton = nullptr;
diff --git a/servers/navigation_server_3d.h b/servers/navigation_server_3d.h
index f711e4e0e5..0a75b07931 100644
--- a/servers/navigation_server_3d.h
+++ b/servers/navigation_server_3d.h
@@ -28,12 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-/**
- @author AndreaCatania
-*/
-
-#ifndef NAVIGATION_SERVER_H
-#define NAVIGATION_SERVER_H
+#ifndef NAVIGATION_SERVER_3D_H
+#define NAVIGATION_SERVER_3D_H
#include "core/object/class_db.h"
#include "core/templates/rid.h"
@@ -205,4 +201,4 @@ public:
static NavigationServer3D *new_default_server();
};
-#endif
+#endif // NAVIGATION_SERVER_3D_H
diff --git a/servers/rendering/renderer_rd/shader_rd.h b/servers/rendering/renderer_rd/shader_rd.h
index 06f78ab193..8e57f0d9af 100644
--- a/servers/rendering/renderer_rd/shader_rd.h
+++ b/servers/rendering/renderer_rd/shader_rd.h
@@ -40,11 +40,6 @@
#include "core/variant/variant.h"
#include "servers/rendering_server.h"
-#include <stdio.h>
-/**
- @author Juan Linietsky <reduzio@gmail.com>
-*/
-
class ShaderRD {
//versions
CharString general_defines;
@@ -173,4 +168,4 @@ public:
virtual ~ShaderRD();
};
-#endif
+#endif // SHADER_RD_H
diff --git a/servers/xr/xr_interface.h b/servers/xr/xr_interface.h
index 03563026c8..aee98f8fee 100644
--- a/servers/xr/xr_interface.h
+++ b/servers/xr/xr_interface.h
@@ -39,8 +39,6 @@
struct BlitToScreen;
/**
- @author Bastiaan Olij <mux213@gmail.com>
-
The XR interface is a template class on top of which we build interface to different AR, VR and tracking SDKs.
The idea is that we subclass this class, implement the logic, and then instantiate a singleton of each interface
when Godot starts. These instances do not initialize themselves but register themselves with the AR/VR server.
@@ -138,4 +136,4 @@ VARIANT_ENUM_CAST(XRInterface::Capabilities);
VARIANT_ENUM_CAST(XRInterface::TrackingStatus);
VARIANT_ENUM_CAST(XRInterface::PlayAreaMode);
-#endif // !XR_INTERFACE_H
+#endif // XR_INTERFACE_H
diff --git a/servers/xr/xr_positional_tracker.h b/servers/xr/xr_positional_tracker.h
index 895bcab215..2bcbf2c018 100644
--- a/servers/xr/xr_positional_tracker.h
+++ b/servers/xr/xr_positional_tracker.h
@@ -37,8 +37,6 @@
#include "servers/xr_server.h"
/**
- @author Bastiaan Olij <mux213@gmail.com>
-
The positional tracker object as an object that represents the position and orientation of a tracked object like a controller or headset.
An AR/VR Interface will registered the trackers it manages with our AR/VR server and update its position and orientation.
This is where potentially additional AR/VR interfaces may be active as there are AR/VR SDKs that solely deal with positional tracking.
@@ -99,4 +97,4 @@ public:
VARIANT_ENUM_CAST(XRPositionalTracker::TrackerHand);
-#endif
+#endif // XR_POSITIONAL_TRACKER_H
diff --git a/servers/xr_server.h b/servers/xr_server.h
index 824a42ed31..a820634bd9 100644
--- a/servers/xr_server.h
+++ b/servers/xr_server.h
@@ -41,8 +41,6 @@ class XRInterface;
class XRPositionalTracker;
/**
- @author Bastiaan Olij <mux213@gmail.com>
-
The XR server is a singleton object that gives access to the various
objects and SDKs that are available on the system.
Because there can be multiple SDKs active this is exposed as an array
@@ -193,4 +191,4 @@ public:
VARIANT_ENUM_CAST(XRServer::TrackerType);
VARIANT_ENUM_CAST(XRServer::RotationMode);
-#endif
+#endif // XR_SERVER_H
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 29bb32df70..239ea940ca 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -175,10 +175,14 @@ Version should be kept in sync with the one of the used Vulkan SDK (see `vulkan`
section). Check Vulkan-ValidationLayers at the matching SDK tag for the known
good glslang commit: https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/scripts/known_good.json
+When updating, also review that our `modules/glslang/glslang_resource_limits.h`
+copy of `DefaultTBuiltInResource` is in sync with the one defined upstream in
+`StandAlone/ResourceLimits.cpp`.
+
Files extracted from upstream source:
-- `glslang` (except `glslang/HLSL`), `OGLCompilersDLL`, `SPIRV`
-- `StandAlone/{DirStackFileIncluder.h,ResourceLimits.{cpp,h}}`
+- `glslang` (except `glslang/HLSL`), `OGLCompilersDLL`, `SPIRV`,
+ minus the `CInterface` folders (depends on `StandAlone`)
- Run `cmake . && make` and copy generated `include/glslang/build_info.h`
to `glslang/build_info.h`
- `LICENSE.txt`
diff --git a/thirdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp b/thirdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp
deleted file mode 100644
index a0790f48f1..0000000000
--- a/thirdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- This code is based on the glslang_c_interface implementation by Viktor Latypov
-**/
-
-/**
-BSD 2-Clause License
-
-Copyright (c) 2019, Viktor Latypov
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-**/
-
-#include "glslang/Include/glslang_c_interface.h"
-
-#include "SPIRV/GlslangToSpv.h"
-#include "SPIRV/Logger.h"
-#include "SPIRV/SpvTools.h"
-
-typedef struct glslang_program_s {
- glslang::TProgram* program;
- std::vector<unsigned int> spirv;
- std::string loggerMessages;
-} glslang_program_t;
-
-static EShLanguage c_shader_stage(glslang_stage_t stage)
-{
- switch (stage) {
- case GLSLANG_STAGE_VERTEX:
- return EShLangVertex;
- case GLSLANG_STAGE_TESSCONTROL:
- return EShLangTessControl;
- case GLSLANG_STAGE_TESSEVALUATION:
- return EShLangTessEvaluation;
- case GLSLANG_STAGE_GEOMETRY:
- return EShLangGeometry;
- case GLSLANG_STAGE_FRAGMENT:
- return EShLangFragment;
- case GLSLANG_STAGE_COMPUTE:
- return EShLangCompute;
- case GLSLANG_STAGE_RAYGEN_NV:
- return EShLangRayGen;
- case GLSLANG_STAGE_INTERSECT_NV:
- return EShLangIntersect;
- case GLSLANG_STAGE_ANYHIT_NV:
- return EShLangAnyHit;
- case GLSLANG_STAGE_CLOSESTHIT_NV:
- return EShLangClosestHit;
- case GLSLANG_STAGE_MISS_NV:
- return EShLangMiss;
- case GLSLANG_STAGE_CALLABLE_NV:
- return EShLangCallable;
- case GLSLANG_STAGE_TASK_NV:
- return EShLangTaskNV;
- case GLSLANG_STAGE_MESH_NV:
- return EShLangMeshNV;
- default:
- break;
- }
- return EShLangCount;
-}
-
-GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage)
-{
- spv::SpvBuildLogger logger;
- glslang::SpvOptions spvOptions;
- spvOptions.validate = true;
-
- const glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage));
-
- glslang::GlslangToSpv(*intermediate, program->spirv, &logger, &spvOptions);
-
- program->loggerMessages = logger.getAllMessages();
-}
-
-GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program) { return program->spirv.size(); }
-
-GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int* out)
-{
- memcpy(out, program->spirv.data(), program->spirv.size() * sizeof(unsigned int));
-}
-
-GLSLANG_EXPORT unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program)
-{
- return program->spirv.data();
-}
-
-GLSLANG_EXPORT const char* glslang_program_SPIRV_get_messages(glslang_program_t* program)
-{
- return program->loggerMessages.empty() ? nullptr : program->loggerMessages.c_str();
-}
diff --git a/thirdparty/glslang/StandAlone/DirStackFileIncluder.h b/thirdparty/glslang/StandAlone/DirStackFileIncluder.h
deleted file mode 100644
index 5a33c78fa2..0000000000
--- a/thirdparty/glslang/StandAlone/DirStackFileIncluder.h
+++ /dev/null
@@ -1,149 +0,0 @@
-//
-// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
-// Copyright (C) 2017 Google, Inc.
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-#pragma once
-
-#include <vector>
-#include <string>
-#include <fstream>
-#include <algorithm>
-#include <set>
-
-#include "./../glslang/Public/ShaderLang.h"
-
-// Default include class for normal include convention of search backward
-// through the stack of active include paths (for nested includes).
-// Can be overridden to customize.
-class DirStackFileIncluder : public glslang::TShader::Includer {
-public:
- DirStackFileIncluder() : externalLocalDirectoryCount(0) { }
-
- virtual IncludeResult* includeLocal(const char* headerName,
- const char* includerName,
- size_t inclusionDepth) override
- {
- return readLocalPath(headerName, includerName, (int)inclusionDepth);
- }
-
- virtual IncludeResult* includeSystem(const char* headerName,
- const char* /*includerName*/,
- size_t /*inclusionDepth*/) override
- {
- return readSystemPath(headerName);
- }
-
- // Externally set directories. E.g., from a command-line -I<dir>.
- // - Most-recently pushed are checked first.
- // - All these are checked after the parse-time stack of local directories
- // is checked.
- // - This only applies to the "local" form of #include.
- // - Makes its own copy of the path.
- virtual void pushExternalLocalDirectory(const std::string& dir)
- {
- directoryStack.push_back(dir);
- externalLocalDirectoryCount = (int)directoryStack.size();
- }
-
- virtual void releaseInclude(IncludeResult* result) override
- {
- if (result != nullptr) {
- delete [] static_cast<tUserDataElement*>(result->userData);
- delete result;
- }
- }
-
- virtual std::set<std::string> getIncludedFiles()
- {
- return includedFiles;
- }
-
- virtual ~DirStackFileIncluder() override { }
-
-protected:
- typedef char tUserDataElement;
- std::vector<std::string> directoryStack;
- int externalLocalDirectoryCount;
- std::set<std::string> includedFiles;
-
- // Search for a valid "local" path based on combining the stack of include
- // directories and the nominal name of the header.
- virtual IncludeResult* readLocalPath(const char* headerName, const char* includerName, int depth)
- {
- // Discard popped include directories, and
- // initialize when at parse-time first level.
- directoryStack.resize(depth + externalLocalDirectoryCount);
- if (depth == 1)
- directoryStack.back() = getDirectory(includerName);
-
- // Find a directory that works, using a reverse search of the include stack.
- for (auto it = directoryStack.rbegin(); it != directoryStack.rend(); ++it) {
- std::string path = *it + '/' + headerName;
- std::replace(path.begin(), path.end(), '\\', '/');
- std::ifstream file(path, std::ios_base::binary | std::ios_base::ate);
- if (file) {
- directoryStack.push_back(getDirectory(path));
- includedFiles.insert(path);
- return newIncludeResult(path, file, (int)file.tellg());
- }
- }
-
- return nullptr;
- }
-
- // Search for a valid <system> path.
- // Not implemented yet; returning nullptr signals failure to find.
- virtual IncludeResult* readSystemPath(const char* /*headerName*/) const
- {
- return nullptr;
- }
-
- // Do actual reading of the file, filling in a new include result.
- virtual IncludeResult* newIncludeResult(const std::string& path, std::ifstream& file, int length) const
- {
- char* content = new tUserDataElement [length];
- file.seekg(0, file.beg);
- file.read(content, length);
- return new IncludeResult(path, content, length, content);
- }
-
- // If no path markers, return current working directory.
- // Otherwise, strip file name and return path leading up to it.
- virtual std::string getDirectory(const std::string path) const
- {
- size_t last = path.find_last_of("/\\");
- return last == std::string::npos ? "." : path.substr(0, last);
- }
-};
diff --git a/thirdparty/glslang/StandAlone/ResourceLimits.cpp b/thirdparty/glslang/StandAlone/ResourceLimits.cpp
deleted file mode 100644
index 7c7f4c4e49..0000000000
--- a/thirdparty/glslang/StandAlone/ResourceLimits.cpp
+++ /dev/null
@@ -1,496 +0,0 @@
-//
-// Copyright (C) 2016 Google, Inc.
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-#include <cstdlib>
-#include <cstring>
-#include <sstream>
-#include <cctype>
-
-#include "ResourceLimits.h"
-
-namespace glslang {
-
-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,
- }};
-
-std::string GetDefaultTBuiltInResourceString()
-{
- std::ostringstream ostream;
-
- ostream << "MaxLights " << DefaultTBuiltInResource.maxLights << "\n"
- << "MaxClipPlanes " << DefaultTBuiltInResource.maxClipPlanes << "\n"
- << "MaxTextureUnits " << DefaultTBuiltInResource.maxTextureUnits << "\n"
- << "MaxTextureCoords " << DefaultTBuiltInResource.maxTextureCoords << "\n"
- << "MaxVertexAttribs " << DefaultTBuiltInResource.maxVertexAttribs << "\n"
- << "MaxVertexUniformComponents " << DefaultTBuiltInResource.maxVertexUniformComponents << "\n"
- << "MaxVaryingFloats " << DefaultTBuiltInResource.maxVaryingFloats << "\n"
- << "MaxVertexTextureImageUnits " << DefaultTBuiltInResource.maxVertexTextureImageUnits << "\n"
- << "MaxCombinedTextureImageUnits " << DefaultTBuiltInResource.maxCombinedTextureImageUnits << "\n"
- << "MaxTextureImageUnits " << DefaultTBuiltInResource.maxTextureImageUnits << "\n"
- << "MaxFragmentUniformComponents " << DefaultTBuiltInResource.maxFragmentUniformComponents << "\n"
- << "MaxDrawBuffers " << DefaultTBuiltInResource.maxDrawBuffers << "\n"
- << "MaxVertexUniformVectors " << DefaultTBuiltInResource.maxVertexUniformVectors << "\n"
- << "MaxVaryingVectors " << DefaultTBuiltInResource.maxVaryingVectors << "\n"
- << "MaxFragmentUniformVectors " << DefaultTBuiltInResource.maxFragmentUniformVectors << "\n"
- << "MaxVertexOutputVectors " << DefaultTBuiltInResource.maxVertexOutputVectors << "\n"
- << "MaxFragmentInputVectors " << DefaultTBuiltInResource.maxFragmentInputVectors << "\n"
- << "MinProgramTexelOffset " << DefaultTBuiltInResource.minProgramTexelOffset << "\n"
- << "MaxProgramTexelOffset " << DefaultTBuiltInResource.maxProgramTexelOffset << "\n"
- << "MaxClipDistances " << DefaultTBuiltInResource.maxClipDistances << "\n"
- << "MaxComputeWorkGroupCountX " << DefaultTBuiltInResource.maxComputeWorkGroupCountX << "\n"
- << "MaxComputeWorkGroupCountY " << DefaultTBuiltInResource.maxComputeWorkGroupCountY << "\n"
- << "MaxComputeWorkGroupCountZ " << DefaultTBuiltInResource.maxComputeWorkGroupCountZ << "\n"
- << "MaxComputeWorkGroupSizeX " << DefaultTBuiltInResource.maxComputeWorkGroupSizeX << "\n"
- << "MaxComputeWorkGroupSizeY " << DefaultTBuiltInResource.maxComputeWorkGroupSizeY << "\n"
- << "MaxComputeWorkGroupSizeZ " << DefaultTBuiltInResource.maxComputeWorkGroupSizeZ << "\n"
- << "MaxComputeUniformComponents " << DefaultTBuiltInResource.maxComputeUniformComponents << "\n"
- << "MaxComputeTextureImageUnits " << DefaultTBuiltInResource.maxComputeTextureImageUnits << "\n"
- << "MaxComputeImageUniforms " << DefaultTBuiltInResource.maxComputeImageUniforms << "\n"
- << "MaxComputeAtomicCounters " << DefaultTBuiltInResource.maxComputeAtomicCounters << "\n"
- << "MaxComputeAtomicCounterBuffers " << DefaultTBuiltInResource.maxComputeAtomicCounterBuffers << "\n"
- << "MaxVaryingComponents " << DefaultTBuiltInResource.maxVaryingComponents << "\n"
- << "MaxVertexOutputComponents " << DefaultTBuiltInResource.maxVertexOutputComponents << "\n"
- << "MaxGeometryInputComponents " << DefaultTBuiltInResource.maxGeometryInputComponents << "\n"
- << "MaxGeometryOutputComponents " << DefaultTBuiltInResource.maxGeometryOutputComponents << "\n"
- << "MaxFragmentInputComponents " << DefaultTBuiltInResource.maxFragmentInputComponents << "\n"
- << "MaxImageUnits " << DefaultTBuiltInResource.maxImageUnits << "\n"
- << "MaxCombinedImageUnitsAndFragmentOutputs " << DefaultTBuiltInResource.maxCombinedImageUnitsAndFragmentOutputs << "\n"
- << "MaxCombinedShaderOutputResources " << DefaultTBuiltInResource.maxCombinedShaderOutputResources << "\n"
- << "MaxImageSamples " << DefaultTBuiltInResource.maxImageSamples << "\n"
- << "MaxVertexImageUniforms " << DefaultTBuiltInResource.maxVertexImageUniforms << "\n"
- << "MaxTessControlImageUniforms " << DefaultTBuiltInResource.maxTessControlImageUniforms << "\n"
- << "MaxTessEvaluationImageUniforms " << DefaultTBuiltInResource.maxTessEvaluationImageUniforms << "\n"
- << "MaxGeometryImageUniforms " << DefaultTBuiltInResource.maxGeometryImageUniforms << "\n"
- << "MaxFragmentImageUniforms " << DefaultTBuiltInResource.maxFragmentImageUniforms << "\n"
- << "MaxCombinedImageUniforms " << DefaultTBuiltInResource.maxCombinedImageUniforms << "\n"
- << "MaxGeometryTextureImageUnits " << DefaultTBuiltInResource.maxGeometryTextureImageUnits << "\n"
- << "MaxGeometryOutputVertices " << DefaultTBuiltInResource.maxGeometryOutputVertices << "\n"
- << "MaxGeometryTotalOutputComponents " << DefaultTBuiltInResource.maxGeometryTotalOutputComponents << "\n"
- << "MaxGeometryUniformComponents " << DefaultTBuiltInResource.maxGeometryUniformComponents << "\n"
- << "MaxGeometryVaryingComponents " << DefaultTBuiltInResource.maxGeometryVaryingComponents << "\n"
- << "MaxTessControlInputComponents " << DefaultTBuiltInResource.maxTessControlInputComponents << "\n"
- << "MaxTessControlOutputComponents " << DefaultTBuiltInResource.maxTessControlOutputComponents << "\n"
- << "MaxTessControlTextureImageUnits " << DefaultTBuiltInResource.maxTessControlTextureImageUnits << "\n"
- << "MaxTessControlUniformComponents " << DefaultTBuiltInResource.maxTessControlUniformComponents << "\n"
- << "MaxTessControlTotalOutputComponents " << DefaultTBuiltInResource.maxTessControlTotalOutputComponents << "\n"
- << "MaxTessEvaluationInputComponents " << DefaultTBuiltInResource.maxTessEvaluationInputComponents << "\n"
- << "MaxTessEvaluationOutputComponents " << DefaultTBuiltInResource.maxTessEvaluationOutputComponents << "\n"
- << "MaxTessEvaluationTextureImageUnits " << DefaultTBuiltInResource.maxTessEvaluationTextureImageUnits << "\n"
- << "MaxTessEvaluationUniformComponents " << DefaultTBuiltInResource.maxTessEvaluationUniformComponents << "\n"
- << "MaxTessPatchComponents " << DefaultTBuiltInResource.maxTessPatchComponents << "\n"
- << "MaxPatchVertices " << DefaultTBuiltInResource.maxPatchVertices << "\n"
- << "MaxTessGenLevel " << DefaultTBuiltInResource.maxTessGenLevel << "\n"
- << "MaxViewports " << DefaultTBuiltInResource.maxViewports << "\n"
- << "MaxVertexAtomicCounters " << DefaultTBuiltInResource.maxVertexAtomicCounters << "\n"
- << "MaxTessControlAtomicCounters " << DefaultTBuiltInResource.maxTessControlAtomicCounters << "\n"
- << "MaxTessEvaluationAtomicCounters " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounters << "\n"
- << "MaxGeometryAtomicCounters " << DefaultTBuiltInResource.maxGeometryAtomicCounters << "\n"
- << "MaxFragmentAtomicCounters " << DefaultTBuiltInResource.maxFragmentAtomicCounters << "\n"
- << "MaxCombinedAtomicCounters " << DefaultTBuiltInResource.maxCombinedAtomicCounters << "\n"
- << "MaxAtomicCounterBindings " << DefaultTBuiltInResource.maxAtomicCounterBindings << "\n"
- << "MaxVertexAtomicCounterBuffers " << DefaultTBuiltInResource.maxVertexAtomicCounterBuffers << "\n"
- << "MaxTessControlAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessControlAtomicCounterBuffers << "\n"
- << "MaxTessEvaluationAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounterBuffers << "\n"
- << "MaxGeometryAtomicCounterBuffers " << DefaultTBuiltInResource.maxGeometryAtomicCounterBuffers << "\n"
- << "MaxFragmentAtomicCounterBuffers " << DefaultTBuiltInResource.maxFragmentAtomicCounterBuffers << "\n"
- << "MaxCombinedAtomicCounterBuffers " << DefaultTBuiltInResource.maxCombinedAtomicCounterBuffers << "\n"
- << "MaxAtomicCounterBufferSize " << DefaultTBuiltInResource.maxAtomicCounterBufferSize << "\n"
- << "MaxTransformFeedbackBuffers " << DefaultTBuiltInResource.maxTransformFeedbackBuffers << "\n"
- << "MaxTransformFeedbackInterleavedComponents " << DefaultTBuiltInResource.maxTransformFeedbackInterleavedComponents << "\n"
- << "MaxCullDistances " << DefaultTBuiltInResource.maxCullDistances << "\n"
- << "MaxCombinedClipAndCullDistances " << DefaultTBuiltInResource.maxCombinedClipAndCullDistances << "\n"
- << "MaxSamples " << DefaultTBuiltInResource.maxSamples << "\n"
- << "MaxMeshOutputVerticesNV " << DefaultTBuiltInResource.maxMeshOutputVerticesNV << "\n"
- << "MaxMeshOutputPrimitivesNV " << DefaultTBuiltInResource.maxMeshOutputPrimitivesNV << "\n"
- << "MaxMeshWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeX_NV << "\n"
- << "MaxMeshWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeY_NV << "\n"
- << "MaxMeshWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeZ_NV << "\n"
- << "MaxTaskWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeX_NV << "\n"
- << "MaxTaskWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_NV << "\n"
- << "MaxTaskWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_NV << "\n"
- << "MaxMeshViewCountNV " << DefaultTBuiltInResource.maxMeshViewCountNV << "\n"
- << "MaxDualSourceDrawBuffersEXT " << DefaultTBuiltInResource.maxDualSourceDrawBuffersEXT << "\n"
- << "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n"
- << "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n"
- << "doWhileLoops " << DefaultTBuiltInResource.limits.doWhileLoops << "\n"
- << "generalUniformIndexing " << DefaultTBuiltInResource.limits.generalUniformIndexing << "\n"
- << "generalAttributeMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalAttributeMatrixVectorIndexing << "\n"
- << "generalVaryingIndexing " << DefaultTBuiltInResource.limits.generalVaryingIndexing << "\n"
- << "generalSamplerIndexing " << DefaultTBuiltInResource.limits.generalSamplerIndexing << "\n"
- << "generalVariableIndexing " << DefaultTBuiltInResource.limits.generalVariableIndexing << "\n"
- << "generalConstantMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalConstantMatrixVectorIndexing << "\n"
- ;
-
- return ostream.str();
-}
-
-void DecodeResourceLimits(TBuiltInResource* resources, char* config)
-{
- static const char* delims = " \t\n\r";
-
- size_t pos = 0;
- std::string configStr(config);
-
- while ((pos = configStr.find_first_not_of(delims, pos)) != std::string::npos) {
- const size_t token_s = pos;
- const size_t token_e = configStr.find_first_of(delims, token_s);
- const size_t value_s = configStr.find_first_not_of(delims, token_e);
- const size_t value_e = configStr.find_first_of(delims, value_s);
- pos = value_e;
-
- // Faster to use compare(), but prefering readability.
- const std::string tokenStr = configStr.substr(token_s, token_e-token_s);
- const std::string valueStr = configStr.substr(value_s, value_e-value_s);
-
- if (value_s == std::string::npos || ! (valueStr[0] == '-' || isdigit(valueStr[0]))) {
- printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n",
- valueStr.c_str());
- return;
- }
-
- const int value = std::atoi(valueStr.c_str());
-
- if (tokenStr == "MaxLights")
- resources->maxLights = value;
- else if (tokenStr == "MaxClipPlanes")
- resources->maxClipPlanes = value;
- else if (tokenStr == "MaxTextureUnits")
- resources->maxTextureUnits = value;
- else if (tokenStr == "MaxTextureCoords")
- resources->maxTextureCoords = value;
- else if (tokenStr == "MaxVertexAttribs")
- resources->maxVertexAttribs = value;
- else if (tokenStr == "MaxVertexUniformComponents")
- resources->maxVertexUniformComponents = value;
- else if (tokenStr == "MaxVaryingFloats")
- resources->maxVaryingFloats = value;
- else if (tokenStr == "MaxVertexTextureImageUnits")
- resources->maxVertexTextureImageUnits = value;
- else if (tokenStr == "MaxCombinedTextureImageUnits")
- resources->maxCombinedTextureImageUnits = value;
- else if (tokenStr == "MaxTextureImageUnits")
- resources->maxTextureImageUnits = value;
- else if (tokenStr == "MaxFragmentUniformComponents")
- resources->maxFragmentUniformComponents = value;
- else if (tokenStr == "MaxDrawBuffers")
- resources->maxDrawBuffers = value;
- else if (tokenStr == "MaxVertexUniformVectors")
- resources->maxVertexUniformVectors = value;
- else if (tokenStr == "MaxVaryingVectors")
- resources->maxVaryingVectors = value;
- else if (tokenStr == "MaxFragmentUniformVectors")
- resources->maxFragmentUniformVectors = value;
- else if (tokenStr == "MaxVertexOutputVectors")
- resources->maxVertexOutputVectors = value;
- else if (tokenStr == "MaxFragmentInputVectors")
- resources->maxFragmentInputVectors = value;
- else if (tokenStr == "MinProgramTexelOffset")
- resources->minProgramTexelOffset = value;
- else if (tokenStr == "MaxProgramTexelOffset")
- resources->maxProgramTexelOffset = value;
- else if (tokenStr == "MaxClipDistances")
- resources->maxClipDistances = value;
- else if (tokenStr == "MaxComputeWorkGroupCountX")
- resources->maxComputeWorkGroupCountX = value;
- else if (tokenStr == "MaxComputeWorkGroupCountY")
- resources->maxComputeWorkGroupCountY = value;
- else if (tokenStr == "MaxComputeWorkGroupCountZ")
- resources->maxComputeWorkGroupCountZ = value;
- else if (tokenStr == "MaxComputeWorkGroupSizeX")
- resources->maxComputeWorkGroupSizeX = value;
- else if (tokenStr == "MaxComputeWorkGroupSizeY")
- resources->maxComputeWorkGroupSizeY = value;
- else if (tokenStr == "MaxComputeWorkGroupSizeZ")
- resources->maxComputeWorkGroupSizeZ = value;
- else if (tokenStr == "MaxComputeUniformComponents")
- resources->maxComputeUniformComponents = value;
- else if (tokenStr == "MaxComputeTextureImageUnits")
- resources->maxComputeTextureImageUnits = value;
- else if (tokenStr == "MaxComputeImageUniforms")
- resources->maxComputeImageUniforms = value;
- else if (tokenStr == "MaxComputeAtomicCounters")
- resources->maxComputeAtomicCounters = value;
- else if (tokenStr == "MaxComputeAtomicCounterBuffers")
- resources->maxComputeAtomicCounterBuffers = value;
- else if (tokenStr == "MaxVaryingComponents")
- resources->maxVaryingComponents = value;
- else if (tokenStr == "MaxVertexOutputComponents")
- resources->maxVertexOutputComponents = value;
- else if (tokenStr == "MaxGeometryInputComponents")
- resources->maxGeometryInputComponents = value;
- else if (tokenStr == "MaxGeometryOutputComponents")
- resources->maxGeometryOutputComponents = value;
- else if (tokenStr == "MaxFragmentInputComponents")
- resources->maxFragmentInputComponents = value;
- else if (tokenStr == "MaxImageUnits")
- resources->maxImageUnits = value;
- else if (tokenStr == "MaxCombinedImageUnitsAndFragmentOutputs")
- resources->maxCombinedImageUnitsAndFragmentOutputs = value;
- else if (tokenStr == "MaxCombinedShaderOutputResources")
- resources->maxCombinedShaderOutputResources = value;
- else if (tokenStr == "MaxImageSamples")
- resources->maxImageSamples = value;
- else if (tokenStr == "MaxVertexImageUniforms")
- resources->maxVertexImageUniforms = value;
- else if (tokenStr == "MaxTessControlImageUniforms")
- resources->maxTessControlImageUniforms = value;
- else if (tokenStr == "MaxTessEvaluationImageUniforms")
- resources->maxTessEvaluationImageUniforms = value;
- else if (tokenStr == "MaxGeometryImageUniforms")
- resources->maxGeometryImageUniforms = value;
- else if (tokenStr == "MaxFragmentImageUniforms")
- resources->maxFragmentImageUniforms = value;
- else if (tokenStr == "MaxCombinedImageUniforms")
- resources->maxCombinedImageUniforms = value;
- else if (tokenStr == "MaxGeometryTextureImageUnits")
- resources->maxGeometryTextureImageUnits = value;
- else if (tokenStr == "MaxGeometryOutputVertices")
- resources->maxGeometryOutputVertices = value;
- else if (tokenStr == "MaxGeometryTotalOutputComponents")
- resources->maxGeometryTotalOutputComponents = value;
- else if (tokenStr == "MaxGeometryUniformComponents")
- resources->maxGeometryUniformComponents = value;
- else if (tokenStr == "MaxGeometryVaryingComponents")
- resources->maxGeometryVaryingComponents = value;
- else if (tokenStr == "MaxTessControlInputComponents")
- resources->maxTessControlInputComponents = value;
- else if (tokenStr == "MaxTessControlOutputComponents")
- resources->maxTessControlOutputComponents = value;
- else if (tokenStr == "MaxTessControlTextureImageUnits")
- resources->maxTessControlTextureImageUnits = value;
- else if (tokenStr == "MaxTessControlUniformComponents")
- resources->maxTessControlUniformComponents = value;
- else if (tokenStr == "MaxTessControlTotalOutputComponents")
- resources->maxTessControlTotalOutputComponents = value;
- else if (tokenStr == "MaxTessEvaluationInputComponents")
- resources->maxTessEvaluationInputComponents = value;
- else if (tokenStr == "MaxTessEvaluationOutputComponents")
- resources->maxTessEvaluationOutputComponents = value;
- else if (tokenStr == "MaxTessEvaluationTextureImageUnits")
- resources->maxTessEvaluationTextureImageUnits = value;
- else if (tokenStr == "MaxTessEvaluationUniformComponents")
- resources->maxTessEvaluationUniformComponents = value;
- else if (tokenStr == "MaxTessPatchComponents")
- resources->maxTessPatchComponents = value;
- else if (tokenStr == "MaxPatchVertices")
- resources->maxPatchVertices = value;
- else if (tokenStr == "MaxTessGenLevel")
- resources->maxTessGenLevel = value;
- else if (tokenStr == "MaxViewports")
- resources->maxViewports = value;
- else if (tokenStr == "MaxVertexAtomicCounters")
- resources->maxVertexAtomicCounters = value;
- else if (tokenStr == "MaxTessControlAtomicCounters")
- resources->maxTessControlAtomicCounters = value;
- else if (tokenStr == "MaxTessEvaluationAtomicCounters")
- resources->maxTessEvaluationAtomicCounters = value;
- else if (tokenStr == "MaxGeometryAtomicCounters")
- resources->maxGeometryAtomicCounters = value;
- else if (tokenStr == "MaxFragmentAtomicCounters")
- resources->maxFragmentAtomicCounters = value;
- else if (tokenStr == "MaxCombinedAtomicCounters")
- resources->maxCombinedAtomicCounters = value;
- else if (tokenStr == "MaxAtomicCounterBindings")
- resources->maxAtomicCounterBindings = value;
- else if (tokenStr == "MaxVertexAtomicCounterBuffers")
- resources->maxVertexAtomicCounterBuffers = value;
- else if (tokenStr == "MaxTessControlAtomicCounterBuffers")
- resources->maxTessControlAtomicCounterBuffers = value;
- else if (tokenStr == "MaxTessEvaluationAtomicCounterBuffers")
- resources->maxTessEvaluationAtomicCounterBuffers = value;
- else if (tokenStr == "MaxGeometryAtomicCounterBuffers")
- resources->maxGeometryAtomicCounterBuffers = value;
- else if (tokenStr == "MaxFragmentAtomicCounterBuffers")
- resources->maxFragmentAtomicCounterBuffers = value;
- else if (tokenStr == "MaxCombinedAtomicCounterBuffers")
- resources->maxCombinedAtomicCounterBuffers = value;
- else if (tokenStr == "MaxAtomicCounterBufferSize")
- resources->maxAtomicCounterBufferSize = value;
- else if (tokenStr == "MaxTransformFeedbackBuffers")
- resources->maxTransformFeedbackBuffers = value;
- else if (tokenStr == "MaxTransformFeedbackInterleavedComponents")
- resources->maxTransformFeedbackInterleavedComponents = value;
- else if (tokenStr == "MaxCullDistances")
- resources->maxCullDistances = value;
- else if (tokenStr == "MaxCombinedClipAndCullDistances")
- resources->maxCombinedClipAndCullDistances = value;
- else if (tokenStr == "MaxSamples")
- resources->maxSamples = value;
- else if (tokenStr == "MaxMeshOutputVerticesNV")
- resources->maxMeshOutputVerticesNV = value;
- else if (tokenStr == "MaxMeshOutputPrimitivesNV")
- resources->maxMeshOutputPrimitivesNV = value;
- else if (tokenStr == "MaxMeshWorkGroupSizeX_NV")
- resources->maxMeshWorkGroupSizeX_NV = value;
- else if (tokenStr == "MaxMeshWorkGroupSizeY_NV")
- resources->maxMeshWorkGroupSizeY_NV = value;
- else if (tokenStr == "MaxMeshWorkGroupSizeZ_NV")
- resources->maxMeshWorkGroupSizeZ_NV = value;
- else if (tokenStr == "MaxTaskWorkGroupSizeX_NV")
- resources->maxTaskWorkGroupSizeX_NV = value;
- else if (tokenStr == "MaxTaskWorkGroupSizeY_NV")
- resources->maxTaskWorkGroupSizeY_NV = value;
- else if (tokenStr == "MaxTaskWorkGroupSizeZ_NV")
- resources->maxTaskWorkGroupSizeZ_NV = value;
- else if (tokenStr == "MaxMeshViewCountNV")
- resources->maxMeshViewCountNV = value;
- else if (tokenStr == "nonInductiveForLoops")
- resources->limits.nonInductiveForLoops = (value != 0);
- else if (tokenStr == "whileLoops")
- resources->limits.whileLoops = (value != 0);
- else if (tokenStr == "doWhileLoops")
- resources->limits.doWhileLoops = (value != 0);
- else if (tokenStr == "generalUniformIndexing")
- resources->limits.generalUniformIndexing = (value != 0);
- else if (tokenStr == "generalAttributeMatrixVectorIndexing")
- resources->limits.generalAttributeMatrixVectorIndexing = (value != 0);
- else if (tokenStr == "generalVaryingIndexing")
- resources->limits.generalVaryingIndexing = (value != 0);
- else if (tokenStr == "generalSamplerIndexing")
- resources->limits.generalSamplerIndexing = (value != 0);
- else if (tokenStr == "generalVariableIndexing")
- resources->limits.generalVariableIndexing = (value != 0);
- else if (tokenStr == "generalConstantMatrixVectorIndexing")
- resources->limits.generalConstantMatrixVectorIndexing = (value != 0);
- else
- printf("Warning: unrecognized limit (%s) in configuration file.\n", tokenStr.c_str());
-
- }
-}
-
-} // end namespace glslang
diff --git a/thirdparty/glslang/StandAlone/ResourceLimits.h b/thirdparty/glslang/StandAlone/ResourceLimits.h
deleted file mode 100644
index 736248eb39..0000000000
--- a/thirdparty/glslang/StandAlone/ResourceLimits.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Copyright (C) 2016 Google, Inc.
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following
-// disclaimer in the documentation and/or other materials provided
-// with the distribution.
-//
-// Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_
-#define _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_
-
-#include <string>
-
-#include "../glslang/Include/ResourceLimits.h"
-
-namespace glslang {
-
-// These are the default resources for TBuiltInResources, used for both
-// - parsing this string for the case where the user didn't supply one,
-// - dumping out a template for user construction of a config file.
-extern const TBuiltInResource DefaultTBuiltInResource;
-
-// Returns the DefaultTBuiltInResource as a human-readable string.
-std::string GetDefaultTBuiltInResourceString();
-
-// Decodes the resource limits from |config| to |resources|.
-void DecodeResourceLimits(TBuiltInResource* resources, char* config);
-
-} // end namespace glslang
-
-#endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_
diff --git a/thirdparty/glslang/glslang/CInterface/glslang_c_interface.cpp b/thirdparty/glslang/glslang/CInterface/glslang_c_interface.cpp
deleted file mode 100644
index 2e04f53ace..0000000000
--- a/thirdparty/glslang/glslang/CInterface/glslang_c_interface.cpp
+++ /dev/null
@@ -1,428 +0,0 @@
-/**
- This code is based on the glslang_c_interface implementation by Viktor Latypov
-**/
-
-/**
-BSD 2-Clause License
-
-Copyright (c) 2019, Viktor Latypov
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-**/
-
-#include "glslang/Include/glslang_c_interface.h"
-
-#include "StandAlone/DirStackFileIncluder.h"
-#include "StandAlone/ResourceLimits.h"
-#include "glslang/Include/ShHandle.h"
-
-#include "glslang/Include/ResourceLimits.h"
-#include "glslang/MachineIndependent/Versions.h"
-
-static_assert(int(GLSLANG_STAGE_COUNT) == EShLangCount, "");
-static_assert(int(GLSLANG_STAGE_MASK_COUNT) == EShLanguageMaskCount, "");
-static_assert(int(GLSLANG_SOURCE_COUNT) == glslang::EShSourceCount, "");
-static_assert(int(GLSLANG_CLIENT_COUNT) == glslang::EShClientCount, "");
-static_assert(int(GLSLANG_TARGET_COUNT) == glslang::EShTargetCount, "");
-static_assert(int(GLSLANG_TARGET_CLIENT_VERSION_COUNT) == glslang::EShTargetClientVersionCount, "");
-static_assert(int(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT) == glslang::EShTargetLanguageVersionCount, "");
-static_assert(int(GLSLANG_OPT_LEVEL_COUNT) == EshOptLevelCount, "");
-static_assert(int(GLSLANG_TEX_SAMP_TRANS_COUNT) == EShTexSampTransCount, "");
-static_assert(int(GLSLANG_MSG_COUNT) == EShMsgCount, "");
-static_assert(int(GLSLANG_REFLECTION_COUNT) == EShReflectionCount, "");
-static_assert(int(GLSLANG_PROFILE_COUNT) == EProfileCount, "");
-static_assert(sizeof(glslang_limits_t) == sizeof(TLimits), "");
-static_assert(sizeof(glslang_resource_t) == sizeof(TBuiltInResource), "");
-
-typedef struct glslang_shader_s {
- glslang::TShader* shader;
- std::string preprocessedGLSL;
-} glslang_shader_t;
-
-typedef struct glslang_program_s {
- glslang::TProgram* program;
- std::vector<unsigned int> spirv;
- std::string loggerMessages;
-} glslang_program_t;
-
-/* Wrapper/Adapter for C glsl_include_callbacks_t functions
-
- This class contains a 'glsl_include_callbacks_t' structure
- with C include_local/include_system callback pointers.
-
- This class implement TShader::Includer interface
- by redirecting C++ virtual methods to C callbacks.
-
- The 'IncludeResult' instances produced by this Includer
- contain a reference to glsl_include_result_t C structure
- to allow its lifetime management by another C callback
- (CallbackIncluder::callbacks::free_include_result)
-*/
-class CallbackIncluder : public glslang::TShader::Includer {
-public:
- /* Wrapper of IncludeResult which stores a glsl_include_result object internally */
- class CallbackIncludeResult : public glslang::TShader::Includer::IncludeResult {
- public:
- CallbackIncludeResult(const std::string& headerName, const char* const headerData, const size_t headerLength,
- void* userData, glsl_include_result_t* includeResult)
- : glslang::TShader::Includer::IncludeResult(headerName, headerData, headerLength, userData),
- includeResult(includeResult)
- {
- }
-
- virtual ~CallbackIncludeResult() {}
-
- protected:
- friend class CallbackIncluder;
-
- glsl_include_result_t* includeResult;
- };
-
-public:
- CallbackIncluder(glsl_include_callbacks_t _callbacks, void* _context) : callbacks(_callbacks), context(_context) {}
-
- virtual ~CallbackIncluder() {}
-
- virtual IncludeResult* includeSystem(const char* headerName, const char* includerName,
- size_t inclusionDepth) override
- {
- if (this->callbacks.include_system) {
- glsl_include_result_t* result =
- this->callbacks.include_system(this->context, headerName, includerName, inclusionDepth);
-
- return new CallbackIncludeResult(std::string(headerName), result->header_data, result->header_length,
- nullptr, result);
- }
-
- return glslang::TShader::Includer::includeSystem(headerName, includerName, inclusionDepth);
- }
-
- virtual IncludeResult* includeLocal(const char* headerName, const char* includerName,
- size_t inclusionDepth) override
- {
- if (this->callbacks.include_local) {
- glsl_include_result_t* result =
- this->callbacks.include_local(this->context, headerName, includerName, inclusionDepth);
-
- return new CallbackIncludeResult(std::string(headerName), result->header_data, result->header_length,
- nullptr, result);
- }
-
- return glslang::TShader::Includer::includeLocal(headerName, includerName, inclusionDepth);
- }
-
- /* This function only calls free_include_result callback
- when the IncludeResult instance is allocated by a C function */
- virtual void releaseInclude(IncludeResult* result) override
- {
- if (result == nullptr)
- return;
-
- if (this->callbacks.free_include_result && (result->userData == nullptr)) {
- CallbackIncludeResult* innerResult = static_cast<CallbackIncludeResult*>(result);
- /* use internal free() function */
- this->callbacks.free_include_result(this->context, innerResult->includeResult);
- /* ignore internal fields of TShader::Includer::IncludeResult */
- delete result;
- return;
- }
-
- delete[] static_cast<char*>(result->userData);
- delete result;
- }
-
-private:
- CallbackIncluder() {}
-
- /* C callback pointers */
- glsl_include_callbacks_t callbacks;
- /* User-defined context */
- void* context;
-};
-
-GLSLANG_EXPORT int glslang_initialize_process() { return static_cast<int>(glslang::InitializeProcess()); }
-
-GLSLANG_EXPORT void glslang_finalize_process() { glslang::FinalizeProcess(); }
-
-static EShLanguage c_shader_stage(glslang_stage_t stage)
-{
- switch (stage) {
- case GLSLANG_STAGE_VERTEX:
- return EShLangVertex;
- case GLSLANG_STAGE_TESSCONTROL:
- return EShLangTessControl;
- case GLSLANG_STAGE_TESSEVALUATION:
- return EShLangTessEvaluation;
- case GLSLANG_STAGE_GEOMETRY:
- return EShLangGeometry;
- case GLSLANG_STAGE_FRAGMENT:
- return EShLangFragment;
- case GLSLANG_STAGE_COMPUTE:
- return EShLangCompute;
- case GLSLANG_STAGE_RAYGEN_NV:
- return EShLangRayGen;
- case GLSLANG_STAGE_INTERSECT_NV:
- return EShLangIntersect;
- case GLSLANG_STAGE_ANYHIT_NV:
- return EShLangAnyHit;
- case GLSLANG_STAGE_CLOSESTHIT_NV:
- return EShLangClosestHit;
- case GLSLANG_STAGE_MISS_NV:
- return EShLangMiss;
- case GLSLANG_STAGE_CALLABLE_NV:
- return EShLangCallable;
- case GLSLANG_STAGE_TASK_NV:
- return EShLangTaskNV;
- case GLSLANG_STAGE_MESH_NV:
- return EShLangMeshNV;
- default:
- break;
- }
- return EShLangCount;
-}
-
-static int c_shader_messages(glslang_messages_t messages)
-{
-#define CONVERT_MSG(in, out) \
- if ((messages & in) == in) \
- res |= out;
-
- int res = 0;
-
- CONVERT_MSG(GLSLANG_MSG_RELAXED_ERRORS_BIT, EShMsgRelaxedErrors);
- CONVERT_MSG(GLSLANG_MSG_SUPPRESS_WARNINGS_BIT, EShMsgSuppressWarnings);
- CONVERT_MSG(GLSLANG_MSG_AST_BIT, EShMsgAST);
- CONVERT_MSG(GLSLANG_MSG_SPV_RULES_BIT, EShMsgSpvRules);
- CONVERT_MSG(GLSLANG_MSG_VULKAN_RULES_BIT, EShMsgVulkanRules);
- CONVERT_MSG(GLSLANG_MSG_ONLY_PREPROCESSOR_BIT, EShMsgOnlyPreprocessor);
- CONVERT_MSG(GLSLANG_MSG_READ_HLSL_BIT, EShMsgReadHlsl);
- CONVERT_MSG(GLSLANG_MSG_CASCADING_ERRORS_BIT, EShMsgCascadingErrors);
- CONVERT_MSG(GLSLANG_MSG_KEEP_UNCALLED_BIT, EShMsgKeepUncalled);
- CONVERT_MSG(GLSLANG_MSG_HLSL_OFFSETS_BIT, EShMsgHlslOffsets);
- CONVERT_MSG(GLSLANG_MSG_DEBUG_INFO_BIT, EShMsgDebugInfo);
- CONVERT_MSG(GLSLANG_MSG_HLSL_ENABLE_16BIT_TYPES_BIT, EShMsgHlslEnable16BitTypes);
- CONVERT_MSG(GLSLANG_MSG_HLSL_LEGALIZATION_BIT, EShMsgHlslLegalization);
- CONVERT_MSG(GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT, EShMsgHlslDX9Compatible);
- CONVERT_MSG(GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT, EShMsgBuiltinSymbolTable);
- return res;
-#undef CONVERT_MSG
-}
-
-static glslang::EShTargetLanguageVersion
-c_shader_target_language_version(glslang_target_language_version_t target_language_version)
-{
- switch (target_language_version) {
- case GLSLANG_TARGET_SPV_1_0:
- return glslang::EShTargetSpv_1_0;
- case GLSLANG_TARGET_SPV_1_1:
- return glslang::EShTargetSpv_1_1;
- case GLSLANG_TARGET_SPV_1_2:
- return glslang::EShTargetSpv_1_2;
- case GLSLANG_TARGET_SPV_1_3:
- return glslang::EShTargetSpv_1_3;
- case GLSLANG_TARGET_SPV_1_4:
- return glslang::EShTargetSpv_1_4;
- case GLSLANG_TARGET_SPV_1_5:
- return glslang::EShTargetSpv_1_5;
- default:
- break;
- }
- return glslang::EShTargetSpv_1_0;
-}
-
-static glslang::EShClient c_shader_client(glslang_client_t client)
-{
- switch (client) {
- case GLSLANG_CLIENT_VULKAN:
- return glslang::EShClientVulkan;
- case GLSLANG_CLIENT_OPENGL:
- return glslang::EShClientOpenGL;
- default:
- break;
- }
-
- return glslang::EShClientNone;
-}
-
-static glslang::EShTargetClientVersion c_shader_client_version(glslang_target_client_version_t client_version)
-{
- switch (client_version) {
- case GLSLANG_TARGET_VULKAN_1_1:
- return glslang::EShTargetVulkan_1_1;
- case GLSLANG_TARGET_OPENGL_450:
- return glslang::EShTargetOpenGL_450;
- default:
- break;
- }
-
- return glslang::EShTargetVulkan_1_0;
-}
-
-static glslang::EShTargetLanguage c_shader_target_language(glslang_target_language_t target_language)
-{
- if (target_language == GLSLANG_TARGET_NONE)
- return glslang::EShTargetNone;
-
- return glslang::EShTargetSpv;
-}
-
-static glslang::EShSource c_shader_source(glslang_source_t source)
-{
- switch (source) {
- case GLSLANG_SOURCE_GLSL:
- return glslang::EShSourceGlsl;
- case GLSLANG_SOURCE_HLSL:
- return glslang::EShSourceHlsl;
- default:
- break;
- }
-
- return glslang::EShSourceNone;
-}
-
-static EProfile c_shader_profile(glslang_profile_t profile)
-{
- switch (profile) {
- case GLSLANG_BAD_PROFILE:
- return EBadProfile;
- case GLSLANG_NO_PROFILE:
- return ENoProfile;
- case GLSLANG_CORE_PROFILE:
- return ECoreProfile;
- case GLSLANG_COMPATIBILITY_PROFILE:
- return ECompatibilityProfile;
- case GLSLANG_ES_PROFILE:
- return EEsProfile;
- case GLSLANG_PROFILE_COUNT: // Should not use this
- break;
- }
-
- return EProfile();
-}
-
-GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input)
-{
- if (!input || !input->code) {
- printf("Error creating shader: null input(%p)/input->code\n", input);
-
- if (input)
- printf("input->code = %p\n", input->code);
-
- return nullptr;
- }
-
- glslang_shader_t* shader = new glslang_shader_t();
-
- shader->shader = new glslang::TShader(c_shader_stage(input->stage));
- shader->shader->setStrings(&input->code, 1);
- shader->shader->setEnvInput(c_shader_source(input->language), c_shader_stage(input->stage),
- c_shader_client(input->client), input->default_version);
- shader->shader->setEnvClient(c_shader_client(input->client), c_shader_client_version(input->client_version));
- shader->shader->setEnvTarget(c_shader_target_language(input->target_language),
- c_shader_target_language_version(input->target_language_version));
-
- return shader;
-}
-
-GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader)
-{
- return shader->preprocessedGLSL.c_str();
-}
-
-GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input)
-{
- DirStackFileIncluder Includer;
- /* TODO: use custom callbacks if they are available in 'i->callbacks' */
- return shader->shader->preprocess(
- reinterpret_cast<const TBuiltInResource*>(input->resource),
- input->default_version,
- c_shader_profile(input->default_profile),
- input->force_default_version_and_profile != 0,
- input->forward_compatible != 0,
- (EShMessages)c_shader_messages(input->messages),
- &shader->preprocessedGLSL,
- Includer
- );
-}
-
-GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input)
-{
- const char* preprocessedCStr = shader->preprocessedGLSL.c_str();
- shader->shader->setStrings(&preprocessedCStr, 1);
-
- return shader->shader->parse(
- reinterpret_cast<const TBuiltInResource*>(input->resource),
- input->default_version,
- input->forward_compatible != 0,
- (EShMessages)c_shader_messages(input->messages)
- );
-}
-
-GLSLANG_EXPORT const char* glslang_shader_get_info_log(glslang_shader_t* shader) { return shader->shader->getInfoLog(); }
-
-GLSLANG_EXPORT const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader) { return shader->shader->getInfoDebugLog(); }
-
-GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader)
-{
- if (!shader)
- return;
-
- delete (shader->shader);
- delete (shader);
-}
-
-GLSLANG_EXPORT glslang_program_t* glslang_program_create()
-{
- glslang_program_t* p = new glslang_program_t();
- p->program = new glslang::TProgram();
- return p;
-}
-
-GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program)
-{
- if (!program)
- return;
-
- delete (program->program);
- delete (program);
-}
-
-GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader)
-{
- program->program->addShader(shader->shader);
-}
-
-GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages)
-{
- return (int)program->program->link((EShMessages)messages);
-}
-
-GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program)
-{
- return program->program->getInfoLog();
-}
-
-GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* program)
-{
- return program->program->getInfoDebugLog();
-}