Closed acmepjz closed 3 years ago
Likely caused by https://github.com/godotengine/godot/pull/26069
From the release notes of Godot 3.2.2 it looks like that this is already fixed in Godot's engine code ( https://github.com/godotengine/godot/pull/38799 especially https://github.com/godotengine/godot/pull/38799/files#diff-e8fa10e5ca21c9919f3ebcb6742941c4 ). So this problem should be fixed by syncing the code with latest Godot's engine code?
Can we confirm this is fixed so we can close this issue?
The headers are up-to-date with 3.3.3-stable so this should be fixed indeed. Please comment if you can still reproduce it.
I need to transfer dozens of arguments of various types in an array from gdscript to gdnative. I found that the Color is transferred incorrectly. Example code based on gdnative c example:
gdscript:
cpp:
It's expected to get (1,1,1,1), but it actually returns (1,1,1,random number) on Win32 platform.
I suspect that the size of godot_variant is wrong in https://github.com/GodotNativeTools/godot_headers/blob/master/gdnative/variant.h
while in https://github.com/godotengine/godot/blob/3.2/core/variant.h it has members
I notice the GCC_ALIGNED_8, which implies that godot_variant has size 24, but not 20, even on 32bit platforms.
I also inspected the actual memory layout of godot_variant (if you pass a separate Color as the second argument):
and it seems that the _data actually start at offset 8 even on 32bit platforms.
Anyone can confirm this?