Просмотр исходного кода

Remove legacy renderer dependencies in LyShine and move LyShine headers to gem (#6049)

* Remove CryRenderer dependencies

Signed-off-by: abrmich <[email protected]>

* Fix non-unity compile error

Signed-off-by: abrmich <[email protected]>

* Remove ITexture.h reference

Signed-off-by: abrmich <[email protected]>

* Simple file moves from CryCommon to LyShine Gem

Signed-off-by: abrmich <[email protected]>

* More simple file moves from CryCommon to LyShine Gem

Signed-off-by: abrmich <[email protected]>

* Move more headers from CryCommon to LyShine Gem

Signed-off-by: abrmich <[email protected]>

* Add LyShine gem module as a build dependency to fix compile error in some gems

Signed-off-by: abrmich <[email protected]>
michabr 3 лет назад
Родитель
Сommit
4d5aad13d1
100 измененных файлов с 126 добавлено и 190 удалено
  1. 0 8
      Code/Editor/GameEngine.cpp
  2. 0 1
      Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake
  3. 0 77
      Code/Legacy/CryCommon/crycommon_files.cmake
  4. 0 7
      Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp
  5. 0 7
      Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
  6. 0 8
      Code/Legacy/CrySystem/System.cpp
  7. 0 7
      Code/Legacy/CrySystem/SystemInit.cpp
  8. 1 1
      Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.cpp
  9. 1 1
      Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.cpp
  10. 1 1
      Gems/LyShine/Code/Editor/EditorWindow.h
  11. 12 0
      Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp
  12. 7 0
      Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.h
  13. 0 1
      Gems/LyShine/Code/Editor/SpriteBorderEditorCommon.h
  14. 0 30
      Gems/LyShine/Code/Editor/ViewportWidget.cpp
  15. 0 0
      Gems/LyShine/Code/Include/LyShine/Animation/IUiAnimation.h
  16. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/Sprite/UiSpriteBus.h
  17. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/Tools/UiSystemToolsBus.h
  18. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiAnimateEntityBus.h
  19. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiAnimationBus.h
  20. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiButtonBus.h
  21. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiCanvasBus.h
  22. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiCanvasManagerBus.h
  23. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiCanvasUpdateNotificationBus.h
  24. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiCheckboxBus.h
  25. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiDraggableBus.h
  26. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiDropTargetBus.h
  27. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiDropdownBus.h
  28. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiDropdownOptionBus.h
  29. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiDynamicLayoutBus.h
  30. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiDynamicScrollBoxBus.h
  31. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiEditorBus.h
  32. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiEditorCanvasBus.h
  33. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiEditorChangeNotificationBus.h
  34. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiElementBus.h
  35. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiEntityContextBus.h
  36. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiFaderBus.h
  37. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiFlipbookAnimationBus.h
  38. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiGameEntityContextBus.h
  39. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiImageBus.h
  40. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiImageSequenceBus.h
  41. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiIndexableImageBus.h
  42. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiInitializationBus.h
  43. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiInteractableActionsBus.h
  44. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiInteractableBus.h
  45. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiInteractableStatesBus.h
  46. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiInteractionMaskBus.h
  47. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutBus.h
  48. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutCellBus.h
  49. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutCellDefaultBus.h
  50. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutColumnBus.h
  51. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutControllerBus.h
  52. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutFitterBus.h
  53. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutGridBus.h
  54. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutManagerBus.h
  55. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutRowBus.h
  56. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiMarkupButtonBus.h
  57. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiMaskBus.h
  58. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiNavigationBus.h
  59. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiParticleEmitterBus.h
  60. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiRadioButtonBus.h
  61. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiRadioButtonCommunicationBus.h
  62. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiRadioButtonGroupBus.h
  63. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiRadioButtonGroupCommunicationBus.h
  64. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiRenderBus.h
  65. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiRenderControlBus.h
  66. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiScrollBarBus.h
  67. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiScrollBoxBus.h
  68. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiScrollableBus.h
  69. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiScrollerBus.h
  70. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiSliderBus.h
  71. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiSpawnerBus.h
  72. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiSystemBus.h
  73. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiTextBus.h
  74. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiTextInputBus.h
  75. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiTooltipBus.h
  76. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiTooltipDataPopulatorBus.h
  77. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiTooltipDisplayBus.h
  78. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiTransform2dBus.h
  79. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiTransformBus.h
  80. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/UiVisualBus.h
  81. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/World/UiCanvasOnMeshBus.h
  82. 0 0
      Gems/LyShine/Code/Include/LyShine/Bus/World/UiCanvasRefBus.h
  83. 0 0
      Gems/LyShine/Code/Include/LyShine/IDraw2d.h
  84. 0 0
      Gems/LyShine/Code/Include/LyShine/ILyShine.h
  85. 2 7
      Gems/LyShine/Code/Include/LyShine/IRenderGraph.h
  86. 0 0
      Gems/LyShine/Code/Include/LyShine/ISprite.h
  87. 0 0
      Gems/LyShine/Code/Include/LyShine/UiBase.h
  88. 0 0
      Gems/LyShine/Code/Include/LyShine/UiComponentTypes.h
  89. 0 0
      Gems/LyShine/Code/Include/LyShine/UiEditorDLLBus.h
  90. 0 0
      Gems/LyShine/Code/Include/LyShine/UiEntityContext.h
  91. 0 0
      Gems/LyShine/Code/Include/LyShine/UiLayoutCellBase.h
  92. 53 0
      Gems/LyShine/Code/Include/LyShine/UiRenderFormats.h
  93. 0 0
      Gems/LyShine/Code/Include/LyShine/UiSerializeHelpers.h
  94. 0 1
      Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp
  95. 21 14
      Gems/LyShine/Code/Source/Draw2d.cpp
  96. 0 6
      Gems/LyShine/Code/Source/LyShine.cpp
  97. 0 9
      Gems/LyShine/Code/Source/LyShine.h
  98. 0 2
      Gems/LyShine/Code/Source/LyShineLoadScreen.cpp
  99. 22 2
      Gems/LyShine/Code/Source/LyShineSystemComponent.cpp
  100. 6 0
      Gems/LyShine/Code/Source/LyShineSystemComponent.h

+ 0 - 8
Code/Editor/GameEngine.cpp

@@ -35,7 +35,6 @@
 
 // CryCommon
 #include <CryCommon/INavigationSystem.h>
-#include <CryCommon/LyShine/ILyShine.h>
 #include <CryCommon/MainThreadRenderRequestBus.h>
 
 // Editor
@@ -595,13 +594,6 @@ void CGameEngine::SwitchToInEditor()
     // Enable accelerators.
     GetIEditor()->EnableAcceleratos(true);
 
-
-    // reset UI system
-    if (gEnv->pLyShine)
-    {
-        gEnv->pLyShine->Reset();
-    }
-
     // [Anton] - order changed, see comments for CGameEngine::SetSimulationMode
     //! Send event to switch out of game.
     GetIEditor()->GetObjectManager()->SendEvent(EVENT_OUTOFGAME);

+ 0 - 1
Code/Editor/Plugins/EditorCommon/editorcommon_files.cmake

@@ -13,7 +13,6 @@ set(FILES
     EditorCommonAPI.h
     ActionOutput.h
     ActionOutput.cpp
-    UiEditorDLLBus.h
     DockTitleBarWidget.cpp
     DockTitleBarWidget.h
     SaveUtilities/AsyncSaveRunner.h

+ 0 - 77
Code/Legacy/CryCommon/crycommon_files.cmake

@@ -100,85 +100,8 @@ set(FILES
     platform_impl.cpp
     Win32specific.h
     Win64specific.h
-    LyShine/IDraw2d.h
-    LyShine/ILyShine.h
-    LyShine/ISprite.h
-    LyShine/IRenderGraph.h
     LyShine/UiAssetTypes.h
-    LyShine/UiComponentTypes.h
-    LyShine/UiBase.h
-    LyShine/UiEntityContext.h
-    LyShine/UiLayoutCellBase.h
-    LyShine/UiSerializeHelpers.h
-    LyShine/Animation/IUiAnimation.h
-    LyShine/Bus/UiAnimateEntityBus.h
-    LyShine/Bus/UiAnimationBus.h
-    LyShine/Bus/UiButtonBus.h
-    LyShine/Bus/UiCanvasBus.h
-    LyShine/Bus/UiCanvasManagerBus.h
-    LyShine/Bus/UiCanvasUpdateNotificationBus.h
-    LyShine/Bus/UiCheckboxBus.h
     LyShine/Bus/UiCursorBus.h
-    LyShine/Bus/UiDraggableBus.h
-    LyShine/Bus/UiDropdownBus.h
-    LyShine/Bus/UiDropdownOptionBus.h
-    LyShine/Bus/UiDropTargetBus.h
-    LyShine/Bus/UiDynamicLayoutBus.h
-    LyShine/Bus/UiDynamicScrollBoxBus.h
-    LyShine/Bus/UiEditorBus.h
-    LyShine/Bus/UiEditorCanvasBus.h
-    LyShine/Bus/UiEditorChangeNotificationBus.h
-    LyShine/Bus/UiElementBus.h
-    LyShine/Bus/UiEntityContextBus.h
-    LyShine/Bus/UiFaderBus.h
-    LyShine/Bus/UiFlipbookAnimationBus.h
-    LyShine/Bus/UiGameEntityContextBus.h
-    LyShine/Bus/UiImageBus.h
-    LyShine/Bus/UiImageSequenceBus.h
-    LyShine/Bus/UiIndexableImageBus.h
-    LyShine/Bus/UiInitializationBus.h
-    LyShine/Bus/UiInteractableActionsBus.h
-    LyShine/Bus/UiInteractableBus.h
-    LyShine/Bus/UiInteractableStatesBus.h
-    LyShine/Bus/UiInteractionMaskBus.h
-    LyShine/Bus/UiLayoutBus.h
-    LyShine/Bus/UiLayoutCellBus.h
-    LyShine/Bus/UiLayoutCellDefaultBus.h
-    LyShine/Bus/UiLayoutColumnBus.h
-    LyShine/Bus/UiLayoutControllerBus.h
-    LyShine/Bus/UiLayoutFitterBus.h
-    LyShine/Bus/UiLayoutGridBus.h
-    LyShine/Bus/UiLayoutManagerBus.h
-    LyShine/Bus/UiLayoutRowBus.h
-    LyShine/Bus/UiMarkupButtonBus.h
-    LyShine/Bus/UiMaskBus.h
-    LyShine/Bus/UiNavigationBus.h
-    LyShine/Bus/UiParticleEmitterBus.h
-    LyShine/Bus/UiRadioButtonBus.h
-    LyShine/Bus/UiRadioButtonCommunicationBus.h
-    LyShine/Bus/UiRadioButtonGroupBus.h
-    LyShine/Bus/UiRadioButtonGroupCommunicationBus.h
-    LyShine/Bus/UiRenderBus.h
-    LyShine/Bus/UiRenderControlBus.h
-    LyShine/Bus/UiScrollableBus.h
-    LyShine/Bus/UiScrollBarBus.h
-    LyShine/Bus/UiScrollBoxBus.h
-    LyShine/Bus/UiScrollerBus.h
-    LyShine/Bus/UiSliderBus.h
-    LyShine/Bus/UiSpawnerBus.h
-    LyShine/Bus/UiSystemBus.h
-    LyShine/Bus/UiTextBus.h
-    LyShine/Bus/UiTextInputBus.h
-    LyShine/Bus/UiTooltipBus.h
-    LyShine/Bus/UiTooltipDataPopulatorBus.h
-    LyShine/Bus/UiTooltipDisplayBus.h
-    LyShine/Bus/UiTransform2dBus.h
-    LyShine/Bus/UiTransformBus.h
-    LyShine/Bus/UiVisualBus.h
-    LyShine/Bus/Sprite/UiSpriteBus.h
-    LyShine/Bus/World/UiCanvasOnMeshBus.h
-    LyShine/Bus/World/UiCanvasRefBus.h
-    LyShine/Bus/Tools/UiSystemToolsBus.h
     Maestro/Bus/EditorSequenceAgentComponentBus.h
     Maestro/Bus/EditorSequenceBus.h
     Maestro/Bus/EditorSequenceComponentBus.h

+ 0 - 7
Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp

@@ -27,7 +27,6 @@
 #include <AzFramework/Spawnable/RootSpawnableInterface.h>
 
 #include "MainThreadRenderRequestBus.h"
-#include <LyShine/ILyShine.h>
 #include <AzCore/Component/TickBus.h>
 #include <AzCore/IO/Path/Path.h>
 #include <AzCore/StringFunc/StringFunc.h>
@@ -882,12 +881,6 @@ void CLevelSystem::UnloadLevel()
     // Normally the GC step is triggered at the end of this method (by the ESYSTEM_EVENT_LEVEL_POST_UNLOAD event).
     EBUS_EVENT(AZ::ScriptSystemRequestBus, GarbageCollect);
 
-    // Perform level unload procedures for the LyShine UI system
-    if (gEnv && gEnv->pLyShine)
-    {
-        gEnv->pLyShine->OnLevelUnload();
-    }
-
     m_bLevelLoaded = false;
 
     [[maybe_unused]] const AZ::TimeMs unloadTimeMs = AZ::GetRealElapsedTimeMs() - beginTimeMs;

+ 0 - 7
Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp

@@ -19,7 +19,6 @@
 #include <AzFramework/Input/Buses/Requests/InputChannelRequestBus.h>
 
 #include "MainThreadRenderRequestBus.h"
-#include <LyShine/ILyShine.h>
 #include <AzCore/Component/TickBus.h>
 #include <AzCore/IO/Path/Path.h>
 #include <AzCore/Settings/SettingsRegistryVisitorUtils.h>
@@ -558,12 +557,6 @@ namespace LegacyLevelSystem
         // Normally the GC step is triggered at the end of this method (by the ESYSTEM_EVENT_LEVEL_POST_UNLOAD event).
         EBUS_EVENT(AZ::ScriptSystemRequestBus, GarbageCollect);
 
-        // Perform level unload procedures for the LyShine UI system
-        if (gEnv && gEnv->pLyShine)
-        {
-            gEnv->pLyShine->OnLevelUnload();
-        }
-
         m_bLevelLoaded = false;
 
         [[maybe_unused]] const AZ::TimeMs unloadTimeMs = AZ::GetRealElapsedTimeMs() - beginTimeMs;

+ 0 - 8
Code/Legacy/CrySystem/System.cpp

@@ -116,7 +116,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 #include <ILog.h>
 #include <IAudioSystem.h>
 #include <IProcess.h>
-#include <LyShine/ILyShine.h>
 
 #include <LoadScreenBus.h>
 
@@ -373,14 +372,7 @@ void CSystem::ShutDown()
         m_pSystemEventDispatcher->OnSystemEvent(ESYSTEM_EVENT_FULL_SHUTDOWN, 0, 0);
     }
 
-    if (gEnv && gEnv->pLyShine)
-    {
-        gEnv->pLyShine->Release();
-        gEnv->pLyShine = nullptr;
-    }
-
     SAFE_RELEASE(m_env.pMovieSystem);
-    SAFE_RELEASE(m_env.pLyShine);
     SAFE_RELEASE(m_env.pCryFont);
     if (m_env.pConsole)
     {

+ 0 - 7
Code/Legacy/CrySystem/SystemInit.cpp

@@ -52,7 +52,6 @@
 #include <AzFramework/Archive/ArchiveFileIO.h>
 
 #include <LoadScreenBus.h>
-#include <LyShine/Bus/UiSystemBus.h>
 #include <AzFramework/Logging/MissingAssetLogger.h>
 #include <AzFramework/Platform/PlatformDefaults.h>
 #include <AzCore/Interface/Interface.h>
@@ -77,7 +76,6 @@
 #include <IAudioSystem.h>
 #include <ICmdLine.h>
 #include <IProcess.h>
-#include <LyShine/ILyShine.h>
 
 #include <AzFramework/Archive/Archive.h>
 #include "XConsole.h"
@@ -1105,11 +1103,6 @@ AZ_POP_DISABLE_WARNING
 
         InlineInitializationProcessing("CSystem::Init Level System");
 
-        if (m_env.pLyShine)
-        {
-            m_env.pLyShine->PostInit();
-        }
-
         InlineInitializationProcessing("CSystem::Init InitLmbrAWS");
 
         // Az to Cry console binding

+ 1 - 1
Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.cpp

@@ -8,7 +8,7 @@
 
 
 #include "UiEditorAnimationBus.h"
-#include "UiEditorDLLBus.h"
+#include <LyShine/UiEditorDLLBus.h>
 #include "UiAnimViewAnimNode.h"
 #include "UiAnimViewTrack.h"
 #include "UiAnimViewSequence.h"

+ 1 - 1
Gems/LyShine/Code/Editor/Animation/UiAnimViewSequenceManager.cpp

@@ -8,7 +8,7 @@
 
 
 #include "UiEditorAnimationBus.h"
-#include "UiEditorDLLBus.h"
+#include <LyShine/UiEditorDLLBus.h>
 #include "UiAnimViewSequenceManager.h"
 #include "UiAnimViewUndo.h"
 #include "AnimationContext.h"

+ 1 - 1
Gems/LyShine/Code/Editor/EditorWindow.h

@@ -11,7 +11,7 @@
 #include "EditorCommon.h"
 
 #include "Animation/UiEditorAnimationBus.h"
-#include "UiEditorDLLBus.h"
+#include <LyShine/UiEditorDLLBus.h>
 #include "UiEditorInternalBus.h"
 #include "UiEditorEntityContext.h"
 #include "UiSliceManager.h"

+ 12 - 0
Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.cpp

@@ -103,6 +103,7 @@ namespace LyShineEditor
     void LyShineEditorSystemComponent::Activate()
     {
         AzToolsFramework::EditorEventsBus::Handler::BusConnect();
+        AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
         LyShine::LyShineRequestBus::Handler::BusConnect();
     }
 
@@ -118,6 +119,7 @@ namespace LyShineEditor
         }
         LyShine::LyShineRequestBus::Handler::BusDisconnect();
         AzToolsFramework::EditorEventsBus::Handler::BusDisconnect();
+        AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
     }
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -204,4 +206,14 @@ namespace LyShineEditor
             UiEditorDLLBus::Broadcast(&UiEditorDLLInterface::OpenSourceCanvasFile, absoluteName);
         }
     }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineEditorSystemComponent::OnStopPlayInEditor()
+    {
+        // reset UI system
+        if (gEnv->pLyShine)
+        {
+            gEnv->pLyShine->Reset();
+        }
+    }
 }

+ 7 - 0
Gems/LyShine/Code/Editor/LyShineEditorSystemComponent.h

@@ -11,6 +11,7 @@
 #include <AzCore/Component/Component.h>
 #include <AzToolsFramework/API/ToolsApplicationAPI.h>
 #include <AzToolsFramework/AssetBrowser/AssetBrowserBus.h>
+#include <AzToolsFramework/Entity/EditorEntityContextBus.h>
 #include <LyShine/LyShineBus.h>
 
 namespace LyShineEditor
@@ -18,6 +19,7 @@ namespace LyShineEditor
     class LyShineEditorSystemComponent
         : public AZ::Component
         , protected AzToolsFramework::EditorEvents::Bus::Handler
+        , protected AzToolsFramework::EditorEntityContextNotificationBus::Handler
         , protected AzToolsFramework::AssetBrowser::AssetBrowserInteractionNotificationBus::Handler
         , protected LyShine::LyShineRequestBus::Handler
     {
@@ -58,5 +60,10 @@ namespace LyShineEditor
         // LyShineRequestBus interface implementation
         void EditUICanvas(const AZStd::string_view& canvasPath) override;
         ////////////////////////////////////////////////////////////////////////
+
+        ////////////////////////////////////////////////////////////////////////
+        // EditorEntityContextNotificationBus
+        void OnStopPlayInEditor() override;
+        ////////////////////////////////////////////////////////////////////////
     };
 }

+ 0 - 1
Gems/LyShine/Code/Editor/SpriteBorderEditorCommon.h

@@ -10,7 +10,6 @@
 #include <vector> // required to be included before platform.h
 #include <platform.h>
 #include <ISystem.h>
-#include <IRenderer.h>
 #include <LyShine/ILyShine.h>
 #include <LyShine/ISprite.h>
 

+ 0 - 30
Gems/LyShine/Code/Editor/ViewportWidget.cpp

@@ -454,29 +454,6 @@ void ViewportWidget::contextMenuEvent(QContextMenuEvent* e)
     RenderViewportWidget::contextMenuEvent(e);
 }
 
-#ifdef LYSHINE_ATOM_TODO // check if still needed
-void ViewportWidget::HandleSignalRender([[maybe_unused]] const SRenderContext& context)
-{
-    // Called from QViewport when redrawing the viewport.
-    // Triggered from a QViewport resize event or from our call to QViewport::Update
-    if (m_canvasRenderIsEnabled)
-    {
-        gEnv->pRenderer->SetSrgbWrite(true);
-
-        UiEditorMode editorMode = m_editorWindow->GetEditorMode();
-
-        if (editorMode == UiEditorMode::Edit)
-        {
-            RenderEditMode();
-        }
-        else // if (editorMode == UiEditorMode::Preview)
-        {
-            RenderPreviewMode();
-        }
-    }
-}
-#endif
-
 void ViewportWidget::UserSelectionChanged(HierarchyItemRawPtrList* items)
 {
     Refresh();
@@ -999,13 +976,6 @@ void ViewportWidget::RenderEditMode()
         m_viewportInteraction->GetCanvasToViewportScale(),
         m_viewportInteraction->GetCanvasToViewportTranslation());
 
-#ifdef LYSHINE_ATOM_TODO
-    // clear the stencil buffer before rendering each canvas - required for masking
-    // NOTE: the FRT_CLEAR_IMMEDIATE is required since we will not be setting the render target
-    ColorF viewportBackgroundColor(0, 0, 0, 0); // if clearing color we want to set alpha to zero also
-    gEnv->pRenderer->ClearTargetsImmediately(FRT_CLEAR_STENCIL, viewportBackgroundColor);
-#endif
-
     // Set the target size of the canvas
     EBUS_EVENT_ID(canvasEntityId, UiCanvasBus, SetTargetCanvasSize, false, canvasSize);
 

+ 0 - 0
Code/Legacy/CryCommon/LyShine/Animation/IUiAnimation.h → Gems/LyShine/Code/Include/LyShine/Animation/IUiAnimation.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/Sprite/UiSpriteBus.h → Gems/LyShine/Code/Include/LyShine/Bus/Sprite/UiSpriteBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/Tools/UiSystemToolsBus.h → Gems/LyShine/Code/Include/LyShine/Bus/Tools/UiSystemToolsBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiAnimateEntityBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiAnimateEntityBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiAnimationBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiAnimationBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiButtonBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiButtonBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiCanvasBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiCanvasBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiCanvasManagerBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiCanvasManagerBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiCanvasUpdateNotificationBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiCanvasUpdateNotificationBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiCheckboxBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiCheckboxBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiDraggableBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiDraggableBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiDropTargetBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiDropTargetBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiDropdownBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiDropdownBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiDropdownOptionBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiDropdownOptionBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiDynamicLayoutBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiDynamicLayoutBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiDynamicScrollBoxBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiDynamicScrollBoxBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiEditorBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiEditorBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiEditorCanvasBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiEditorCanvasBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiEditorChangeNotificationBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiEditorChangeNotificationBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiElementBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiElementBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiEntityContextBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiEntityContextBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiFaderBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiFaderBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiFlipbookAnimationBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiFlipbookAnimationBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiGameEntityContextBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiGameEntityContextBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiImageBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiImageBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiImageSequenceBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiImageSequenceBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiIndexableImageBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiIndexableImageBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiInitializationBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiInitializationBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiInteractableActionsBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiInteractableActionsBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiInteractableBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiInteractableBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiInteractableStatesBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiInteractableStatesBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiInteractionMaskBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiInteractionMaskBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutCellBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutCellBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutCellDefaultBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutCellDefaultBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutColumnBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutColumnBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutControllerBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutControllerBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutFitterBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutFitterBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutGridBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutGridBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutManagerBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutManagerBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiLayoutRowBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiLayoutRowBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiMarkupButtonBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiMarkupButtonBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiMaskBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiMaskBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiNavigationBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiNavigationBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiParticleEmitterBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiParticleEmitterBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiRadioButtonBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiRadioButtonBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiRadioButtonCommunicationBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiRadioButtonCommunicationBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiRadioButtonGroupBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiRadioButtonGroupBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiRadioButtonGroupCommunicationBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiRadioButtonGroupCommunicationBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiRenderBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiRenderBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiRenderControlBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiRenderControlBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiScrollBarBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiScrollBarBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiScrollBoxBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiScrollBoxBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiScrollableBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiScrollableBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiScrollerBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiScrollerBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiSliderBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiSliderBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiSpawnerBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiSpawnerBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiSystemBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiSystemBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiTextBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiTextBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiTextInputBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiTextInputBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiTooltipBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiTooltipBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiTooltipDataPopulatorBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiTooltipDataPopulatorBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiTooltipDisplayBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiTooltipDisplayBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiTransform2dBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiTransform2dBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiTransformBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiTransformBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/UiVisualBus.h → Gems/LyShine/Code/Include/LyShine/Bus/UiVisualBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/World/UiCanvasOnMeshBus.h → Gems/LyShine/Code/Include/LyShine/Bus/World/UiCanvasOnMeshBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/Bus/World/UiCanvasRefBus.h → Gems/LyShine/Code/Include/LyShine/Bus/World/UiCanvasRefBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/IDraw2d.h → Gems/LyShine/Code/Include/LyShine/IDraw2d.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/ILyShine.h → Gems/LyShine/Code/Include/LyShine/ILyShine.h


+ 2 - 7
Code/Legacy/CryCommon/LyShine/IRenderGraph.h → Gems/LyShine/Code/Include/LyShine/IRenderGraph.h

@@ -7,9 +7,8 @@
  */
 #pragma once
 
-#include <IRenderer.h>
-#include <ITexture.h>
 #include <LyShine/UiBase.h>
+#include <LyShine/UiRenderFormats.h>
 
 namespace AZ
 {
@@ -42,10 +41,6 @@ namespace LyShine
         //! End the setup of a mask render node, this marks the end of adding child primitives
         virtual void EndMask() = 0;
 
-        //! Begin rendering to a texture
-        virtual void BeginRenderToTexture(int renderTargetHandle, SDepthTexture* renderTargetDepthSurface,
-            const AZ::Vector2& viewportTopLeft, const AZ::Vector2& viewportSize, const AZ::Color& clearColor) = 0;
-
         //! End rendering to a texture
         virtual void EndRenderToTexture() = 0;
 
@@ -53,7 +48,7 @@ namespace LyShine
         //! The graph handles the allocation of this DynUiPrimitive and deletes it when the graph is reset
         //! This can be used if the UI component doesn't want to own the storage of the primitive. Used infrequently,
         //! e.g. for the selection rect on a text component.
-        virtual DynUiPrimitive* GetDynamicQuadPrimitive(const AZ::Vector2* positions, uint32 packedColor) = 0;
+        virtual LyShine::UiPrimitive* GetDynamicQuadPrimitive(const AZ::Vector2* positions, uint32 packedColor) = 0;
 
         //---- Functions for supporting masking (used during creation of the graph, not rendering ) ----
 

+ 0 - 0
Code/Legacy/CryCommon/LyShine/ISprite.h → Gems/LyShine/Code/Include/LyShine/ISprite.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/UiBase.h → Gems/LyShine/Code/Include/LyShine/UiBase.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/UiComponentTypes.h → Gems/LyShine/Code/Include/LyShine/UiComponentTypes.h


+ 0 - 0
Code/Editor/Plugins/EditorCommon/UiEditorDLLBus.h → Gems/LyShine/Code/Include/LyShine/UiEditorDLLBus.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/UiEntityContext.h → Gems/LyShine/Code/Include/LyShine/UiEntityContext.h


+ 0 - 0
Code/Legacy/CryCommon/LyShine/UiLayoutCellBase.h → Gems/LyShine/Code/Include/LyShine/UiLayoutCellBase.h


+ 53 - 0
Gems/LyShine/Code/Include/LyShine/UiRenderFormats.h

@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) Contributors to the Open 3D Engine Project.
+ * For complete copyright and license terms please see the LICENSE at the root of this distribution.
+ *
+ * SPDX-License-Identifier: Apache-2.0 OR MIT
+ *
+ */
+#pragma once
+
+#include <AzCore/std/containers/intrusive_slist.h>
+
+namespace LyShine
+{
+    struct UCol
+    {
+        union
+        {
+            uint32 dcolor;
+            uint8  bcolor[4];
+
+            struct
+            {
+                uint8 b, g, r, a;
+            };
+            struct
+            {
+                uint8 z, y, x, w;
+            };
+        };
+    };
+
+    struct UiPrimitiveVertex
+    {
+        Vec2 xy;
+        UCol color;
+        Vec2 st;
+        uint8 texIndex;
+        uint8 texHasColorChannel;
+        uint8 texIndex2;
+        uint8 pad;
+    };
+
+    using UiIndice = AZ::u16;
+
+    struct UiPrimitive : public AZStd::intrusive_slist_node<UiPrimitive>
+    {
+        UiPrimitiveVertex* m_vertices = nullptr;
+        uint16* m_indices = nullptr;
+        int m_numVertices = 0;
+        int m_numIndices = 0;
+    };
+    using UiPrimitiveList = AZStd::intrusive_slist<UiPrimitive, AZStd::slist_base_hook<UiPrimitive>>;
+};

+ 0 - 0
Code/Legacy/CryCommon/LyShine/UiSerializeHelpers.h → Gems/LyShine/Code/Include/LyShine/UiSerializeHelpers.h


+ 0 - 1
Gems/LyShine/Code/Source/Animation/UiAnimationSystem.cpp

@@ -22,7 +22,6 @@
 #include <ISystem.h>
 #include <ILog.h>
 #include <IConsole.h>
-#include <IRenderer.h>
 
 //////////////////////////////////////////////////////////////////////////
 namespace

+ 21 - 14
Gems/LyShine/Code/Source/Draw2d.cpp

@@ -5,9 +5,9 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
-#include <IRenderer.h> // for SVF_P3F_C4B_T2F which will be removed in a coming PR
 
 #include <LyShine/Draw2d.h>
+#include <LyShine/UiRenderFormats.h>
 #include "LyShinePassDataBus.h"
 
 #include <AzCore/Math/Matrix3x3.h>
@@ -22,15 +22,23 @@
 #include <Atom/RPI.Public/RPIUtils.h>
 #include <Atom/RPI.Public/ViewportContextBus.h>
 
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// LOCAL STATIC FUNCTIONS
-////////////////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Color to u32 => 0xAARRGGBB
-static AZ::u32 PackARGB8888(const AZ::Color& color)
+namespace
 {
-    return (color.GetA8() << 24) | (color.GetR8() << 16) | (color.GetG8() << 8) | color.GetB8();
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    // Color to u32 => 0xAARRGGBB
+    AZ::u32 PackARGB8888(const AZ::Color& color)
+    {
+        return (color.GetA8() << 24) | (color.GetR8() << 16) | (color.GetG8() << 8) | color.GetB8();
+    }
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////
+    // Vertex format for Dynamic Draw Context
+    struct Draw2dVertex
+    {
+        Vec3 xyz;
+        LyShine::UCol color;
+        Vec2 st;
+    };
 }
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -739,7 +747,7 @@ void CDraw2d::DeferredQuad::Draw(AZ::RHI::Ptr<AZ::RPI::DynamicDrawContext> dynam
 
     const float z = 1.0f;   // depth test disabled, if writing Z this will write at far plane
 
-    SVF_P3F_C4B_T2F vertices[NUM_VERTS];
+    Draw2dVertex vertices[NUM_VERTS];
     const int vertIndex[NUM_VERTS] = {
         0, 1, 3, 3, 1, 2
     };
@@ -804,7 +812,7 @@ void CDraw2d::DeferredLine::Draw(AZ::RHI::Ptr<AZ::RPI::DynamicDrawContext> dynam
 
     const int32 NUM_VERTS = 2;
 
-    SVF_P3F_C4B_T2F vertices[NUM_VERTS];
+    Draw2dVertex vertices[NUM_VERTS];
 
     for (int i = 0; i < NUM_VERTS; ++i)
     {
@@ -857,9 +865,9 @@ void CDraw2d::DeferredRectOutline::Draw(AZ::RHI::Ptr<AZ::RPI::DynamicDrawContext
     AZ::RPI::ViewportContextPtr viewportContext) const
 {
     // Create the 8 verts in the right vertex format for the dynamic draw context
-    SVF_P3F_C4B_T2F vertices[NUM_VERTS];
+    Draw2dVertex vertices[NUM_VERTS];
     const float z = 1.0f;   // depth test disabled, if writing Z this will write at far plane
-    uint32 packedColor = (m_color.GetA8() << 24) | (m_color.GetR8() << 16) | (m_color.GetG8() << 8) | m_color.GetB8();
+    uint32 packedColor = PackARGB8888(m_color);
     for (int i = 0; i < NUM_VERTS; ++i)
     {
         vertices[i].xyz = Vec3(m_verts2d[i].GetX(), m_verts2d[i].GetY(), z);
@@ -924,7 +932,6 @@ void CDraw2d::DeferredRectOutline::Draw(AZ::RHI::Ptr<AZ::RPI::DynamicDrawContext
     // Add the primitive to the dynamic draw context for drawing
     dynamicDraw->SetPrimitiveType(AZ::RHI::PrimitiveTopology::TriangleList);
     dynamicDraw->DrawIndexed(vertices, NUM_VERTS, indices, NUM_INDICES, AZ::RHI::IndexFormat::Uint16, drawSrg);
-
 }
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////

+ 0 - 6
Gems/LyShine/Code/Source/LyShine.cpp

@@ -520,12 +520,6 @@ void CLyShine::OnLoadScreenUnloaded()
     m_uiCanvasManager->OnLoadScreenUnloaded();
 }
 
-////////////////////////////////////////////////////////////////////////////////////////////////////
-void CLyShine::OnDebugDraw()
-{
-    LyShineDebug::RenderDebug();
-}
-
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 void CLyShine::IncrementVisibleCounter()
 {

+ 0 - 9
Gems/LyShine/Code/Source/LyShine.h

@@ -7,7 +7,6 @@
  */
 #pragma once
 
-#include <IRenderer.h>
 #include <LyShine/ILyShine.h>
 #include <LyShine/Bus/UiCursorBus.h>
 #include <AzCore/Math/Vector2.h>
@@ -38,7 +37,6 @@ struct IConsoleCmdArgs;
 //! CLyShine is the full implementation of the ILyShine interface
 class CLyShine
     : public ILyShine
-    , public IRenderDebugListener
     , public UiCursorBus::Handler
     , public AzFramework::InputChannelEventListener
     , public AzFramework::InputTextEventListener
@@ -88,13 +86,6 @@ public:
 
     // ~ILyShine
 
-    // IRenderDebugListener
-
-    //! Renders any debug displays currently enabled for the UI system
-    void OnDebugDraw() override;
-
-    // ~IRenderDebugListener
-
     // UiCursorInterface
     void IncrementVisibleCounter() override;
     void DecrementVisibleCounter() override;

+ 0 - 2
Gems/LyShine/Code/Source/LyShineLoadScreen.cpp

@@ -10,8 +10,6 @@
 
 #if AZ_LOADSCREENCOMPONENT_ENABLED
 
-#include <IRenderer.h>
-
 #include <AzCore/Serialization/SerializeContext.h>
 #include <AzCore/Component/ComponentApplicationBus.h>
 #include <LyShine/Bus/UiCanvasBus.h>

+ 22 - 2
Gems/LyShine/Code/Source/LyShineSystemComponent.cpp

@@ -377,7 +377,7 @@ namespace LyShine
     }
 
     ///////////////////////////////////////////////////////////////////////////////////////////////
-    void LyShineSystemComponent::OnCrySystemInitialized([[maybe_unused]] ISystem& system, [[maybe_unused]] const SSystemInitParams& startupParams)
+    void LyShineSystemComponent::OnCrySystemInitialized(ISystem& system, [[maybe_unused]] const SSystemInitParams& startupParams)
     {
 #if !defined(AZ_MONOLITHIC_BUILD)
         // When module is linked dynamically, we must set our gEnv pointer.
@@ -387,16 +387,36 @@ namespace LyShine
         m_pLyShine = new CLyShine(gEnv->pSystem);
         gEnv->pLyShine = m_pLyShine;
 
+        system.GetILevelSystem()->AddListener(this);
+
         BroadcastCursorImagePathname();
+
+        if (gEnv->pLyShine)
+        {
+            gEnv->pLyShine->PostInit();
+        }
     }
 
-    void LyShineSystemComponent::OnCrySystemShutdown([[maybe_unused]] ISystem& system)
+    ///////////////////////////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::OnCrySystemShutdown(ISystem& system)
     {
+        system.GetILevelSystem()->RemoveListener(this);
+
         gEnv->pLyShine = nullptr;
         delete m_pLyShine;
         m_pLyShine = nullptr;       
     }
 
+    ////////////////////////////////////////////////////////////////////////
+    void LyShineSystemComponent::OnUnloadComplete([[maybe_unused]] const char* levelName)
+    {
+        // Perform level unload procedures for the LyShine UI system
+        if (gEnv && gEnv->pLyShine)
+        {
+            gEnv->pLyShine->OnLevelUnload();
+        }
+    }
+
     ////////////////////////////////////////////////////////////////////////////////////////////////////
     void LyShineSystemComponent::BroadcastCursorImagePathname()
     {

+ 6 - 0
Gems/LyShine/Code/Source/LyShineSystemComponent.h

@@ -13,6 +13,7 @@
 #include <AzFramework/InGameUI/UiFrameworkBus.h>
 
 #include <LmbrCentral/Rendering/MaterialAsset.h>
+#include <ILevelSystem.h>
 
 #include <LyShine/Bus/UiSystemBus.h>
 #include <LyShine/Bus/UiCanvasManagerBus.h>
@@ -37,6 +38,7 @@ namespace LyShine
         , protected LyShineAllocatorScope
         , protected UiFrameworkBus::Handler
         , protected CrySystemEventBus::Handler
+        , public ILevelSystemListener
     {
     public:
         AZ_COMPONENT(LyShineSystemComponent, lyShineSystemComponentUuid);
@@ -92,6 +94,10 @@ namespace LyShine
         void OnCrySystemShutdown(ISystem&) override;
         ////////////////////////////////////////////////////////////////////////////
 
+        ////////////////////////////////////////////////////////////////////////
+        // ILevelSystemListener interface implementation
+        void OnUnloadComplete(const char* levelName) override;
+
         void BroadcastCursorImagePathname();
 
 #if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS)

Некоторые файлы не были показаны из-за большого количества измененных файлов