Generate arguments for virtual functions that take float
as taking float
(rather than double
)
#1433
+2
−0
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.
While looking into issue #1350, I noticed that we were generating virtual methods that were declared to take
float
in Godot as takingdouble
in godot-cpp.For example,
AudioStreamPlayback::_mix(AudioFrame *, float, int)
would turn up in godot-cpp asAudioStreamPlayback::_mix(AudioFrame *, double, int)
. This is despite theextension_api.json
givingfloat
as the "meta".So, this PR makes it so that those functions actually take
float
. This fits with our general goal of providing the same API on both the Godot and godot-cpp side.I don't know if there's any problems with doing this. However, it seems like it should be fine, because our
PtrToArg<T>::convert()
should be able to change thedouble *
passed in the ptrcall into afloat
for the function call.But I'm going to mark it as draft for now, while I investigate the implications of this change.
Note: This doesn't actually fix the problem I was looking into originally. It's entirely possible that this is totally unrelated to that issue. :-)