Skip to content

Commit

Permalink
[unreal]添加几个系统struct的静态变量绑定
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Nov 14, 2024
1 parent 9bc54f7 commit f5cc8d7
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 0 deletions.
14 changes: 14 additions & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FColor_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ struct AutoRegisterForFColor
.Method("ToPackedABGR", MakeFunction(&FColor::ToPackedABGR))
.Method("ToPackedRGBA", MakeFunction(&FColor::ToPackedRGBA))
.Method("ToPackedBGRA", MakeFunction(&FColor::ToPackedBGRA))
.Variable("White", MakeReadonlyVariable(&FColor::White))
.Variable("Black", MakeReadonlyVariable(&FColor::Black))
.Variable("Transparent", MakeReadonlyVariable(&FColor::Transparent))
.Variable("Red", MakeReadonlyVariable(&FColor::Red))
.Variable("Green", MakeReadonlyVariable(&FColor::Green))
.Variable("Blue", MakeReadonlyVariable(&FColor::Blue))
.Variable("Yellow", MakeReadonlyVariable(&FColor::Yellow))
.Variable("Cyan", MakeReadonlyVariable(&FColor::Cyan))
.Variable("Magenta", MakeReadonlyVariable(&FColor::Magenta))
.Variable("Orange", MakeReadonlyVariable(&FColor::Orange))
.Variable("Purple", MakeReadonlyVariable(&FColor::Purple))
.Variable("Turquoise", MakeReadonlyVariable(&FColor::Turquoise))
.Variable("Silver", MakeReadonlyVariable(&FColor::Silver))
.Variable("Emerald", MakeReadonlyVariable(&FColor::Emerald))
.Register();
}
};
Expand Down
2 changes: 2 additions & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FIntPoint_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ struct AutoRegisterForFIntPoint
.Function(
"DivideAndRoundDown", SelectFunction(FIntPoint(*)(FIntPoint lhs, int32 Divisor), &FIntPoint::DivideAndRoundDown))
.Function("Num", MakeFunction(&FIntPoint::Num))
.Variable("ZeroValue", MakeReadonlyVariable(&FIntPoint::ZeroValue))
.Variable("NoneValue", MakeReadonlyVariable(&FIntPoint::NoneValue))
.Register();
}
};
Expand Down
2 changes: 2 additions & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FIntVector_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ struct AutoRegisterForFIntVector
"DivideAndRoundUp", CombineOverloads(MakeOverload(FIntVector(*)(FIntVector, int32), &FIntVector::DivideAndRoundUp),
MakeOverload(FIntVector(*)(FIntVector, FIntVector), &FIntVector::DivideAndRoundUp)))
.Function("Num", MakeFunction(&FIntVector::Num))
.Variable("ZeroValue", MakeReadonlyVariable(&FIntVector::ZeroValue))
.Variable("NoneValue", MakeReadonlyVariable(&FIntVector::NoneValue))
.Register();
}
};
Expand Down
10 changes: 10 additions & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FLinearColor_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ struct AutoRegisterForFLinearColor
.Method("GetLuminance", MakeFunction(&FLinearColor::GetLuminance))
.Method("ToString", MakeFunction(&FLinearColor::ToString))
.Method("InitFromString", MakeFunction(&FLinearColor::InitFromString))
//.Variable("Pow22OneOver255Table", MakeVariable(&FLinearColor::Pow22OneOver255Table))
//.Variable("sRGBToLinearTable", MakeVariable(&FLinearColor::sRGBToLinearTable))
.Variable("White", MakeReadonlyVariable(&FLinearColor::White))
.Variable("Gray", MakeReadonlyVariable(&FLinearColor::Gray))
.Variable("Black", MakeReadonlyVariable(&FLinearColor::Black))
.Variable("Transparent", MakeReadonlyVariable(&FLinearColor::Transparent))
.Variable("Red", MakeReadonlyVariable(&FLinearColor::Red))
.Variable("Green", MakeReadonlyVariable(&FLinearColor::Green))
.Variable("Blue", MakeReadonlyVariable(&FLinearColor::Blue))
.Variable("Yellow", MakeReadonlyVariable(&FLinearColor::Yellow))
.Register();
}
};
Expand Down
1 change: 1 addition & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FQuat_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct AutoRegisterForFQuat
.Function("Squad", MakeFunction(&FQuat::Squad))
.Function("SquadFullPath", MakeFunction(&FQuat::SquadFullPath))
.Function("CalcTangents", MakeFunction(&FQuat::CalcTangents))
.Variable("Identity", MakeReadonlyVariable(&FQuat::Identity))
.Register();
}
};
Expand Down
1 change: 1 addition & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FRotator_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct AutoRegisterForFRotator
.Function("CompressAxisToShort", MakeFunction(&FRotator::CompressAxisToShort))
.Function("DecompressAxisFromShort", MakeFunction(&FRotator::DecompressAxisFromShort))
.Function("MakeFromEuler", MakeFunction(&FRotator::MakeFromEuler))
.Variable("ZeroRotator", MakeReadonlyVariable(&FRotator::ZeroRotator))
.Register();
}
};
Expand Down
1 change: 1 addition & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FTransform_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ struct AutoRegisterForFTransform
.Method("GetScale3D", MakeFunction(&FTransform::GetScale3D))
.Method("CopyRotationPart", MakeFunction(&FTransform::CopyRotationPart))
.Method("CopyTranslationAndScale3D", MakeFunction(&FTransform::CopyTranslationAndScale3D))
.Variable("Identity", MakeReadonlyVariable(&FTransform::Identity))
.Register();
}
};
Expand Down
3 changes: 3 additions & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FVector2D_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ struct AutoRegisterForFVector2D
.Method("DiagnosticCheckNaN", MakeFunction(&FVector2D::DiagnosticCheckNaN))
.Method("ContainsNaN", MakeFunction(&FVector2D::ContainsNaN))
.Method("SphericalToUnitCartesian", MakeFunction(&FVector2D::SphericalToUnitCartesian))
.Variable("ZeroVector", MakeReadonlyVariable(&FVector2D::ZeroVector))
.Variable("UnitVector", MakeReadonlyVariable(&FVector2D::UnitVector))
.Variable("Unit45Deg", MakeReadonlyVariable(&FVector2D::Unit45Deg))
.Register();
}
};
Expand Down
8 changes: 8 additions & 0 deletions unreal/Puerts/Source/JsEnv/Private/Gen/FVector_Wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ struct AutoRegisterForFVector
.Function("Triple", MakeFunction(&FVector::Triple))
.Function("RadiansToDegrees", MakeFunction(&FVector::RadiansToDegrees))
.Function("DegreesToRadians", MakeFunction(&FVector::DegreesToRadians))
.Variable("ZeroVector", MakeReadonlyVariable(&FVector::ZeroVector))
.Variable("OneVector", MakeReadonlyVariable(&FVector::OneVector))
.Variable("UpVector", MakeReadonlyVariable(&FVector::UpVector))
.Variable("DownVector", MakeReadonlyVariable(&FVector::DownVector))
.Variable("ForwardVector", MakeReadonlyVariable(&FVector::ForwardVector))
.Variable("BackwardVector", MakeReadonlyVariable(&FVector::BackwardVector))
.Variable("RightVector", MakeReadonlyVariable(&FVector::RightVector))
.Variable("LeftVector", MakeReadonlyVariable(&FVector::LeftVector))
.Register();
}
};
Expand Down

0 comments on commit f5cc8d7

Please sign in to comment.