godotengine / godot-headers

Headers for the Godot API supplied by the GDNative module.
MIT License
381 stars 91 forks source link

`godot_color_to_argb64` and `godot_color_to_rgba64` Return Values Downcasting #77

Closed kayomn closed 3 years ago

kayomn commented 4 years ago

Not sure if this is the correct place to open the issue. If not, please let me know where best to forward this to.

Within Godot Core both godot_color_to_argb64 and godot_color_to_rgba64 return int64_t, however in the API exposed

https://github.com/godotengine/godot/blob/3ed5ff244f679da590d360b38e35adcdcb0aeaf7/core/color.h#L51-L56

Through godot_headers, as well as GDNative itself, the returned value is down-cast to int32_t, aliased as godot_int.

https://github.com/godotengine/godot_headers/blob/d93984d8201ae6952f200ca55d91f1b6f58daeec/gdnative_api_struct.gen.h#L180-L183

This is most likely causing the returned result to be truncating and creating both erroneous and divergent behavior between GDNative and GDScript.

kayomn commented 4 years ago

Forgot to mention that godot_color_to_abgr64 has the same problem.

vnen commented 3 years ago

This repository is just a copy of the Godot source, so this issue needs to be made in Godot itself.