Low-hanging consistency fruits #756
Labels
c: engine
Godot classes (nodes, resources, ...)
quality-of-life
No new functionality, but improves ergonomics/internals
Milestone
This is a very cosmetic issue, and not urgent at all 🙂
The engine often uses different representations for the same thing. In some cases that's OK or would be hard to change, but in others it's a special case in codegen that may be simple to add. Just to brainstorm, doesn't mean we change all those:
Instance IDs
We have
InstanceId
,ObjectID
(native structs, wrapsu64
), rawu64
, rawi64
,EncodedObjectAsID
...instance_id
InstanceId
_instance_id
that returnu64
or have anid: u64
parameter.Intly typed enums
Object::connect_ex()
takesu32
, despiteConnectFlags
existing.Signal::connect()
takesi64
.Duplicated types in manual and generated code
We already handled some (
Side
,Corner
,Vector2Axis
,Vector3Axis
), there are a few remaining:GDExtension.InitializationLevel
vs.InitLevel
ObjectId
vsInstanceId
They don't necessarily need to be de-duplicated, but we could at least provide conversions.
Integer type proliferation
_count
methods (get/set) mostly usei32
usize
is an option, although it's currently unsupported. Might be better to stick toi32
, as it's not really inconsistent, just a bit harder to integrate with Rust.NodePath
withGodot
#982 (comment)Array::subarray_{deep|shallow}
andPackedArray::subarray
useusize
but underlying Godot hasi32
, allowing wraparounds.NodePath::subpath
follows the same schema.usize
ranges, but allow utility to convert Godot negative-wrapped-range to convert intoRangeBounds<usize>
i32
/i64
GraphEdit::connect_node()
usesi32
portsGraphEdit
signalconnection_request
takesi64
portsThe text was updated successfully, but these errors were encountered: