-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Added newer Variant types to typed_array.hpp
#1384
Added newer Variant types to typed_array.hpp
#1384
Conversation
c57f926
to
cd9089c
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.
LGTM
@@ -116,6 +121,8 @@ MAKE_TYPED_ARRAY(PackedStringArray, Variant::PACKED_STRING_ARRAY) | |||
MAKE_TYPED_ARRAY(PackedVector2Array, Variant::PACKED_VECTOR2_ARRAY) | |||
MAKE_TYPED_ARRAY(PackedVector3Array, Variant::PACKED_VECTOR3_ARRAY) | |||
MAKE_TYPED_ARRAY(PackedColorArray, Variant::PACKED_COLOR_ARRAY) | |||
// If the IPAddress struct is added to godot-cpp, the following could also be added: | |||
// MAKE_TYPED_ARRAY(IPAddress, Variant::STRING) |
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.
// MAKE_TYPED_ARRAY(IPAddress, Variant::STRING) | |
//MAKE_TYPED_ARRAY(IPAddress, Variant::STRING) |
No space before code
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.
Good catch, thanks!
cd9089c
to
480e397
Compare
Upon review of recent changes to godot's |
This is a companion commit to the godot PR godotengine/godot#87992 which fixes godotengine/godot#87991 Also undefines typed array templates after use to match Godot's typed_array.h
480e397
to
349b5a3
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.
Added MAKE_TYPED_ARRAY_INFO for new types.
That's still not all of the possible TypedArray types supported, see this
or this Basically, whole https://github.com/allenwp/godot-cpp/blob/349b5a3146404ce32c3b6ef8f7427af99fd9dcee/include/godot_cpp/core/type_info.hpp#L354-L388 list should be a copy-paste of whole https://github.com/allenwp/godot-cpp/blob/349b5a3146404ce32c3b6ef8f7427af99fd9dcee/include/godot_cpp/variant/typed_array.hpp#L80C1-L123 list with |
They were already commented out and I think it's for a separate more involved fix as it's possibly not that simple (or it'd have been done already) |
This PR is just for syncing up godot-cpp with the main godot repo, specifically adding the new types like All of the other missing types were likely intentionally excluded from godot-cpp because they do exist in the file, but are commented out, as AThousandShips mentioned. It’s probably best to make a separate issue (and PR) in this repo regarding those missing |
Indeed, let's keep these separate, the other cases are an old issue and unsure why they are commented out, should be investigated and worked on separately |
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.
Looks good to me! Thanks :-)
So how can I declare custom typed arrays now? |
This is a companion commit to the godot PR godotengine/godot#87992 which fixes godotengine/godot#87991
IPAddress
was added to Godot'styped_array.h
recently (April, 2023), so I've added a comment about whyIPAddress
is not included and how it could be added in the future if this struct is ever added to godot-cpp.Also undefined typed array templates after use to match Godot's
typed_array.h
.