You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb none #ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904 #ROBOMERGE-BOT: (v613-10869866) [CL 10870586 by ryan durand in Main branch]
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "LightingBuildInfo.h"
|
|
#include "UObject/Package.h"
|
|
#include "GameFramework/Actor.h"
|
|
#include "Model.h"
|
|
#include "Lightmass/LightmappedSurfaceCollection.h"
|
|
|
|
ULightingBuildInfo::ULightingBuildInfo(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
}
|
|
|
|
void ULightingBuildInfo::Set( TWeakObjectPtr<UObject> InObject, double InLightingTime, float InUnmappedTexelsPercentage, int32 InUnmappedTexelsMemory, int32 InTotalTexelMemory )
|
|
{
|
|
Object = InObject;
|
|
LightingTime = (float)InLightingTime;
|
|
UnmappedTexelsPercentage = InUnmappedTexelsPercentage;
|
|
UnmappedTexelsMemory = (float)InUnmappedTexelsMemory / 1024.0f;
|
|
TotalTexelMemory = (float)InTotalTexelMemory / 1024.0f;
|
|
|
|
UpdateNames();
|
|
}
|
|
|
|
void ULightingBuildInfo::UpdateNames()
|
|
{
|
|
if( Object.IsValid() )
|
|
{
|
|
AActor* Actor = Cast<AActor>(Object.Get());
|
|
ULightmappedSurfaceCollection* SurfaceCollection = Cast<ULightmappedSurfaceCollection>(Object.Get());
|
|
|
|
if (SurfaceCollection && SurfaceCollection->SourceModel)
|
|
{
|
|
LevelName = SurfaceCollection->SourceModel->GetOutermost()->GetName();
|
|
}
|
|
else if (Actor)
|
|
{
|
|
LevelName = Actor->GetLevel()->GetOutermost()->GetName();
|
|
}
|
|
else
|
|
{
|
|
LevelName = Object->GetOutermost()->GetName();
|
|
}
|
|
|
|
const int32 NameIndex = LevelName.Find( TEXT("/"), ESearchCase::CaseSensitive);
|
|
if ( NameIndex != INDEX_NONE )
|
|
{
|
|
LevelName.RightChopInline( NameIndex + 1, false );
|
|
}
|
|
}
|
|
}
|