CommonModule.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 <AzCore/Memory/SystemAllocator.h>
  9. #include <AzCore/RTTI/RTTI.h>
  10. #include <AzCore/Module/Module.h>
  11. #include <CommonSystemComponent.h>
  12. #include <FrameCaptureSystemComponent.h>
  13. #include <ProfilingCaptureSystemComponent.h>
  14. #include <ImGui/ImGuiSystemComponent.h>
  15. #include <SkinnedMesh/SkinnedMeshSystemComponent.h>
  16. // Core Lights
  17. #include <CoreLights/CoreLightsSystemComponent.h>
  18. #ifdef ATOM_FEATURE_COMMON_EDITOR
  19. #include <EditorCommonSystemComponent.h>
  20. #include <Material/MaterialConverterSystemComponent.h>
  21. #endif
  22. namespace AZ
  23. {
  24. namespace Render
  25. {
  26. class CommonModule
  27. : public AZ::Module
  28. {
  29. public:
  30. AZ_RTTI(CommonModule, "{116699A4-176B-41BE-8D07-77590319687B}", AZ::Module);
  31. AZ_CLASS_ALLOCATOR(CommonModule, AZ::SystemAllocator);
  32. CommonModule()
  33. : AZ::Module()
  34. {
  35. m_descriptors.insert(m_descriptors.end(), {
  36. CoreLightsSystemComponent::CreateDescriptor(),
  37. CommonSystemComponent::CreateDescriptor(),
  38. FrameCaptureSystemComponent::CreateDescriptor(),
  39. ProfilingCaptureSystemComponent::CreateDescriptor(),
  40. ImGuiSystemComponent::CreateDescriptor(),
  41. SkinnedMeshSystemComponent::CreateDescriptor(),
  42. // post effects
  43. #ifdef ATOM_FEATURE_COMMON_EDITOR
  44. EditorCommonSystemComponent::CreateDescriptor(),
  45. MaterialConverterSystemComponent::CreateDescriptor(),
  46. #endif
  47. });
  48. }
  49. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  50. {
  51. return AZ::ComponentTypeList{
  52. azrtti_typeid<CommonSystemComponent>(),
  53. azrtti_typeid<FrameCaptureSystemComponent>(),
  54. azrtti_typeid<ProfilingCaptureSystemComponent>(),
  55. azrtti_typeid<CoreLightsSystemComponent>(),
  56. azrtti_typeid<ImGuiSystemComponent>(),
  57. azrtti_typeid<SkinnedMeshSystemComponent>(),
  58. #ifdef ATOM_FEATURE_COMMON_EDITOR
  59. azrtti_typeid<EditorCommonSystemComponent>(),
  60. #endif
  61. };
  62. }
  63. };
  64. } // namespace Render
  65. } // namespace AZ
  66. #if O3DE_HEADLESS_SERVER
  67. #if defined(O3DE_GEM_NAME)
  68. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Headless), AZ::Render::CommonModule)
  69. #else
  70. AZ_DECLARE_MODULE_CLASS(Gem_Atom_Feature_Common_Headless, AZ::Render::CommonModule)
  71. #endif
  72. #else
  73. #if defined(O3DE_GEM_NAME)
  74. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), AZ::Render::CommonModule)
  75. #else
  76. AZ_DECLARE_MODULE_CLASS(Gem_Atom_Feature_Common, AZ::Render::CommonModule)
  77. #endif
  78. #endif // O3DE_HEADLESS_SERVER