-
-
Notifications
You must be signed in to change notification settings - Fork 580
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 PackedRealArray as an alias for PackedFloat(32/64)Array #1340
Conversation
Thanks! This makes sense to me. I would hit "approve" but I don't want this to accidentally get merged before the equivalent change is merged to Godot. :-) |
Incidentally, having this upstream as a GDExtension type would also solve one of the problems with godotengine/godot#86346. (There are still others remaining). |
Is this not what the waiting for Godot label is for? |
Oh! I was not aware of that label. Would production team folks hold off from merging an approved PR if that label is present? |
I don't know, seems so from the description, like the one in docs, just add a note in the op for the Godot side PR I'd say to help indicate |
Well, I don't think the production team does much merging here, so it's mostly a signal for yourself 🙃 |
I know he's on vacation right now, but lately Remi's been merging approved godot-cpp PRs before I have a chance to :-) |
Thanks! |
Cherry-picking to 4.2 in #1372 |
FYI engine counterpart will be available in 4.2.2. |
This PR adds PackedRealArray as an alias for PackedFloat(32/64)Array to allow you to specify that you want an array of the float size defined for
real_t
. In the core engine, it is possible to useVector<real_t>
, but this is not possible in GDExtension because PackedFloat(32/64)Array are explicit types and not justVector<T>
.I used
using
instead of#define
to ensure that the namespace is preserved, so that if you don't haveusing namespace godot;
then you needgodot::PackedRealArray
just like you would needgodot::PackedFloat32Array
. I also tried usingtypedef
and it works fine too including with the namespace, butusing
is the newer preferred syntax.