3
0

SplashScreenFeatureProcessor.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <SplashScreen/SplashScreenFeatureProcessor.h>
  9. #include <Atom/RPI.Public/RPIUtils.h>
  10. #include <AzCore/Settings/SettingsRegistryImpl.h>
  11. namespace AZ::Render
  12. {
  13. void SplashScreenFeatureProcessor::Reflect(AZ::ReflectContext* context)
  14. {
  15. if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
  16. {
  17. serializeContext
  18. ->Class<SplashScreenFeatureProcessor, FeatureProcessor>()
  19. ->Version(1);
  20. }
  21. }
  22. void SplashScreenFeatureProcessor::AddRenderPasses(RPI::RenderPipeline* renderPipeline)
  23. {
  24. AZ::ApplicationTypeQuery appType;
  25. AZ::ComponentApplicationBus::Broadcast(&AZ::ComponentApplicationBus::Events::QueryApplicationType, appType);
  26. if (!appType.IsGame())
  27. {
  28. return;
  29. }
  30. bool enable = false;
  31. auto settingsRegistry = AZ::SettingsRegistry::Get();
  32. static const AZStd::string setregPath = "/O3DE/Atom/Feature/SplashScreenEnable";
  33. if (settingsRegistry && settingsRegistry->GetObject(&enable, azrtti_typeid(enable), setregPath.c_str()))
  34. {
  35. if (enable)
  36. {
  37. AddPassRequestToRenderPipeline(renderPipeline, "Passes/SplashScreenPassRequest.azasset", "CopyToSwapChain", true);
  38. }
  39. }
  40. }
  41. } // namespace AZ::Render