You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "StatsViewerPrivatePCH.h"
|
|
#include "LightingBuildInfo.h"
|
|
|
|
ULightingBuildInfo::ULightingBuildInfo(const class FPostConstructInitializeProperties& PCIP)
|
|
: Super(PCIP)
|
|
{
|
|
}
|
|
|
|
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("/") );
|
|
if ( NameIndex != INDEX_NONE )
|
|
{
|
|
LevelName = LevelName.RightChop( NameIndex + 1 );
|
|
}
|
|
}
|
|
} |