TextureAtlasModule.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 "TextureAtlasSystemComponent.h"
  10. #ifdef TEXTUREATLAS_EDITOR
  11. #include "Editor/AtlasBuilderComponent.h"
  12. #endif
  13. #include <IGem.h>
  14. namespace TextureAtlasNamespace
  15. {
  16. class TextureAtlasModule
  17. : public CryHooksModule
  18. {
  19. public:
  20. AZ_RTTI(TextureAtlasModule, "{D3997F41-8117-4E0F-9BFE-937C4AE7E71F}", CryHooksModule);
  21. AZ_CLASS_ALLOCATOR(TextureAtlasModule, AZ::SystemAllocator);
  22. TextureAtlasModule()
  23. : CryHooksModule()
  24. {
  25. // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here.
  26. m_descriptors.insert(m_descriptors.end(), {
  27. TextureAtlasSystemComponent::CreateDescriptor(),
  28. #ifdef TEXTUREATLAS_EDITOR
  29. TextureAtlasBuilder::AtlasBuilderComponent::CreateDescriptor(), //builder component for texture atlas
  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<TextureAtlasSystemComponent>(),
  40. };
  41. }
  42. };
  43. }
  44. #if defined(O3DE_GEM_NAME)
  45. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), TextureAtlasNamespace::TextureAtlasModule)
  46. #else
  47. AZ_DECLARE_MODULE_CLASS(Gem_TextureAtlas, TextureAtlasNamespace::TextureAtlasModule)
  48. #endif