From 421e7cb88b4a53fa6947152f72817d6e6fcd118c Mon Sep 17 00:00:00 2001 From: michabr <82236305+michabr@users.noreply.github.com> Date: Fri, 2 Jul 2021 13:54:44 -0700 Subject: [PATCH] Re-add default cursor image as an optional asset (#1831) Signed-off-by: abrmich --- Gems/LyShine/Assets/LyShine_Dependencies.xml | 8 +-- .../Button_Sliced_Normal.tif.exportsettings | 1 - .../Assets/Textures/Cursor_Default.tif | 3 + .../Textures/Cursor_Default.tif.assetinfo | 69 +++++++++++++++++++ Gems/LyShine/Assets/seedList.seed | 18 +---- Gems/LyShine/Code/Source/Draw2d.cpp | 7 +- .../Code/Source/LyShineSystemComponent.cpp | 2 +- 7 files changed, 77 insertions(+), 31 deletions(-) delete mode 100644 Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings create mode 100644 Gems/LyShine/Assets/Textures/Cursor_Default.tif create mode 100644 Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo diff --git a/Gems/LyShine/Assets/LyShine_Dependencies.xml b/Gems/LyShine/Assets/LyShine_Dependencies.xml index 83c63cfbd4..6297f55ffd 100644 --- a/Gems/LyShine/Assets/LyShine_Dependencies.xml +++ b/Gems/LyShine/Assets/LyShine_Dependencies.xml @@ -1,9 +1,3 @@ - - - - - - - + diff --git a/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings b/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings deleted file mode 100644 index 1415bea891..0000000000 --- a/Gems/LyShine/Assets/Textures/Basic/Button_Sliced_Normal.tif.exportsettings +++ /dev/null @@ -1 +0,0 @@ -/autooptimizefile=0 /dns=1 /preset=ReferenceImage_Linear /reduce=0 /ser=0 diff --git a/Gems/LyShine/Assets/Textures/Cursor_Default.tif b/Gems/LyShine/Assets/Textures/Cursor_Default.tif new file mode 100644 index 0000000000..01e65389c3 --- /dev/null +++ b/Gems/LyShine/Assets/Textures/Cursor_Default.tif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a268774eb6d4d4590960c28edbf2a35d3fb7a73caab38d9ad15812c3df1c0c02 +size 4529 diff --git a/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo b/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo new file mode 100644 index 0000000000..47b628d60a --- /dev/null +++ b/Gems/LyShine/Assets/Textures/Cursor_Default.tif.assetinfo @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gems/LyShine/Assets/seedList.seed b/Gems/LyShine/Assets/seedList.seed index f42f2a81bc..499469bd63 100644 --- a/Gems/LyShine/Assets/seedList.seed +++ b/Gems/LyShine/Assets/seedList.seed @@ -1,28 +1,12 @@ - - - - - - - - - - - - - - - - - + diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index c18dd6a4c4..b27d030bd6 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -536,22 +536,19 @@ AZ::Vector2 CDraw2d::Align(AZ::Vector2 position, AZ::Vector2 size, //////////////////////////////////////////////////////////////////////////////////////////////////// AZ::Data::Instance CDraw2d::LoadTexture(const AZStd::string& pathName) { - AZStd::string sourceRelativePath(pathName); - AZStd::string cacheRelativePath = sourceRelativePath + ".streamingimage"; - // The file may not be in the AssetCatalog at this point if it is still processing or doesn't exist on disk. // Use GenerateAssetIdTEMP instead of GetAssetIdByPath so that it will return a valid AssetId anyways AZ::Data::AssetId streamingImageAssetId; AZ::Data::AssetCatalogRequestBus::BroadcastResult( streamingImageAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GenerateAssetIdTEMP, - sourceRelativePath.c_str()); + pathName.c_str()); streamingImageAssetId.m_subId = AZ::RPI::StreamingImageAsset::GetImageAssetSubId(); auto streamingImageAsset = AZ::Data::AssetManager::Instance().FindOrCreateAsset(streamingImageAssetId, AZ::Data::AssetLoadBehavior::PreLoad); AZ::Data::Instance image = AZ::RPI::StreamingImage::FindOrCreate(streamingImageAsset); if (!image) { - AZ_Error("Draw2d", false, "Failed to find or create an image instance from image asset '%s'", streamingImageAsset.GetHint().c_str()); + AZ_Error("Draw2d", false, "Failed to find or create an image instance from image asset '%s'", pathName.c_str()); } return image; diff --git a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp index 26e2adf0b3..7521c8b6c1 100644 --- a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp +++ b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp @@ -135,7 +135,7 @@ namespace LyShine //////////////////////////////////////////////////////////////////////////////////////////////////// LyShineSystemComponent::LyShineSystemComponent() { - m_cursorImagePathname.SetAssetPath("engineassets/textures/cursor_green.tif"); + m_cursorImagePathname.SetAssetPath("Textures/Cursor_Default.tif"); } ////////////////////////////////////////////////////////////////////////////////////////////////////