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
usinginstead of#defineto ensure that the namespace is preserved, so that if you don't haveusing namespace godot;then you needgodot::PackedRealArrayjust like you would needgodot::PackedFloat32Array. I also tried usingtypedefand it works fine too including with the namespace, butusingis the newer preferred syntax.Corresponding engine PR: godotengine/godot#86324