1
1
#include " BaseAnalyzer.h"
2
2
3
- #if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1
4
3
#include " AssetRegistry/AssetRegistryState.h"
5
- #else
6
- #include " AssetRegistryState.h"
7
- #endif
8
4
#include " Json.h"
9
- #include " Launch/Resources/Version.h"
10
5
#include " Misc/Base64.h"
11
6
#include " Misc/FileHelper.h"
12
7
#include " Misc/Paths.h"
@@ -24,7 +19,7 @@ FBaseAnalyzer::~FBaseAnalyzer()
24
19
25
20
}
26
21
27
- bool FBaseAnalyzer::LoadPakFiles (const TArray<FString>& InPakPaths, const TArray<FString>& InDefaultAESKeys)
22
+ bool FBaseAnalyzer::LoadPakFiles (const TArray<FString>& InPakPaths, const TArray<FString>& InDefaultAESKeys, int32 ContainerStartIndex )
28
23
{
29
24
Reset ();
30
25
return false ;
@@ -110,11 +105,7 @@ void FBaseAnalyzer::RefreshPackageDependency(FPakTreeEntryPtr InTreeRoot, FPakTr
110
105
else
111
106
{
112
107
TArray<FAssetIdentifier> Dependencies;
113
- #if ENGINE_MAJOR_VERSION >= 5 || ENGINE_MINOR_VERSION >= 26
114
108
if (AssetRegistryState->GetDependencies (Child->PackagePath , Dependencies, UE::AssetRegistry::EDependencyCategory::All))
115
- #else
116
- if (AssetRegistryState->GetDependencies (Child->PackagePath , Dependencies, EAssetRegistryDependencyType::All))
117
- #endif
118
109
{
119
110
if (!Child->AssetSummary .IsValid ())
120
111
{
@@ -135,11 +126,7 @@ void FBaseAnalyzer::RefreshPackageDependency(FPakTreeEntryPtr InTreeRoot, FPakTr
135
126
}
136
127
137
128
TArray<FAssetIdentifier> Dependents;
138
- #if ENGINE_MAJOR_VERSION >= 5 || ENGINE_MINOR_VERSION >= 26
139
129
if (AssetRegistryState->GetReferencers (Child->PackagePath , Dependents, UE::AssetRegistry::EDependencyCategory::All))
140
- #else
141
- if (AssetRegistryState->GetReferencers (Child->PackagePath , Dependents, EAssetRegistryDependencyType::All))
142
- #endif
143
130
{
144
131
if (!Child->AssetSummary .IsValid ())
145
132
{
@@ -443,20 +430,11 @@ FName FBaseAnalyzer::GetAssetClass(const FString& InFilename, FName InPackagePat
443
430
FName AssetClass = *FPaths::GetExtension (InFilename);
444
431
if (AssetRegistryState.IsValid ())
445
432
{
446
- #if ENGINE_MAJOR_VERSION >= 5 || ENGINE_MINOR_VERSION >= 27
447
433
TArrayView<FAssetData const * const > AssetDataArray = AssetRegistryState->GetAssetsByPackageName (InPackagePath);
448
- #else
449
- const TArray<const FAssetData*>& AssetDataArray = AssetRegistryState->GetAssetsByPackageName (InPackagePath);
450
- #endif
451
434
if (AssetDataArray.Num () > 0 )
452
435
{
453
436
bFoundClassInRegistry = true ;
454
-
455
- #if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1
456
437
AssetClass = AssetDataArray[0 ]->AssetClassPath .GetAssetName ();
457
- #else
458
- AssetClass = AssetDataArray[0 ]->AssetClass ;
459
- #endif
460
438
}
461
439
}
462
440
@@ -514,7 +492,6 @@ void FBaseAnalyzer::Reset()
514
492
515
493
FString FBaseAnalyzer::ResolveCompressionMethod (const FPakFileSumary& Summary, const FPakEntry* InPakEntry) const
516
494
{
517
- #if ENGINE_MAJOR_VERSION >= 5 || ENGINE_MINOR_VERSION >= 22
518
495
if (InPakEntry->CompressionMethodIndex >= 0 && InPakEntry->CompressionMethodIndex < (uint32)Summary.PakInfo .CompressionMethods .Num ())
519
496
{
520
497
return Summary.PakInfo .CompressionMethods [InPakEntry->CompressionMethodIndex ].ToString ();
@@ -523,18 +500,6 @@ FString FBaseAnalyzer::ResolveCompressionMethod(const FPakFileSumary& Summary, c
523
500
{
524
501
return TEXT (" Unknown" );
525
502
}
526
- #else
527
- static const TArray<FString> CompressionMethods ({ TEXT (" None" ), TEXT (" Zlib" ), TEXT (" Gzip" ), TEXT (" Unknown" ), TEXT (" Custom" ) });
528
-
529
- if (InPakEntry->CompressionMethod >= 0 && InPakEntry->CompressionMethod < CompressionMethods.Num ())
530
- {
531
- return CompressionMethods[InPakEntry->CompressionMethod ];
532
- }
533
- else
534
- {
535
- return TEXT (" Unknown" );
536
- }
537
- #endif
538
503
}
539
504
540
505
FPakTreeEntryPtr FBaseAnalyzer::InsertFileToTree (FPakTreeEntryPtr InRoot, const FPakFileSumary& Summary, const FString& InFullPath, const FPakEntry& InPakEntry)
0 commit comments