mirror of
https://github.com/godotengine/godot.git
synced 2024-11-23 20:53:15 +00:00
Merge pull request #59186 from aaronfranke/vardefinit
Rename `VariantZeroAssigner` to `VariantDefaultInitializer`
This commit is contained in:
commit
ee9ff6a52c
@ -1302,192 +1302,192 @@ struct VariantInitializer<Object *> {
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct VariantZeroAssigner {
|
||||
struct VariantDefaultInitializer {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<bool> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_bool(v) = false; }
|
||||
struct VariantDefaultInitializer<bool> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_bool(v) = false; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<int64_t> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_int(v) = 0; }
|
||||
struct VariantDefaultInitializer<int64_t> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_int(v) = 0; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<double> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float(v) = 0.0; }
|
||||
struct VariantDefaultInitializer<double> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_float(v) = 0.0; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<float> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float(v) = 0.0; }
|
||||
struct VariantDefaultInitializer<float> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_float(v) = 0.0; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<String> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string(v) = String(); }
|
||||
struct VariantDefaultInitializer<String> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_string(v) = String(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Vector2> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector2(v) = Vector2(); }
|
||||
struct VariantDefaultInitializer<Vector2> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector2(v) = Vector2(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Vector2i> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector2i(v) = Vector2i(); }
|
||||
struct VariantDefaultInitializer<Vector2i> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector2i(v) = Vector2i(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Rect2> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_rect2(v) = Rect2(); }
|
||||
struct VariantDefaultInitializer<Rect2> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_rect2(v) = Rect2(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Rect2i> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_rect2i(v) = Rect2i(); }
|
||||
struct VariantDefaultInitializer<Rect2i> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_rect2i(v) = Rect2i(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Vector3> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector3(v) = Vector3(); }
|
||||
struct VariantDefaultInitializer<Vector3> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector3(v) = Vector3(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Vector3i> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector3i(v) = Vector3i(); }
|
||||
struct VariantDefaultInitializer<Vector3i> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector3i(v) = Vector3i(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Vector4> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector4(v) = Vector4(); }
|
||||
struct VariantDefaultInitializer<Vector4> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector4(v) = Vector4(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Vector4i> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector4i(v) = Vector4i(); }
|
||||
struct VariantDefaultInitializer<Vector4i> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector4i(v) = Vector4i(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Transform2D> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_transform2d(v) = Transform2D(); }
|
||||
struct VariantDefaultInitializer<Transform2D> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_transform2d(v) = Transform2D(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Plane> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_plane(v) = Plane(); }
|
||||
struct VariantDefaultInitializer<Plane> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_plane(v) = Plane(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Quaternion> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_quaternion(v) = Quaternion(); }
|
||||
struct VariantDefaultInitializer<Quaternion> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_quaternion(v) = Quaternion(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<AABB> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_aabb(v) = AABB(); }
|
||||
struct VariantDefaultInitializer<AABB> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_aabb(v) = AABB(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Basis> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_basis(v) = Basis(); }
|
||||
struct VariantDefaultInitializer<Basis> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_basis(v) = Basis(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Transform3D> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_transform(v) = Transform3D(); }
|
||||
struct VariantDefaultInitializer<Transform3D> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_transform(v) = Transform3D(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Projection> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_projection(v) = Projection(); }
|
||||
struct VariantDefaultInitializer<Projection> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_projection(v) = Projection(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Color> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_color(v) = Color(); }
|
||||
struct VariantDefaultInitializer<Color> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_color(v) = Color(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<StringName> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string_name(v) = StringName(); }
|
||||
struct VariantDefaultInitializer<StringName> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_string_name(v) = StringName(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<NodePath> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_node_path(v) = NodePath(); }
|
||||
struct VariantDefaultInitializer<NodePath> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_node_path(v) = NodePath(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<::RID> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_rid(v) = RID(); }
|
||||
struct VariantDefaultInitializer<::RID> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_rid(v) = RID(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Callable> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_callable(v) = Callable(); }
|
||||
struct VariantDefaultInitializer<Callable> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_callable(v) = Callable(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Signal> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_signal(v) = Signal(); }
|
||||
struct VariantDefaultInitializer<Signal> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_signal(v) = Signal(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Dictionary> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_dictionary(v) = Dictionary(); }
|
||||
struct VariantDefaultInitializer<Dictionary> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_dictionary(v) = Dictionary(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<Array> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_array(v) = Array(); }
|
||||
struct VariantDefaultInitializer<Array> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_array(v) = Array(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedByteArray> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_byte_array(v) = PackedByteArray(); }
|
||||
struct VariantDefaultInitializer<PackedByteArray> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_byte_array(v) = PackedByteArray(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedInt32Array> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_int32_array(v) = PackedInt32Array(); }
|
||||
struct VariantDefaultInitializer<PackedInt32Array> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_int32_array(v) = PackedInt32Array(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedInt64Array> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_int64_array(v) = PackedInt64Array(); }
|
||||
struct VariantDefaultInitializer<PackedInt64Array> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_int64_array(v) = PackedInt64Array(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedFloat32Array> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float32_array(v) = PackedFloat32Array(); }
|
||||
struct VariantDefaultInitializer<PackedFloat32Array> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_float32_array(v) = PackedFloat32Array(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedFloat64Array> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float64_array(v) = PackedFloat64Array(); }
|
||||
struct VariantDefaultInitializer<PackedFloat64Array> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_float64_array(v) = PackedFloat64Array(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedStringArray> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string_array(v) = PackedStringArray(); }
|
||||
struct VariantDefaultInitializer<PackedStringArray> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_string_array(v) = PackedStringArray(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedVector2Array> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector2_array(v) = PackedVector2Array(); }
|
||||
struct VariantDefaultInitializer<PackedVector2Array> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector2_array(v) = PackedVector2Array(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedVector3Array> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector3_array(v) = PackedVector3Array(); }
|
||||
struct VariantDefaultInitializer<PackedVector3Array> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector3_array(v) = PackedVector3Array(); }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VariantZeroAssigner<PackedColorArray> {
|
||||
static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_color_array(v) = PackedColorArray(); }
|
||||
struct VariantDefaultInitializer<PackedColorArray> {
|
||||
static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_color_array(v) = PackedColorArray(); }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
@ -1504,7 +1504,7 @@ struct VariantTypeChanger {
|
||||
VariantInitializer<T>::init(v);
|
||||
}
|
||||
|
||||
VariantZeroAssigner<T>::zero(v);
|
||||
VariantDefaultInitializer<T>::init(v);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user