Ejemplo n.º 1
0
	/** IModuleInterface implementation */
	virtual void StartupModule() override
	{
		bool bLoadSuccessful = true;
		// now attempt to load the delay loaded DLLs
		if (LoadLibraryW(TEXT("shlwapi.dll")) == NULL)
		{
			UE_LOG(LogWindowsMoviePlayer, Warning, TEXT("Could not load shlwapi.dll") );
			bLoadSuccessful = false;
		}
		if (LoadLibraryW(TEXT("mf.dll")) == NULL)
		{
			UE_LOG(LogWindowsMoviePlayer, Warning, TEXT("Could not load mf.dll"));
			bLoadSuccessful = false;
		}
		if (LoadLibraryW(TEXT("mfplat.dll")) == NULL)
		{
			UE_LOG(LogWindowsMoviePlayer, Warning, TEXT("Could not load mfplat.dll"));
			bLoadSuccessful = false;
		}
		if (LoadLibraryW(TEXT("mfplay.dll")) == NULL)
		{
			UE_LOG(LogWindowsMoviePlayer, Warning, TEXT("Could not load mfplay.dll"));
			bLoadSuccessful = false;
		}

		if( bLoadSuccessful )
		{
			HRESULT Hr = MFStartup(MF_VERSION);
			check(SUCCEEDED(Hr));

			MovieStreamer = MakeShareable(new FMediaFoundationMovieStreamer);
			GetMoviePlayer()->RegisterMovieStreamer(MovieStreamer);
		}
	}
void FLoadingScreenModule::BeginLoadingScreen(const FLoadingScreenDescription& ScreenDescription)
{
	FLoadingScreenAttributes LoadingScreen;
	LoadingScreen.MinimumLoadingScreenDisplayTime = ScreenDescription.MinimumLoadingScreenDisplayTime;
	LoadingScreen.bAutoCompleteWhenLoadingCompletes = ScreenDescription.bAutoCompleteWhenLoadingCompletes;
	LoadingScreen.bMoviesAreSkippable = ScreenDescription.bMoviesAreSkippable;
	LoadingScreen.bWaitForManualStop = ScreenDescription.bWaitForManualStop;

	//TODO if overridden...

	if ( ScreenDescription.IsValid() )
	{
		LoadingScreen.MoviePaths = ScreenDescription.MoviePaths;

		if ( ScreenDescription.bShowUIOverlay )
		{
			LoadingScreen.WidgetLoadingScreen = SNew(SSimpleLoadingScreen, ScreenDescription);
		}
	}
	else
	{
		LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
	}
	
	GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
}
	/** IModuleInterface implementation */
	virtual void StartupModule() override
	{
		bool bLoadSuccessful = true;
		// now attempt to load the delay loaded DLLs
		if (!LoadMediaLibrary(TEXT("shlwapi.dll")))
		{
			bLoadSuccessful = false;
		}
		if (!LoadMediaLibrary(TEXT("mf.dll")))
		{
			bLoadSuccessful = false;
		}
		if (!LoadMediaLibrary(TEXT("mfplat.dll")))
		{
			bLoadSuccessful = false;
		}
		if (!LoadMediaLibrary(TEXT("mfplay.dll")))
		{
			bLoadSuccessful = false;
		}

		if( bLoadSuccessful )
		{
			HRESULT Hr = MFStartup(MF_VERSION);
			check(SUCCEEDED(Hr));

			MovieStreamer = MakeShareable(new FMediaFoundationMovieStreamer);
			GetMoviePlayer()->RegisterMovieStreamer(MovieStreamer);
		}
	}
void FLoadingScreenModule::HandlePreLoadMap()
{
	//if ( GEngine && GEngine->IsInitialized() )
	{
		const ULoadingScreenSettings* Settings = GetDefault<ULoadingScreenSettings>();
		BeginLoadingScreen(Settings->DefaultScreen);
	}

	// workaround for PreLoadMap call order issue
	GetMoviePlayer()->PlayMovie();
}