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-OWNER: ryan.durand #ROBOMERGE-AUTHOR: ryan.durand #ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900 #ROBOMERGE-BOT: (v613-10869866) [CL 10870549 by ryan durand in Main branch]
42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "IXRLoadingScreen.h"
|
|
#include "IXRTrackingSystem.h"
|
|
#include "EngineGlobals.h"
|
|
#include "Engine/Engine.h"
|
|
|
|
|
|
void IXRLoadingScreen::ShowLoadingScreen_Compat(bool bShow, FTexture2DRHIRef Texture, const FVector& Offset, const FVector2D& Scale)
|
|
{
|
|
// Backwards compatibility with IStereoLayers::ShowSplashScreen
|
|
IXRLoadingScreen* LoadingScreen = GEngine && GEngine->XRSystem.IsValid()? GEngine->XRSystem->GetLoadingScreen() : nullptr;
|
|
if (LoadingScreen)
|
|
{
|
|
if (bShow)
|
|
{
|
|
// Any texture passed in will override all splashes set through the IXRLoadingScreen interface,
|
|
// otherwise this function only calls Show/HideLoadingScreen.
|
|
if (Texture.IsValid())
|
|
{
|
|
IXRLoadingScreen::FSplashDesc Splash;
|
|
const FIntPoint TextureSize = Texture->GetSizeXY();
|
|
const float InvAspectRatio = (TextureSize.X > 0) ? float(TextureSize.Y) / float(TextureSize.X) : 1.0f;
|
|
|
|
Splash.Texture = Texture;
|
|
Splash.bIgnoreAlpha = true;
|
|
Splash.Transform = FTransform(FVector(5.0f, 0.0f, 1.0f) + Offset * 0.01f);
|
|
Splash.QuadSize = FVector2D(8.0f, 8.0f*InvAspectRatio) * Scale;
|
|
|
|
LoadingScreen->ClearSplashes();
|
|
LoadingScreen->AddSplash(Splash);
|
|
}
|
|
LoadingScreen->ShowLoadingScreen();
|
|
}
|
|
else
|
|
{
|
|
LoadingScreen->HideLoadingScreen();
|
|
}
|
|
}
|
|
|
|
}
|