summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-23 22:12:19 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-23 22:12:19 +0100
commitf963202b7c81f3304563b9d52eb08be75a82436e (patch)
treec5d838ade6a02281c9e50ae53ac9e8e0d818c496
parentb192d3d38b57dbaaa5eca3fa14b1e727b7f6b7b5 (diff)
parent83026126d41f6f5ef44ee1269235b6f7121dc8a9 (diff)
Merge pull request #71930 from Bromeon/bugfix/space-in-bind
Fix bind `" convergence_dist"` containing space
-rw-r--r--core/variant/variant_call.cpp2
-rw-r--r--doc/classes/Projection.xml2
-rw-r--r--tests/core/object/test_class_db.h4
3 files changed, 6 insertions, 2 deletions
diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp
index 2cc0b3a8d7..9e8c6fccb3 100644
--- a/core/variant/variant_call.cpp
+++ b/core/variant/variant_call.cpp
@@ -2135,7 +2135,7 @@ static void _register_variant_builtin_methods() {
bind_static_method(Projection, create_depth_correction, sarray("flip_y"), varray());
bind_static_method(Projection, create_light_atlas_rect, sarray("rect"), varray());
bind_static_method(Projection, create_perspective, sarray("fovy", "aspect", "z_near", "z_far", "flip_fov"), varray(false));
- bind_static_method(Projection, create_perspective_hmd, sarray("fovy", "aspect", "z_near", "z_far", "flip_fov", "eye", "intraocular_dist", " convergence_dist"), varray());
+ bind_static_method(Projection, create_perspective_hmd, sarray("fovy", "aspect", "z_near", "z_far", "flip_fov", "eye", "intraocular_dist", "convergence_dist"), varray());
bind_static_method(Projection, create_for_hmd, sarray("eye", "aspect", "intraocular_dist", "display_width", "display_to_lens", "oversample", "z_near", "z_far"), varray());
bind_static_method(Projection, create_orthogonal, sarray("left", "right", "bottom", "top", "z_near", "z_far"), varray());
bind_static_method(Projection, create_orthogonal_aspect, sarray("size", "aspect", "z_near", "z_far", "flip_fov"), varray(false));
diff --git a/doc/classes/Projection.xml b/doc/classes/Projection.xml
index 602833bca5..99e3f1725f 100644
--- a/doc/classes/Projection.xml
+++ b/doc/classes/Projection.xml
@@ -149,7 +149,7 @@
<param index="4" name="flip_fov" type="bool" />
<param index="5" name="eye" type="int" />
<param index="6" name="intraocular_dist" type="float" />
- <param index="7" name=" convergence_dist" type="float" />
+ <param index="7" name="convergence_dist" type="float" />
<description>
Creates a new [Projection] that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping distances. The projection is adjusted for a head-mounted display with the given distance between eyes and distance to a point that can be focused on.
[param eye] creates the projection for the left eye when set to 1, or the right eye when set to 2.
diff --git a/tests/core/object/test_class_db.h b/tests/core/object/test_class_db.h
index eeb1648924..e68995e539 100644
--- a/tests/core/object/test_class_db.h
+++ b/tests/core/object/test_class_db.h
@@ -559,6 +559,8 @@ void add_exposed_classes(Context &r_context) {
MethodData method;
method.name = method_info.name;
+ TEST_FAIL_COND(!String(method.name).is_valid_identifier(),
+ "Method name is not a valid identifier: '", exposed_class.name, ".", method.name, "'.");
if (method_info.flags & METHOD_FLAG_VIRTUAL) {
method.is_virtual = true;
@@ -682,6 +684,8 @@ void add_exposed_classes(Context &r_context) {
const MethodInfo &method_info = signal_map.get(K.key);
signal.name = method_info.name;
+ TEST_FAIL_COND(!String(signal.name).is_valid_identifier(),
+ "Signal name is not a valid identifier: '", exposed_class.name, ".", signal.name, "'.");
int argc = method_info.arguments.size();