From 6079e14396cd09e6f8a58ff2b8d6eb9bf4f895f8 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:14:15 +0200 Subject: [PATCH] Cleanup and fix native struct definitions. --- servers/register_server_types.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index b001b7aa2aa..f73407ad34c 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -114,8 +114,8 @@ void preregister_server_types() { GDREGISTER_ABSTRACT_CLASS(TextServer); GDREGISTER_CLASS(TextServerExtension); - GDREGISTER_NATIVE_STRUCT(Glyph, "int start;int end;uint8_t count;uint8_t repeat;uint16_t flags;float x_off;float y_off;float advance;RID font_rid;int font_size;int32_t index"); - GDREGISTER_NATIVE_STRUCT(CaretInfo, "int start;int end;uint8_t count;uint8_t repeat;uint16_t flags;float x_off;float y_off;float advance;RID font_rid;int font_size;int32_t index"); + GDREGISTER_NATIVE_STRUCT(Glyph, "int start = -1;int end = -1;uint8_t count = 0;uint8_t repeat = 1;uint16_t flags = 0;float x_off = 0.f;float y_off = 0.f;float advance = 0.f;RID font_rid;int font_size = 0;int32_t index = 0"); + GDREGISTER_NATIVE_STRUCT(CaretInfo, "Rect2 leading_caret;Rect2 trailing_caret;TextServer::Direction leading_direction;TextServer::Direction trailing_direction"); Engine::get_singleton()->add_singleton(Engine::Singleton("TextServerManager", TextServerManager::get_singleton(), "TextServerManager")); } @@ -134,11 +134,11 @@ void register_server_types() { GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState3DExtension) GDREGISTER_VIRTUAL_CLASS(PhysicsServer3DRenderingServerHandler) - GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionRayResult, "Vector3 position;Vector3 normal;RID rid;ObjectID collider_id;Object*collider;int shape"); - GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionShapeResult, "RID rid;ObjectID collider_id;Object*collider;int shape"); - GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionShapeRestInfo, "Vector3 point;Vector3 normal;RID rid;ObjectID collider_id;int shape;Vector3 linear_velocity;"); - GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionCollision, "Vector3 position;Vector3 normal;Vector3 collider_velocity;real_t depth;int local_shape;ObjectID collider_id;RID collider;int collider_shape;"); - GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionResult, "Vector3 travel;Vector3 remainder;real_t collision_safe_fraction;real_t collision_unsafe_fraction;MotionCollision collisions[32];int collision_count"); + GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionRayResult, "Vector3 position;Vector3 normal;RID rid;ObjectID collider_id;Object *collider;int shape"); + GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionShapeResult, "RID rid;ObjectID collider_id;Object *collider;int shape"); + GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionShapeRestInfo, "Vector3 point;Vector3 normal;RID rid;ObjectID collider_id;int shape;Vector3 linear_velocity"); + GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionCollision, "Vector3 position;Vector3 normal;Vector3 collider_velocity;real_t depth;int local_shape;ObjectID collider_id;RID collider;int collider_shape"); + GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionResult, "Vector3 travel;Vector3 remainder;real_t collision_safe_fraction;real_t collision_unsafe_fraction;PhysicsServer3DExtensionMotionCollision collisions[32];int collision_count"); GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionStateCallback, "void *instance;void (*callback)(void *p_instance, PhysicsDirectBodyState3D *p_state)"); GDREGISTER_ABSTRACT_CLASS(NavigationServer2D);