aboutsummaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBo Rong <[email protected]>2018-04-27 13:53:08 +0800
committerBo Rong <[email protected]>2018-04-27 13:53:08 +0800
commitc1aaa729f25fef32a3a5787c216378bf3b2f904d (patch)
treea5a02303fa8f18914c04d5aaf7354c1401c7a209 /Source
parentMerge branch '4.18' of https://github.com/NVIDIAGameWorks/GfeSDK-UE4Plugin in... (diff)
downloadgfesdk-ue4plugin-c1aaa729f25fef32a3a5787c216378bf3b2f904d.tar.xz
gfesdk-ue4plugin-c1aaa729f25fef32a3a5787c216378bf3b2f904d.zip
Code of 4.18 plugin adapted to previously unsupported UE 4.13
Diffstat (limited to 'Source')
-rw-r--r--Source/NVIDIAGfeSDK/NVIDIAGfeSDK.Build.cs4
-rw-r--r--Source/NVIDIAGfeSDK/Private/FNVIDIAGfeSDK.cpp9
-rw-r--r--Source/NVIDIAGfeSDK/Private/GfeSDKCore.cpp2
-rw-r--r--Source/NVIDIAGfeSDK/Private/GfeSDKHighlights.cpp2
-rw-r--r--Source/NVIDIAGfeSDK/Private/HighLightBlueprint.cpp33
-rw-r--r--Source/NVIDIAGfeSDK/Private/TypeTranslation.cpp2
-rw-r--r--Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h1
-rw-r--r--Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h2
-rw-r--r--Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h52
9 files changed, 81 insertions, 26 deletions
diff --git a/Source/NVIDIAGfeSDK/NVIDIAGfeSDK.Build.cs b/Source/NVIDIAGfeSDK/NVIDIAGfeSDK.Build.cs
index 30e3125..ae3fb29 100644
--- a/Source/NVIDIAGfeSDK/NVIDIAGfeSDK.Build.cs
+++ b/Source/NVIDIAGfeSDK/NVIDIAGfeSDK.Build.cs
@@ -26,7 +26,7 @@ namespace UnrealBuildTool.Rules
get { return Path.GetFullPath(Path.Combine(ThirdPartyPath, "NVIDIAGfeSDK", "lib")); }
}
- public NVIDIAGfeSDK(ReadOnlyTargetRules Target) : base(Target)
+ public NVIDIAGfeSDK(TargetInfo Target)
{
PublicIncludePaths.AddRange(
new string[] {
@@ -73,7 +73,7 @@ namespace UnrealBuildTool.Rules
LoadNVIDIAGfeSDKLib(Target);
}
- public bool LoadNVIDIAGfeSDKLib(ReadOnlyTargetRules Target)
+ public bool LoadNVIDIAGfeSDKLib(TargetInfo Target)
{
bool isLibrarySupported = false;
diff --git a/Source/NVIDIAGfeSDK/Private/FNVIDIAGfeSDK.cpp b/Source/NVIDIAGfeSDK/Private/FNVIDIAGfeSDK.cpp
index 315cf2d..5e13b4c 100644
--- a/Source/NVIDIAGfeSDK/Private/FNVIDIAGfeSDK.cpp
+++ b/Source/NVIDIAGfeSDK/Private/FNVIDIAGfeSDK.cpp
@@ -6,8 +6,8 @@
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/
-#include "FNVIDIAGfeSDK.h"
#include "NVIDIAGfeSDKPrivatePCH.h"
+#include "FNVIDIAGfeSDK.h"
#include "Runtime/Core/Public/Misc/Paths.h"
#include "Runtime/Core/Public/Windows/WindowsPlatformProcess.h"
#include "gfesdk/sdk_types.h"
@@ -139,7 +139,7 @@ void __stdcall OnNotificationCallback(GfeSDK::NVGSDK_NotificationType type, GfeS
for (size_t i = 0; i < response->permissionsChanged.scopePermissionTableSize; i++)
{
- PermissionsChangedData.ScopePermissions.Add(ScopeMap[response->permissionsChanged.scopePermissionTable[i].scope], PermissionMap[response->permissionsChanged.scopePermissionTable[i].permission]);
+ PermissionsChangedData.ScopePermissions.Add(FGfeSDKPairScopePermission(ScopeMap[response->permissionsChanged.scopePermissionTable[i].scope], PermissionMap[response->permissionsChanged.scopePermissionTable[i].permission]));
}
if (SDKObject)
SDKObject->PermissionsChangedDelegate.ExecuteIfBound(PermissionsChangedData);
@@ -191,9 +191,10 @@ EGfeSDKReturnCode FNVIDIAGfeSDK::Create(FGfeSDKCreateInputParams const& InputPar
for (size_t i = 0; i < OutputParamsCreate.scopePermissionTableSize; i++)
{
- Response.ScopePermissions.Add(
+ Response.ScopePermissions.Add(FGfeSDKPairScopePermission(
TranslateEnum(kScopeSdkToUnreal, OutputParamsCreate.scopePermissionTable[i].scope, EGfeSDKScope::MAX),
- TranslateEnum(kPermissionSdkToUnreal, OutputParamsCreate.scopePermissionTable[i].permission, EGfeSDKPermission::MAX));
+ TranslateEnum(kPermissionSdkToUnreal, OutputParamsCreate.scopePermissionTable[i].permission, EGfeSDKPermission::MAX)
+ ));
}
}
else
diff --git a/Source/NVIDIAGfeSDK/Private/GfeSDKCore.cpp b/Source/NVIDIAGfeSDK/Private/GfeSDKCore.cpp
index 8abd970..cf60ee1 100644
--- a/Source/NVIDIAGfeSDK/Private/GfeSDKCore.cpp
+++ b/Source/NVIDIAGfeSDK/Private/GfeSDKCore.cpp
@@ -6,9 +6,9 @@
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/
+#include "NVIDIAGfeSDKPrivatePCH.h"
#include "GfeSDKCore.h"
-#include "NVIDIAGfeSDKPrivatePCH.h"
#define VALIDATE_MODULE_CORE() \
if (!GFEHandle && Callback) \
diff --git a/Source/NVIDIAGfeSDK/Private/GfeSDKHighlights.cpp b/Source/NVIDIAGfeSDK/Private/GfeSDKHighlights.cpp
index 00ba698..7e50daf 100644
--- a/Source/NVIDIAGfeSDK/Private/GfeSDKHighlights.cpp
+++ b/Source/NVIDIAGfeSDK/Private/GfeSDKHighlights.cpp
@@ -6,8 +6,8 @@
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/
-#include "GfeSDKHighlights.h"
#include "NVIDIAGfeSDKPrivatePCH.h"
+#include "GfeSDKHighlights.h"
#include "Platform.h"
#define VALIDATE_MODULE_HIGHLIGHTS() \
diff --git a/Source/NVIDIAGfeSDK/Private/HighLightBlueprint.cpp b/Source/NVIDIAGfeSDK/Private/HighLightBlueprint.cpp
index c6de5a7..ff73707 100644
--- a/Source/NVIDIAGfeSDK/Private/HighLightBlueprint.cpp
+++ b/Source/NVIDIAGfeSDK/Private/HighLightBlueprint.cpp
@@ -1,11 +1,9 @@
// Fill out your copyright notice in the Description page of Project Settings.
-#include "HighLightBlueprint.h"
#include "NVIDIAGfeSDKPrivatePCH.h"
+#include "HighLightBlueprint.h"
#include "FNVIDIAGfeSDK.h"
#include "NVIDIAGfeSDKTypes.h"
-#include "CoreMinimal.h"
-#include "Runtime/CoreUObject/Public/UObject/Package.h"
#include "Platform.h"
#include <gfesdk/bindings/cpp/sdk_types_cpp.h>
@@ -116,6 +114,7 @@ protected:
void OnPermissionsChanged(FGfeSDKPermissionsChangedData const& PermissionsChangedData)
{
UE_LOG(LogTemp, Log, TEXT("Permissions Changed notification"));
+ mLastScopePermissions.Empty();
for (auto& ScopePermission : PermissionsChangedData.ScopePermissions)
{
UE_LOG(LogTemp, Log, TEXT("Scope %s now has permission %s"),
@@ -124,8 +123,8 @@ protected:
{
mPermissionsNeeded.Add(ScopePermission.Key);
}
+ mLastScopePermissions.Add(ScopePermission.Key, ScopePermission.Value);
}
- mLastScopePermissions = PermissionsChangedData.ScopePermissions;
}
};
@@ -169,7 +168,26 @@ void UHighlightsFunctionLibrary::Poll()
void UHighlightsFunctionLibrary::ChekIfHighlightsAvailable(const FGfeSDKCreateResponse& InitProperties, bool &VideoGranted, bool &ScreenshotsGranted, EGfeSDKPermission &Video, EGfeSDKPermission &Screenshots)
{
- const EGfeSDKPermission* H = InitProperties.ScopePermissions.Find(EGfeSDKScope::Highlights);
+ const EGfeSDKPermission* H = nullptr;
+ const EGfeSDKPermission* V = nullptr;
+ const EGfeSDKPermission* S = nullptr;
+ for (auto & Pair : InitProperties.ScopePermissions)
+ {
+ switch (Pair.Key)
+ {
+ case EGfeSDKScope::Highlights:
+ H = &Pair.Value;
+ break;
+ case EGfeSDKScope::HighlightsRecordVideo:
+ V = &Pair.Value;
+ break;
+ case EGfeSDKScope::HighlightsRecordScreenshot:
+ S = &Pair.Value;
+ break;
+ default:
+ break;
+ }
+ }
VideoGranted = false;
ScreenshotsGranted = false;
@@ -178,14 +196,12 @@ void UHighlightsFunctionLibrary::ChekIfHighlightsAvailable(const FGfeSDKCreateRe
if (H && (*H) == EGfeSDKPermission::Granted)
{
- const EGfeSDKPermission* V = InitProperties.ScopePermissions.Find(EGfeSDKScope::HighlightsRecordVideo);
if (V)
{
Video = (*V);
if (Video == EGfeSDKPermission::Granted)
VideoGranted = true;
}
- const EGfeSDKPermission* S = InitProperties.ScopePermissions.Find(EGfeSDKScope::HighlightsRecordScreenshot);
if (S)
{
Screenshots = (*S);
@@ -304,6 +320,7 @@ void UInitHighlights::Callback()
void UInitHighlights::OnPermissionsChanged(FGfeSDKPermissionsChangedData const& PermissionsChangedData)
{
UE_LOG(LogTemp, Log, TEXT("Permissions Changed notification"));
+ mLastScopePermissions.Empty();
for (auto& ScopePermission : PermissionsChangedData.ScopePermissions)
{
UE_LOG(LogTemp, Log, TEXT("Scope %s now has permission %s"),
@@ -312,8 +329,8 @@ void UInitHighlights::OnPermissionsChanged(FGfeSDKPermissionsChangedData const&
{
mPermissionsNeeded.Add(ScopePermission.Key);
}
+ mLastScopePermissions.Add(ScopePermission.Key, ScopePermission.Value);
}
- mLastScopePermissions = PermissionsChangedData.ScopePermissions;
}
//---------------------------------------------------------------------------
diff --git a/Source/NVIDIAGfeSDK/Private/TypeTranslation.cpp b/Source/NVIDIAGfeSDK/Private/TypeTranslation.cpp
index 3fe76ae..d7a5f72 100644
--- a/Source/NVIDIAGfeSDK/Private/TypeTranslation.cpp
+++ b/Source/NVIDIAGfeSDK/Private/TypeTranslation.cpp
@@ -6,8 +6,8 @@
* distribution of this software and related documentation without an express
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/
-#include "TypeTranslation.h"
#include "NVIDIAGfeSDKPrivatePCH.h"
+#include "TypeTranslation.h"
diff --git a/Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h b/Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h
index 46cd053..79949a5 100644
--- a/Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h
+++ b/Source/NVIDIAGfeSDK/Public/HighLightBlueprint.h
@@ -2,7 +2,6 @@
#pragma once
#include "NVIDIAGfeSDKPrivatePCH.h"
-#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Kismet/BlueprintAsyncActionBase.h"
#include <gfesdk/bindings/cpp/highlights/highlights_types_cpp.h>
diff --git a/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h b/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h
index 8b446f7..1ae7f18 100644
--- a/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h
+++ b/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKPublicPCH.h
@@ -1,6 +1,4 @@
#include "ModuleManager.h"
-#include "CoreMinimal.h"
-//#include "Engine.h"
#include "UniquePtr.h"
#include "NVIDIAGfeSDKTypes.h"
diff --git a/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h b/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h
index de5a1a0..2ab4cd8 100644
--- a/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h
+++ b/Source/NVIDIAGfeSDK/Public/NVIDIAGfeSDKTypes.h
@@ -114,6 +114,40 @@ struct FGfeSDKCreateInputParams
};
USTRUCT(BlueprintType)
+struct FGfeSDKPair
+{
+ GENERATED_USTRUCT_BODY();
+
+ FGfeSDKPair() {}
+ FGfeSDKPair(FString inKey, FString inValue)
+ : Key(inKey), Value(inValue)
+ {}
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString Key;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ FString Value;
+};
+
+USTRUCT(BlueprintType)
+struct FGfeSDKPairScopePermission
+{
+ GENERATED_USTRUCT_BODY();
+
+ FGfeSDKPairScopePermission() {}
+ FGfeSDKPairScopePermission(EGfeSDKScope inKey, EGfeSDKPermission inValue)
+ : Key(inKey), Value(inValue)
+ {}
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ EGfeSDKScope Key;
+
+ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
+ EGfeSDKPermission Value;
+};
+
+USTRUCT(BlueprintType)
struct FGfeSDKCreateResponse
{
GENERATED_USTRUCT_BODY()
@@ -135,7 +169,7 @@ struct FGfeSDKCreateResponse
FString NVIDIAGfeVersion;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
- TMap<EGfeSDKScope, EGfeSDKPermission> ScopePermissions;
+ TArray<FGfeSDKPairScopePermission> ScopePermissions;
};
USTRUCT(BlueprintType)
@@ -151,7 +185,13 @@ struct FGfeSDKHighlightDefinition
}
FGfeSDKHighlightDefinition(FString const& Id_, bool UserDefaultInterest_, EGfeSDKHighlightType Tags_, EGfeSDKHighlightSignificance Sig_, TMap<FString, FString> Table_) :
- Id(Id_), UserDefaultInterest(UserDefaultInterest_), HighlightTags(Tags_), Significance(Sig_), NameTranslationTable(Table_) {}
+ Id(Id_), UserDefaultInterest(UserDefaultInterest_), HighlightTags(Tags_), Significance(Sig_)
+ {
+ for (auto & Pair : Table_)
+ {
+ NameTranslationTable.Add(FGfeSDKPair(Pair.Key, Pair.Value));
+ }
+ }
// Defines the highlight type name
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
FString Id;
@@ -165,9 +205,9 @@ struct FGfeSDKHighlightDefinition
// This property defines how good or bad the recorded event is in terms of the gameplay
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
EGfeSDKHighlightSignificance Significance;
-
+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
- TMap<FString, FString> NameTranslationTable;
+ TArray<FGfeSDKPair> NameTranslationTable;
};
USTRUCT(BlueprintType)
@@ -204,7 +244,7 @@ struct FGfeSDKPermissionsChangedData
FGfeSDKPermissionsChangedData() {}
UPROPERTY()
- TMap<EGfeSDKScope, EGfeSDKPermission> ScopePermissions;
+ TArray<FGfeSDKPairScopePermission> ScopePermissions;
};
USTRUCT(BlueprintType)
@@ -218,7 +258,7 @@ struct FGfeSDKHighlightOpenGroupParams
FString GroupId;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Shadowplay Highlights")
- TMap<FString, FString> GroupDescriptionTranslationTable;
+ TArray<FGfeSDKPair> GroupDescriptionTranslationTable;
};
USTRUCT(BlueprintType)