RealtimeStyleTransferRuntime/Source/LyraGame/System/LyraAssetManagerStartupJob.cpp

30 lines
973 B
C++
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "LyraAssetManagerStartupJob.h"
2022-09-13 07:18:28 +00:00
#include "HAL/Platform.h"
#include "Logging/LogCategory.h"
#include "Logging/LogMacros.h"
2022-05-23 18:41:30 +00:00
#include "LyraLogChannels.h"
2022-09-13 07:18:28 +00:00
#include "Trace/Detail/Channel.h"
2022-05-23 18:41:30 +00:00
TSharedPtr<FStreamableHandle> FLyraAssetManagerStartupJob::DoJob() const
{
const double JobStartTime = FPlatformTime::Seconds();
TSharedPtr<FStreamableHandle> Handle;
UE_LOG(LogLyra, Display, TEXT("Startup job \"%s\" starting"), *JobName);
JobFunc(*this, Handle);
if (Handle.IsValid())
{
Handle->BindUpdateDelegate(FStreamableUpdateDelegate::CreateRaw(this, &FLyraAssetManagerStartupJob::UpdateSubstepProgressFromStreamable));
Handle->WaitUntilComplete(0.0f, false);
Handle->BindUpdateDelegate(FStreamableUpdateDelegate());
}
UE_LOG(LogLyra, Display, TEXT("Startup job \"%s\" took %.2f seconds to complete"), *JobName, FPlatformTime::Seconds() - JobStartTime);
return Handle;
}