You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
==========================
MAJOR FEATURES + CHANGES
==========================
Change 2717513 on 2015/10/06 by Robert.Manuszewski@Robert_Manuszewski_EGUK_M1
GC and WeakObjectPtr performance optimizations.
- Moved some of the EObjectFlags to EInternalObjectFlags and merged them with FUObjectArray
- Moved WeakObjectPtr serial numbersto FUObjectArray
- Added pre-allocated UObject array
Change 2716517 on 2015/10/05 by Robert.Manuszewski@Robert_Manuszewski_EGUK_M1
Make SavePackage thread safe UObject-wise so that StaticFindObject etc can't run in parallel when packages are being saved.
Change 2721142 on 2015/10/08 by Mikolaj.Sieluzycki@Dev-Core_D0920
UHT will now use makefiles to speed up iterative runs.
Change 2726320 on 2015/10/13 by Jaroslaw.Palczynski@jaroslaw.palczynski_D1732_2963
Hot-reload performance optimizations:
1. Got rid of redundant touched BPs optimization (which was necessary before major HR fixes submitted earlier).
2. Parallelized search for old CDOs referencers.
Change 2759032 on 2015/11/09 by Graeme.Thornton@GThornton_DesktopMaster
Dependency preloading improvements
- Asset registry dependencies now resolve asset redirectors
- Rearrange runtime loading to put dependency preloads within BeginLoad/EndLoad for the source package
Change 2754342 on 2015/11/04 by Robert.Manuszewski@Robert_Manuszewski_Stream1
Allow UnfocusedVolumeMultiplier to be set programmatically
Change 2764008 on 2015/11/12 by Robert.Manuszewski@Robert_Manuszewski_Stream1
When cooking, don't add imports that are outers of objects excluded from the current cook target.
Change 2755562 on 2015/11/05 by Steve.Robb@Dev-Core
Inline storage for TFunction.
Fix for delegate inline storage on Win64.
Some build fixes.
Visualizer fixes for new TFunction format.
Change 2735084 on 2015/10/20 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
CrashReporter Web - Search by Platform
Added initial support for streams (GetBranchesAsListItems, CopyToJira)
Change 2762387 on 2015/11/11 by Steve.Robb@Dev-Core
Unnecessary allocation removed when loading empty files in FFileHelper::LoadFileToString.
Change 2762632 on 2015/11/11 by Steve.Robb@Dev-Core
Some TSet function optimisations:
Avoiding unnecessary hashing of function arguments if the container is empty (rather than the hash being empty, which is not necessarily equivalent).
Taking local copies of HashSize during iterations.
Change 2762936 on 2015/11/11 by Steve.Robb@Dev-Core
BulkData zero byte allocations are now handled by an RAII object which owns the memory.
Change 2765758 on 2015/11/13 by Steve.Robb@Dev-Core
FName::operator== and != optimised to be a single comparison.
Change 2757195 on 2015/11/06 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
PR #1305: Improvements in CrashReporter for Symbol Server usage (Contributed by bozaro)
Change 2760778 on 2015/11/10 by Jaroslaw.Surowiec@Stream.1.JarekSurowiec
PR #1725: Fixed typos in ProfilerCommon.h; Added comments (Contributed by BGR360)
Also fixed starting condition.
Change 2739804 on 2015/10/23 by Robert.Manuszewski@Robert_Manuszewski_Stream1
PR #1470: [UObjectGlobals] Do not overwrite instanced subobjects with ones from CDO (Contributed by slonopotamus)
Change 2744733 on 2015/10/28 by Steve.Robb@Dev-Core
PR #1540 - Specifying a different Saved folder at launch through a command line parameter
Integrated and optimized.
#lockdown Nick.Penwarden
[CL 2772222 by Robert Manuszewski in Main branch]
212 lines
5.7 KiB
C++
212 lines
5.7 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "UnrealHeaderTool.h"
|
|
#include "Classes.h"
|
|
#include "ParserClass.h"
|
|
#include "StringUtils.h"
|
|
|
|
namespace
|
|
{
|
|
/**
|
|
* Returns True if the given class name includes a valid Unreal prefix and matches based on the given class.
|
|
*
|
|
* @param InNameToCheck - Name w/ potential prefix to check
|
|
* @param OriginalClass - Class to check against
|
|
*/
|
|
bool ClassNameHasValidPrefix(const FString InNameToCheck, const FClass* OriginalClass)
|
|
{
|
|
bool bIsLabledDeprecated;
|
|
GetClassPrefix( InNameToCheck, bIsLabledDeprecated );
|
|
|
|
// If the class is labeled deprecated, don't try to resolve it during header generation, valid results can't be guaranteed.
|
|
if (bIsLabledDeprecated)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
const FString OriginalClassName = OriginalClass->GetNameWithPrefix();
|
|
|
|
bool bNamesMatch = (InNameToCheck == OriginalClassName);
|
|
|
|
if (!bNamesMatch)
|
|
{
|
|
//@TODO: UCREMOVAL: I/U interface hack - Ignoring prefixing for this call
|
|
if (OriginalClass->HasAnyClassFlags(CLASS_Interface))
|
|
{
|
|
bNamesMatch = InNameToCheck.Mid(1) == OriginalClassName.Mid(1);
|
|
}
|
|
}
|
|
|
|
return bNamesMatch;
|
|
}
|
|
}
|
|
|
|
FClasses::FClasses(UPackage* InPackage)
|
|
: UObjectClass((FClass*)UObject::StaticClass())
|
|
, ClassTree (UObjectClass)
|
|
{
|
|
for (UClass* Class : TObjectRange<UClass>())
|
|
{
|
|
if (Class->IsIn(InPackage))
|
|
{
|
|
ClassTree.AddClass(Class);
|
|
}
|
|
}
|
|
}
|
|
|
|
FClass* FClasses::GetRootClass() const
|
|
{
|
|
return UObjectClass;
|
|
}
|
|
|
|
bool FClasses::IsDependentOn(const FClass* Suspect, const FClass* Source) const
|
|
{
|
|
check(Suspect != Source);
|
|
TSet<const FClass*> VisitedDpendencies;
|
|
return IsDependentOn(Suspect, Source, VisitedDpendencies);
|
|
}
|
|
|
|
bool FClasses::IsDependentOn(const FClass* Suspect, const FClass* Source, TSet<const FClass*>& VisitedDpendencies) const
|
|
{
|
|
// Children are all implicitly dependent on their parent, that is, children require their parent
|
|
// to be compiled first therefore if the source is a parent of the suspect, the suspect is
|
|
// dependent on the source.
|
|
if (Suspect->IsChildOf(Source))
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// Prevent circular #includes from causing inifinite recursion
|
|
// Note that although it may mean there's a circular dependency somewhere, it does not
|
|
// necessarily mean it's the one we're looking for
|
|
if (VisitedDpendencies.Contains(Suspect))
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
VisitedDpendencies.Add(Suspect);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
FClass* FClasses::FindClass(const TCHAR* ClassName) const
|
|
{
|
|
check(ClassName);
|
|
|
|
UObject* ClassPackage = ANY_PACKAGE;
|
|
|
|
if (UClass* Result = FindObject<UClass>(ClassPackage, ClassName))
|
|
return (FClass*)Result;
|
|
|
|
if (UObjectRedirector* RenamedClassRedirector = FindObject<UObjectRedirector>(ClassPackage, ClassName))
|
|
return (FClass*)CastChecked<UClass>(RenamedClassRedirector->DestinationObject);
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
TArray<FClass*> FClasses::GetDerivedClasses(FClass* Parent) const
|
|
{
|
|
const FClassTree* ClassLeaf = ClassTree.FindNode(Parent);
|
|
TArray<const FClassTree*> ChildLeaves;
|
|
ClassLeaf->GetChildClasses(ChildLeaves);
|
|
|
|
TArray<FClass*> Result;
|
|
for (auto Node : ChildLeaves)
|
|
{
|
|
Result.Add((FClass*)Node->GetClass());
|
|
}
|
|
|
|
return Result;
|
|
}
|
|
|
|
FClass* FClasses::FindAnyClass(const TCHAR* ClassName) const
|
|
{
|
|
check(ClassName);
|
|
|
|
return (FClass*)FindObject<UClass>(ANY_PACKAGE, ClassName);
|
|
}
|
|
|
|
FClass* FClasses::FindScriptClass(const FString& InClassName) const
|
|
{
|
|
FString ErrorMsg;
|
|
return FindScriptClass(InClassName, ErrorMsg);
|
|
}
|
|
|
|
FClass* FClasses::FindScriptClassOrThrow(const FString& InClassName) const
|
|
{
|
|
FString ErrorMsg;
|
|
if (FClass* Result = FindScriptClass(InClassName, ErrorMsg))
|
|
{
|
|
return Result;
|
|
}
|
|
|
|
FError::Throwf(*ErrorMsg);
|
|
|
|
// Unreachable, but compiler will warn otherwise because FError::Throwf isn't declared noreturn
|
|
return 0;
|
|
}
|
|
|
|
FClass* FClasses::FindScriptClass(const FString& InClassName, FString& OutErrorMsg) const
|
|
{
|
|
// Strip the class name of its prefix and then do a search for the class
|
|
FString ClassNameStripped = GetClassNameWithPrefixRemoved(InClassName);
|
|
if (FClass* FoundClass = FindClass(*ClassNameStripped))
|
|
{
|
|
// If the class was found with the stripped class name, verify that the correct prefix was used and throw an error otherwise
|
|
if (!ClassNameHasValidPrefix(InClassName, FoundClass))
|
|
{
|
|
OutErrorMsg = FString::Printf(TEXT("Class '%s' has an incorrect prefix, expecting '%s'"), *InClassName, *FoundClass->GetNameWithPrefix());
|
|
return NULL;
|
|
}
|
|
|
|
return (FClass*)FoundClass;
|
|
}
|
|
|
|
// Couldn't find the class with a class name stripped of prefix (or a prefix was not found)
|
|
// See if the prefix was forgotten by trying to find the class with the given identifier
|
|
if (FClass* FoundClass = FindClass(*InClassName))
|
|
{
|
|
// If the class was found with the given identifier, the user forgot to use the correct Unreal prefix
|
|
OutErrorMsg = FString::Printf(TEXT("Class '%s' is missing a prefix, expecting '%s'"), *InClassName, *FoundClass->GetNameWithPrefix());
|
|
}
|
|
else
|
|
{
|
|
// If the class was still not found, it wasn't a valid identifier
|
|
OutErrorMsg = FString::Printf(TEXT("Class '%s' not found."), *InClassName );
|
|
}
|
|
|
|
return NULL;
|
|
}
|
|
|
|
TArray<FClass*> FClasses::GetClassesInPackage(const UPackage* InPackage) const
|
|
{
|
|
TArray<FClass*> Result;
|
|
Result.Add(UObjectClass);
|
|
|
|
// This cast is evil, but it'll work until we get TArray covariance. ;-)
|
|
ClassTree.GetChildClasses((TArray<UClass*>&)Result, [=](const UClass* Class) { return InPackage == ANY_PACKAGE || Class->GetOuter() == InPackage; }, true);
|
|
|
|
return Result;
|
|
}
|
|
|
|
#if WIP_UHT_REFACTOR
|
|
|
|
void FClasses::ChangeParentClass(FClass* Class)
|
|
{
|
|
ClassTree.ChangeParentClass(Class);
|
|
}
|
|
|
|
bool FClasses::ContainsClass(const FClass* Class) const
|
|
{
|
|
return !!ClassTree.FindNode(const_cast<FClass*>(Class));
|
|
}
|
|
|
|
void FClasses::Validate()
|
|
{
|
|
ClassTree.Validate();
|
|
}
|
|
|
|
#endif
|