foreigner icon indicating copy to clipboard operation
foreigner copied to clipboard

Support additional Godot argument types

Open follower opened this issue 5 years ago • 2 comments

Creating this issue as a way to keep track of adding support for more Godot argument types:

  • PoolByteArray -- see: https://github.com/and3rson/foreigner/pull/1

follower avatar Mar 03 '20 08:03 follower

Re: PoolByteArray (and Pool*Array in general) the related implementation in godot-python might be informative: https://github.com/touilleMan/godot-python/commit/e9347d6a319fb62a6cbeac79d20fba0f5b104145 (via)

Seems like the write access (at least) requires holding/destroying a lock.

(I also noted that the docs mentioned:

"Note: This type is passed by value and not by reference."

But I wasn't sure if this was only relevant at GDScript level or not.)

Edit: Add "via" link.

follower avatar Mar 03 '20 10:03 follower

Re: PoolByteArray, in Godot 4.0 these become PackedByteArray etc and become references (& thus mutable) :

Packed arrays are now references in GDScript

Users often complained that PoolArrays were immutable types, so accessing them inside sub-arrays, dictionaries, etc. or passing them to/from functions would always create copies.

In the 4.x branch, besides no longer being pool based, they became references. via

follower avatar Mar 16 '20 16:03 follower