Module.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "SystemComponent.h"
  10. #ifdef PHYSXDEBUG_GEM_EDITOR
  11. #include "EditorSystemComponent.h"
  12. #endif
  13. #include <IGem.h>
  14. namespace PhysXDebug
  15. {
  16. class PhysXDebugModule
  17. : public CryHooksModule
  18. {
  19. public:
  20. AZ_RTTI(PhysXDebugModule, "{7C9CB91D-D7D7-4362-9FE8-E4D61B6A5113}", CryHooksModule);
  21. AZ_CLASS_ALLOCATOR(PhysXDebugModule, AZ::SystemAllocator);
  22. PhysXDebugModule()
  23. : CryHooksModule()
  24. {
  25. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  26. m_descriptors.insert(m_descriptors.end(), {
  27. SystemComponent::CreateDescriptor(),
  28. #ifdef PHYSXDEBUG_GEM_EDITOR
  29. EditorSystemComponent::CreateDescriptor()
  30. #endif
  31. });
  32. }
  33. /**
  34. * Add required SystemComponents to the SystemEntity.
  35. */
  36. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  37. {
  38. return AZ::ComponentTypeList{
  39. azrtti_typeid<SystemComponent>(),
  40. #ifdef PHYSXDEBUG_GEM_EDITOR
  41. azrtti_typeid<EditorSystemComponent>(),
  42. #endif
  43. };
  44. }
  45. };
  46. }
  47. #if defined(O3DE_GEM_NAME)
  48. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), PhysXDebug::PhysXDebugModule)
  49. #else
  50. AZ_DECLARE_MODULE_CLASS(Gem_PhysXDebug, PhysXDebug::PhysXDebugModule)
  51. #endif