Make ILyShine an AZ::Interface (#6923)

* Move ILyShine instance out of legacy code

Signed-off-by: abrmich <abrmich@amazon.com>

* Remove last remaining reference of gEnv->pLyShine

Signed-off-by: abrmich <abrmich@amazon.com>

* Make m_lyShine a unique pointer

Signed-off-by: abrmich <abrmich@amazon.com>
This commit is contained in:
michabr
2022-01-21 15:03:57 -08:00
committed by GitHub
parent cdf748a5ed
commit 7fa6a82f55
25 changed files with 97 additions and 95 deletions
@@ -284,7 +284,7 @@ namespace LyShineExamples
// If this is called from RC.exe for example these pointers will not be set. In that case
// we only need to be able to load, init and save the component. It will never be
// activated.
if (!(gEnv && gEnv->pLyShine))
if (!AZ::Interface<ILyShine>::Get())
{
return;
}
@@ -294,7 +294,7 @@ namespace LyShineExamples
{
if (!m_spritePathname.GetAssetPath().empty())
{
m_sprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str());
m_sprite = AZ::Interface<ILyShine>::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str());
}
}
@@ -399,7 +399,7 @@ namespace LyShineExamples
if (!m_spritePathname.GetAssetPath().empty())
{
// Load the new texture.
newSprite = gEnv->pLyShine->LoadSprite(m_spritePathname.GetAssetPath().c_str());
newSprite = AZ::Interface<ILyShine>::Get()->LoadSprite(m_spritePathname.GetAssetPath().c_str());
}
SAFE_RELEASE(m_sprite);