Skip to content

Add PackedRealArray as an alias for PackedFloat(32/64)Array#1340

Merged
dsnopek merged 1 commit into
godotengine:masterfrom
aaronfranke:really-packed
Dec 20, 2023
Merged

Add PackedRealArray as an alias for PackedFloat(32/64)Array#1340
dsnopek merged 1 commit into
godotengine:masterfrom
aaronfranke:really-packed

Conversation

@aaronfranke

@aaronfranke aaronfranke commented Dec 19, 2023

Copy link
Copy Markdown
Member

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 use Vector<real_t>, but this is not possible in GDExtension because PackedFloat(32/64)Array are explicit types and not just Vector<T>.

I used using instead of #define to ensure that the namespace is preserved, so that if you don't have using namespace godot; then you need godot::PackedRealArray just like you would need godot::PackedFloat32Array. I also tried using typedef and it works fine too including with the namespace, but using is the newer preferred syntax.

Corresponding engine PR: godotengine/godot#86324

@aaronfranke aaronfranke added the enhancement This is an enhancement on the current functionality label Dec 19, 2023
@aaronfranke
aaronfranke requested a review from a team as a code owner December 19, 2023 10:46
@dsnopek

dsnopek commented Dec 20, 2023

Copy link
Copy Markdown
Collaborator

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. :-)

@Bromeon

Bromeon commented Dec 20, 2023

Copy link
Copy Markdown
Contributor

Incidentally, having this upstream as a GDExtension type would also solve one of the problems with godotengine/godot#86346. (There are still others remaining).

@AThousandShips

Copy link
Copy Markdown
Member

accidentally get merged before the equivalent change is merged to Godot. :-)

Is this not what the waiting for Godot label is for?

@dsnopek

dsnopek commented Dec 20, 2023

Copy link
Copy Markdown
Collaborator

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?

@AThousandShips

Copy link
Copy Markdown
Member

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

@YuriSizov

Copy link
Copy Markdown
Contributor

Would production team folks hold off from merging an approved PR if that label is present?

Well, I don't think the production team does much merging here, so it's mostly a signal for yourself 🙃

@dsnopek

dsnopek commented Dec 20, 2023

Copy link
Copy Markdown
Collaborator

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 :-)

@dsnopek
dsnopek merged commit 1c19d62 into godotengine:master Dec 20, 2023
@dsnopek

dsnopek commented Dec 20, 2023

Copy link
Copy Markdown
Collaborator

Thanks!

@aaronfranke
aaronfranke deleted the really-packed branch December 20, 2023 15:05
@dsnopek

dsnopek commented Jan 22, 2024

Copy link
Copy Markdown
Collaborator

Cherry-picking to 4.2 in #1372

@YuriSizov

Copy link
Copy Markdown
Contributor

FYI engine counterpart will be available in 4.2.2.

@aaronfranke aaronfranke added this to the 4.3 milestone Aug 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This is an enhancement on the current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants