Skip to content

Commit

Permalink
[unreal]格式问题以及其中一个报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Nov 11, 2024
1 parent eed30e9 commit 053a25f
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 29 deletions.
4 changes: 2 additions & 2 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FBox2D_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ struct AutoRegisterForFBox2D
.Method("GetSize", MakeFunction(&FBox2D::GetSize))
.Method("Init", MakeFunction(&FBox2D::Init))
.Method("Intersect", MakeFunction(&FBox2D::Intersect))
.Method("IsInside", CombineOverloads(MakeOverload(bool(FBox2D::*)(const FVector2D&) const, &FBox2D::IsInside),
MakeOverload(bool(FBox2D::*)(const FBox2D&) const, &FBox2D::IsInside)))
.Method("IsInside", CombineOverloads(MakeOverload(bool (FBox2D::*)(const FVector2D&) const, &FBox2D::IsInside),
MakeOverload(bool (FBox2D::*)(const FBox2D&) const, &FBox2D::IsInside)))
.Method("ShiftBy", MakeFunction(&FBox2D::ShiftBy))
.Method("ToString", MakeFunction(&FBox2D::ToString))
.Register();
Expand Down
4 changes: 2 additions & 2 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FColor_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

UsingUStruct(FColor);
UsingUStruct(FVector);
UsingUStruct(FLinearColor)
UsingUStruct(FLinearColor);

struct AutoRegisterForFColor
struct AutoRegisterForFColor
{
AutoRegisterForFColor()
{
Expand Down
5 changes: 5 additions & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FGuid_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ struct AutoRegisterForFGuid
.Method("get_Item", SelectFunction(const uint32& (FGuid::*) (int32) const, &FGuid::operator[]))
.Method("Invalidate", MakeFunction(&FGuid::Invalidate))
.Method("IsValid", MakeFunction(&FGuid::IsValid))
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
.Method("ToString", MakeFunction(&FGuid::ToString, EGuidFormats::Digits))
#else
.Method("ToString", CombineOverloads(MakeOverload(FString(FGuid::*)() const, &FGuid::ToString),
MakeOverload(FString(FGuid::*)(EGuidFormats Format) const, &FGuid::ToString)))
#endif
.Function("NewGuid", MakeFunction(&FGuid::NewGuid))
.Function("Parse", MakeFunction(&FGuid::Parse))
.Function("ParseExact", MakeFunction(&FGuid::ParseExact))
Expand Down
6 changes: 3 additions & 3 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FQuat_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct AutoRegisterForFQuat
.Method("Size", MakeFunction(&FQuat::Size))
.Method("SizeSquared", MakeFunction(&FQuat::SizeSquared))
.Method("GetAngle", MakeFunction(&FQuat::GetAngle))
.Method("ToAxisAndAngle", SelectFunction(void(FQuat::*)(FVector & Axis, float& Angle) const, &FQuat::ToAxisAndAngle))
.Method("ToAxisAndAngle", SelectFunction(void (FQuat::*)(FVector & Axis, float& Angle) const, &FQuat::ToAxisAndAngle))
.Method("ToSwingTwist", MakeFunction(&FQuat::ToSwingTwist))
.Method("RotateVector", MakeFunction(&FQuat::RotateVector))
.Method("UnrotateVector", MakeFunction(&FQuat::UnrotateVector))
Expand All @@ -65,8 +65,8 @@ struct AutoRegisterForFQuat
.Method("ContainsNaN", MakeFunction(&FQuat::ContainsNaN))
.Method("ToString", MakeFunction(&FQuat::ToString))
.Method("InitFromString", MakeFunction(&FQuat::InitFromString))
.Method("DiagnosticCheckNaN", CombineOverloads(MakeOverload(void(FQuat::*)() const, &FQuat::DiagnosticCheckNaN),
MakeOverload(void(FQuat::*)(const TCHAR*) const, &FQuat::DiagnosticCheckNaN)))
.Method("DiagnosticCheckNaN", CombineOverloads(MakeOverload(void (FQuat::*)() const, &FQuat::DiagnosticCheckNaN),
MakeOverload(void (FQuat::*)(const TCHAR*) const, &FQuat::DiagnosticCheckNaN)))
.Function("FindBetween", MakeFunction(&FQuat::FindBetween))
.Function("FindBetweenNormals", MakeFunction(&FQuat::FindBetweenNormals))
.Function("FindBetweenVectors", MakeFunction(&FQuat::FindBetweenVectors))
Expand Down
4 changes: 2 additions & 2 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FRotator_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ struct AutoRegisterForFRotator
.Property("Pitch", MakeProperty(&FRotator::Pitch))
.Property("Yaw", MakeProperty(&FRotator::Yaw))
.Property("Roll", MakeProperty(&FRotator::Roll))
.Method("DiagnosticCheckNaN", CombineOverloads(MakeOverload(void(FRotator::*)() const, &FRotator::DiagnosticCheckNaN),
MakeOverload(void(FRotator::*)(const TCHAR*) const, &FRotator::DiagnosticCheckNaN)))
.Method("DiagnosticCheckNaN", CombineOverloads(MakeOverload(void (FRotator::*)() const, &FRotator::DiagnosticCheckNaN),
MakeOverload(void (FRotator::*)(const TCHAR*) const, &FRotator::DiagnosticCheckNaN)))
.Method("op_Addition", MakeFunction(&FRotator::operator+))
.Method("op_Subtraction", MakeFunction(&FRotator::operator-))
.Method("op_Multiply", SelectFunction(FRotator(FRotator::*)(float Scale) const, &FRotator::operator*))
Expand Down
12 changes: 6 additions & 6 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FTransform_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ struct AutoRegisterForFTransform
.Method("InverseTransformRotation", MakeFunction(&FTransform::InverseTransformRotation))
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
.Method("ScaleTranslation",
CombineOverloads(MakeOverload(void(FTransform::*)(const FVector&), &FTransform::ScaleTranslation),
MakeOverload(void(FTransform::*)(const double&), &FTransform::ScaleTranslation)))
CombineOverloads(MakeOverload(void (FTransform::*)(const FVector&), &FTransform::ScaleTranslation),
MakeOverload(void (FTransform::*)(const double&), &FTransform::ScaleTranslation)))
.Method("GetScaled", CombineOverloads(MakeOverload(FTransform(FTransform::*)(double) const, &FTransform::GetScaled),
MakeOverload(FTransform(FTransform::*)(FVector) const, &FTransform::GetScaled)))
.Function(
"GetSafeScaleReciprocal", SelectFunction(FVector(*)(const FVector&, double), &FTransform::GetSafeScaleReciprocal))
#else
.Method("ScaleTranslation",
CombineOverloads(MakeOverload(void(FTransform::*)(const FVector&), &FTransform::ScaleTranslation),
MakeOverload(void(FTransform::*)(const float&), &FTransform::ScaleTranslation)))
CombineOverloads(MakeOverload(void (FTransform::*)(const FVector&), &FTransform::ScaleTranslation),
MakeOverload(void (FTransform::*)(const float&), &FTransform::ScaleTranslation)))
.Method("GetScaled", CombineOverloads(MakeOverload(FTransform(FTransform::*)(float) const, &FTransform::GetScaled),
MakeOverload(FTransform(FTransform::*)(FVector) const, &FTransform::GetScaled)))
.Function(
Expand Down Expand Up @@ -110,8 +110,8 @@ struct AutoRegisterForFTransform
.Method("CopyScale3D", MakeFunction(&FTransform::CopyScale3D))
.Method("SetTranslationAndScale3D", MakeFunction(&FTransform::SetTranslationAndScale3D))
.Method("Accumulate",
CombineOverloads(MakeOverload(void(FTransform::*)(const FTransform&), &FTransform::Accumulate),
MakeOverload(void(FTransform::*)(const FTransform&, const ScalarRegister&), &FTransform::Accumulate)))
CombineOverloads(MakeOverload(void (FTransform::*)(const FTransform&), &FTransform::Accumulate),
MakeOverload(void (FTransform::*)(const FTransform&, const ScalarRegister&), &FTransform::Accumulate)))
.Method("NormalizeRotation", MakeFunction(&FTransform::NormalizeRotation))
.Method("IsRotationNormalized", MakeFunction(&FTransform::IsRotationNormalized))
.Method("GetRotation", MakeFunction(&FTransform::GetRotation))
Expand Down
10 changes: 5 additions & 5 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FVector2D_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ struct AutoRegisterForFVector2D
.Method("op_Division", CombineOverloads(MakeOverload(FVector2D(FVector2D::*)(double) const, &FVector2D::operator/),
MakeOverload(FVector2D(FVector2D::*)(const FVector2D&) const, &FVector2D::operator/)))
.Method("set_Item", SelectFunction(double& (FVector2D::*) (int32), &FVector2D::operator[]))
.Method("get_Item", SelectFunction(double(FVector2D::*)(int32) const, &FVector2D::operator[]))
.Method("get_Item", SelectFunction(double (FVector2D::*)(int32) const, &FVector2D::operator[]))
.Method("Component", CombineOverloads(MakeOverload(double& (FVector2D::*) (int32), &FVector2D::Component),
MakeOverload(double(FVector2D::*)(int32) const, &FVector2D::Component)))
MakeOverload(double (FVector2D::*)(int32) const, &FVector2D::Component)))
#else
.Method("op_Addition",
CombineOverloads(MakeOverload(FVector2D(FVector2D::*)(const FVector2D&) const, &FVector2D::operator+),
Expand All @@ -56,9 +56,9 @@ struct AutoRegisterForFVector2D
.Method("op_Division", CombineOverloads(MakeOverload(FVector2D(FVector2D::*)(float) const, &FVector2D::operator/),
MakeOverload(FVector2D(FVector2D::*)(const FVector2D&) const, &FVector2D::operator/)))
.Method("set_Item", SelectFunction(float& (FVector2D::*) (int32), &FVector2D::operator[]))
.Method("get_Item", SelectFunction(float(FVector2D::*)(int32) const, &FVector2D::operator[]))
.Method("get_Item", SelectFunction(float (FVector2D::*)(int32) const, &FVector2D::operator[]))
.Method("Component", CombineOverloads(MakeOverload(float& (FVector2D::*) (int32), &FVector2D::Component),
MakeOverload(float(FVector2D::*)(int32) const, &FVector2D::Component)))
MakeOverload(float (FVector2D::*)(int32) const, &FVector2D::Component)))
#endif
.Function("DotProduct", MakeFunction(&FVector2D::DotProduct))
.Function("DistSquared", MakeFunction(&FVector2D::DistSquared))
Expand All @@ -76,7 +76,7 @@ struct AutoRegisterForFVector2D
.Method("Normalize", MakeFunction(&FVector2D::Normalize))
.Method("IsNearlyZero", MakeFunction(&FVector2D::IsNearlyZero))
.Method("ToDirectionAndLength",
SelectFunction(void(FVector2D::*)(FVector2D&, float&) const, &FVector2D::ToDirectionAndLength))
SelectFunction(void (FVector2D::*)(FVector2D&, float&) const, &FVector2D::ToDirectionAndLength))
.Method("IsZero", MakeFunction(&FVector2D::IsZero))
.Method("IntPoint", MakeFunction(&FVector2D::IntPoint))
.Method("RoundToVector", MakeFunction(&FVector2D::RoundToVector))
Expand Down
4 changes: 2 additions & 2 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FVector4_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ struct AutoRegisterForFVector4
.Method("op_ExclusiveOr", MakeFunction(&FVector4::operator^))
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
.Method("set_Item", SelectFunction(double& (FVector4::*) (int32), &FVector4::operator[]))
.Method("get_Item", SelectFunction(double(FVector4::*)(int32) const, &FVector4::operator[]))
.Method("get_Item", SelectFunction(double (FVector4::*)(int32) const, &FVector4::operator[]))
.Method("Component", CombineOverloads(MakeOverload(double& (FVector4::*) (int32), &FVector4::Component),
MakeOverload(const double& (FVector4::*) (int32) const, &FVector4::Component)))
#else
.Method("set_Item", SelectFunction(float& (FVector4::*) (int32), &FVector4::operator[]))
.Method("get_Item", SelectFunction(float(FVector4::*)(int32) const, &FVector4::operator[]))
.Method("get_Item", SelectFunction(float (FVector4::*)(int32) const, &FVector4::operator[]))
.Method("Component", CombineOverloads(MakeOverload(float& (FVector4::*) (int32), &FVector4::Component),
MakeOverload(const float& (FVector4::*) (int32) const, &FVector4::Component)))
#endif
Expand Down
14 changes: 7 additions & 7 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FVector_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ struct AutoRegisterForFVector
.Property("X", MakeProperty(&FVector::X))
.Property("Y", MakeProperty(&FVector::Y))
.Property("Z", MakeProperty(&FVector::Z))
.Method("DiagnosticCheckNaN", CombineOverloads(MakeOverload(void(FVector::*)() const, &FVector::DiagnosticCheckNaN),
MakeOverload(void(FVector::*)(const TCHAR*) const, &FVector::DiagnosticCheckNaN)))
.Method("DiagnosticCheckNaN", CombineOverloads(MakeOverload(void (FVector::*)() const, &FVector::DiagnosticCheckNaN),
MakeOverload(void (FVector::*)(const TCHAR*) const, &FVector::DiagnosticCheckNaN)))
.Method("op_ExclusiveOr", MakeFunction(&FVector::operator^))
.Function("CrossProduct", MakeFunction(&FVector::CrossProduct))
.Method("op_BitwiseOr", MakeFunction(&FVector::operator|))
Expand All @@ -47,14 +47,14 @@ struct AutoRegisterForFVector
.Method("op_UnaryNegation", SelectFunction(FVector(FVector::*)() const, &FVector::operator-))
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
.Method("set_Item", SelectFunction(double& (FVector::*) (int32), &FVector::operator[]))
.Method("get_Item", SelectFunction(double(FVector::*)(int32) const, &FVector::operator[]))
.Method("get_Item", SelectFunction(double (FVector::*)(int32) const, &FVector::operator[]))
.Method("Component", CombineOverloads(MakeOverload(double& (FVector::*) (int32), &FVector::Component),
MakeOverload(double(FVector::*)(int32) const, &FVector::Component)))
MakeOverload(double (FVector::*)(int32) const, &FVector::Component)))
#else
.Method("set_Item", SelectFunction(float& (FVector::*) (int32), &FVector::operator[]))
.Method("get_Item", SelectFunction(float(FVector::*)(int32) const, &FVector::operator[]))
.Method("get_Item", SelectFunction(float (FVector::*)(int32) const, &FVector::operator[]))
.Method("Component", CombineOverloads(MakeOverload(float& (FVector::*) (int32), &FVector::Component),
MakeOverload(float(FVector::*)(int32) const, &FVector::Component)))
MakeOverload(float (FVector::*)(int32) const, &FVector::Component)))
#endif
.Method("GetComponentForAxis", MakeFunction(&FVector::GetComponentForAxis))
.Method("SetComponentForAxis", MakeFunction(&FVector::SetComponentForAxis))
Expand All @@ -79,7 +79,7 @@ struct AutoRegisterForFVector
.Method("GetSafeNormal", MakeFunction(&FVector::GetSafeNormal))
.Method("GetSafeNormal2D", MakeFunction(&FVector::GetSafeNormal2D))
.Method(
"ToDirectionAndLength", SelectFunction(void(FVector::*)(FVector&, float&) const, &FVector::ToDirectionAndLength))
"ToDirectionAndLength", SelectFunction(void (FVector::*)(FVector&, float&) const, &FVector::ToDirectionAndLength))
.Method("GetSignVector", MakeFunction(&FVector::GetSignVector))
.Method("Projection", MakeFunction(&FVector::Projection))
.Method("GetUnsafeNormal2D", MakeFunction(&FVector::GetUnsafeNormal2D))
Expand Down

0 comments on commit 053a25f

Please sign in to comment.