-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing flag when encode_variant writes math types with doubles #58205
Add missing flag when encode_variant writes math types with doubles #58205
Conversation
I don't know if this is correct. The flag should be set when encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? Untested. Also, PACKED_INT64_ARRAY
and PACKED_FLOAT64_ARRAY
should be hard-coded to always have this set.
True, I wasn't actually sure about that. But when I checked, this flag is actually only used on floating-point math types, not on integer ones. case Variant::VECTOR2:
case Variant::VECTOR3:
case Variant::PACKED_VECTOR2_ARRAY:
case Variant::PACKED_VECTOR3_ARRAY:
case Variant::QUATERNION:
case Variant::PLANE:
case Variant::TRANSFORM2D:
case Variant::TRANSFORM3D:
case Variant::BASIS:
case Variant::RECT2:
case Variant::AABB: {
Edit: ok you wrote the same suggestion :D |
8273074
to
9d4c70c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the PACKED_*64_ARRAYs don't need it. To me it would still make sense to include it anyway since it 64-bit arrays are indeed encoded as 64-bit, but I guess it doesn't matter.
9d4c70c
to
c69d303
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works as expected. The code looks good.
Thanks! |
Fixes #57935
The remote inspector is based on
encode_variant
anddecode_variant
to send and receive data.decode_variant
uses a flag within the type to know if math types in the data are using doubles, butencode_variant
is always writingreal_t
, without specifying the flag. So I made it so the flag is set when the instance of Godot writing the data is compiled with doubles.cc @aaronfranke