move SGCoreImpl/SGPlatform to SGBuildHacks/SGPlatform and introduce SG_CPP20 and SG_CAPTURE_THIS

This commit is contained in:
Mamadou Babaei
2023-09-14 18:35:06 +02:00
parent d2495a3550
commit 8f78bb7228
40 changed files with 76 additions and 42 deletions
@@ -48,6 +48,7 @@
#include "SenseGlove/GameFramework/SGPawn.h"
#include "SenseGlove/Haptics/SGGrabState.h"
#include "SenseGlove/Haptics/SGTouchState.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCore/SGBuzzCommand.h"
#include "SGCore/SGForceFeedbackCommand.h"
#include "SGCore/SGHapticGlove.h"
@@ -204,7 +205,7 @@ void ASGPlayerController::BeginPlay()
}
SGPawn->OnGrabStateUpdated().AddWeakLambda(
this, [=](const FSGGrabState& GrabState) -> void
this, [= SG_CAPTURE_THIS](const FSGGrabState& GrabState) -> void
{
if (!IsValid(SGPawn))
{
@@ -235,7 +236,7 @@ void ASGPlayerController::BeginPlay()
});
SGPawn->OnTouchStateUpdated().AddWeakLambda(
this, [=](const FSGTouchState& TouchState) -> void
this, [= SG_CAPTURE_THIS](const FSGTouchState& TouchState) -> void
{
Pimpl->UpdateHapticsFeedback(TouchState);
});
@@ -338,7 +339,7 @@ void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& Touc
Owner->GetWorldTimerManager().ClearTimer(TouchBuzzStopTimer);
FTimerDelegate TouchBuzzStopHandler;
TouchBuzzStopHandler.BindLambda([=]()-> void
TouchBuzzStopHandler.BindLambda([= SG_CAPTURE_THIS]()-> void
{
Glove->SendHaptics(USGBuzzCommand::Off(Owner));
});
+7
View File
@@ -66,5 +66,12 @@ public class SenseGlove : ModuleRules
"SenseGloveTypes",
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveBuildHacks",
}
);
}
}
@@ -33,4 +33,4 @@
*/
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
@@ -41,8 +41,20 @@
#define SG_CPP17 0
#endif /* ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L ) */
#if SG_CPP17
#if ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 202002L ) || __cplusplus >= 202002L )
#define SG_CPP20 1
#else /* ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 202002L ) || __cplusplus >= 202002L ) */
#define SG_CPP20 0
#endif /* ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 202002L ) || __cplusplus >= 202002L ) */
#if SG_CPP17 || SG_CPP20
#define SG_NOEXCEPT noexcept
#else /* SG_CPP17 */
#else /* SG_CPP17 || SG_CPP20 */
#define SG_NOEXCEPT
#endif /* SG_CPP17 */
#endif /* SG_CPP17 || SG_CPP20 */
#if SG_CPP20
#define SG_CAPTURE_THIS , this
#else /* SG_CPP17 || SG_CPP20 */
#define SG_CAPTURE_THIS
#endif /* SG_CPP17 || SG_CPP20 */
@@ -63,9 +63,10 @@ public class SenseGloveCore : ModuleRules
}
);
PublicIncludePathModuleNames.AddRange(
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveBuildHacks",
"SenseGloveTypes",
}
);
@@ -40,7 +40,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
class FSGVect3DImpl;
@@ -39,7 +39,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -40,7 +40,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -43,8 +43,8 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -39,8 +39,8 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCoreImpl/SGFingerCommandImpl.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -38,7 +38,7 @@
#include "Containers/UnrealString.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -41,7 +41,7 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -38,7 +38,7 @@
#include "Containers/UnrealString.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -40,7 +40,7 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -39,8 +39,8 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCoreImpl/SGFingerCommandImpl.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -40,7 +40,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
class FSGInterpolationSetImpl;
@@ -38,7 +38,7 @@
#include "Containers/UnrealString.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
class FSGHandInterpolatorImpl;
@@ -38,7 +38,7 @@
#include "Containers/UnrealString.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
class FSGHandInterpolatorImpl;
@@ -39,7 +39,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -41,7 +41,7 @@
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGHapticGloveCalibrationSequenceImpl.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -38,7 +38,7 @@
#include "Containers/Array.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -44,8 +44,8 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCoreImpl/SGDeviceImpl.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -39,8 +39,8 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCoreImpl/SGHapticGloveCalibrationSequenceImpl.h"
#include "SGCoreImpl/SGPlatform.h"
namespace SGCore
{
@@ -38,7 +38,7 @@
#include "Containers/UnrealString.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -38,7 +38,7 @@
#include "Containers/UnrealString.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
class FSGHandInterpolatorImpl;
@@ -44,8 +44,8 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGPlatform.h"
namespace SGCore
{
@@ -38,7 +38,7 @@
#include "Containers/UnrealString.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -39,7 +39,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -39,7 +39,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
class FSGHandInterpolatorImpl;
@@ -44,8 +44,8 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCoreImpl/SGHapticGloveImpl.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -39,7 +39,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -39,7 +39,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -38,7 +38,7 @@
#include "Containers/UnrealString.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -39,7 +39,7 @@
#include "Math/Vector.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -38,7 +38,7 @@
#include "HAL/Platform.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -40,8 +40,8 @@
#include "Templates/SharedPointer.h"
#include "Templates/UniquePtr.h"
#include "SGBuildHacks/SGPlatform.h"
#include "SGCoreImpl/SGBuzzCommandImpl.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGTypes/SGCoreTypes.h"
namespace SGCore
@@ -39,7 +39,7 @@
#include "HAL/Platform.h"
#include "Templates/UniquePtr.h"
#include "SGCoreImpl/SGPlatform.h"
#include "SGBuildHacks/SGPlatform.h"
namespace SGCore
{
@@ -58,7 +58,6 @@ public class SenseGloveCoreImpl : ModuleRules
PrivateDependencyModuleNames.AddRange(
new string[]
{
"SenseGloveBuildHacks",
"SenseGloveInterop",
"SenseGloveLog",
"SenseGloveTypes",
@@ -66,6 +65,13 @@ public class SenseGloveCoreImpl : ModuleRules
}
);
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveBuildHacks",
}
);
AddCoreLibrary(Target);
PublicDefinitions.Add("SENSEGLOVE_BUILDING_CORE_IMPL_MODULE");
@@ -60,8 +60,9 @@ public class SenseGloveInterop : ModuleRules
PrivateIncludePathModuleNames.AddRange(
new string[]
{
"SenseGloveBuildHacks",
"SenseGloveCoreImpl",
}
);
}
}
}