Support f32
directly in process
and physics_process
#1110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is now possible to write either of the following for
process
andphysics_process
:New approach based on proc-macro transformation. It's a bit magic, but for now it's the only practical solution that doesn't put
f64
users at a disadvantage. One viable alternative would have been adding extraprocess_64
+physics_process_64
overloads, but this would come at the cost of hundreds of extra generated methods. Another option would be to always usef32
and letf64
users query the delta via dedicated API.Resolves #510. See this thread for discussion of the various approaches.
We need to see how this turns out, maybe this can change again in the future. Will definitely need doc updates.
This PR also took the opportunity to refactor some small parts in
#[godot_api]
. To skip those changes, just exclude the first commit from the diff.