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

* Remove CryRenderer dependencies

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

* Fix non-unity compile error

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

* Remove ITexture.h reference

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

* Simple file moves from CryCommon to LyShine Gem

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

* More simple file moves from CryCommon to LyShine Gem

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

* Move more headers from CryCommon to LyShine Gem

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

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

Signed-off-by: abrmich <abrmich@amazon.com>
This commit is contained in:
michabr
2021-12-02 14:47:32 -08:00
committed by GitHub
parent 28f38ca009
commit 4d5aad13d1
131 changed files with 329 additions and 318 deletions
@@ -26,7 +26,7 @@ namespace
{
//! Set the values for an image vertex
//! This helper function is used so that we only have to initialize textIndex and texHasColorChannel in one place
void SetVertex(SVF_P2F_C4B_T2F_F4B& vert, const Vec2& pos, uint32 color, const Vec2& uv)
void SetVertex(LyShine::UiPrimitiveVertex& vert, const Vec2& pos, uint32 color, const Vec2& uv)
{
vert.xy = pos;
vert.color.dcolor = color;
@@ -39,7 +39,7 @@ namespace
//! Set the values for an image vertex
//! This version of the helper function takes AZ vectors
void SetVertex(SVF_P2F_C4B_T2F_F4B& vert, const AZ::Vector2& pos, uint32 color, const AZ::Vector2& uv)
void SetVertex(LyShine::UiPrimitiveVertex& vert, const AZ::Vector2& pos, uint32 color, const AZ::Vector2& uv)
{
SetVertex(vert, Vec2(pos.GetX(), pos.GetY()), color, Vec2(uv.GetX(), uv.GetY()));
}
@@ -146,7 +146,7 @@ void UiImageSequenceComponent::Render(LyShine::IRenderGraph* renderGraph)
if (m_cachedPrimitive.m_vertices[0].color.a != desiredPackedAlpha)
{
// go through all the cached vertices and update the alpha values
UCol desiredPackedColor = m_cachedPrimitive.m_vertices[0].color;
LyShine::UCol desiredPackedColor = m_cachedPrimitive.m_vertices[0].color;
desiredPackedColor.a = desiredPackedAlpha;
for (int i = 0; i < m_cachedPrimitive.m_numVertices; ++i)
{
@@ -540,7 +540,7 @@ void UiImageSequenceComponent::RenderSingleQuad(const AZ::Vector2* positions, co
// points are a clockwise quad
IDraw2d::Rounding pixelRounding = IsPixelAligned() ? IDraw2d::Rounding::Nearest : IDraw2d::Rounding::None;
const uint32 numVertices = 4;
SVF_P2F_C4B_T2F_F4B vertices[numVertices];
LyShine::UiPrimitiveVertex vertices[numVertices];
for (int i = 0; i < numVertices; ++i)
{
AZ::Vector2 roundedPoint = Draw2dHelper::RoundXY(positions[i], pixelRounding);
@@ -554,12 +554,12 @@ void UiImageSequenceComponent::RenderSingleQuad(const AZ::Vector2* positions, co
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void UiImageSequenceComponent::RenderTriangleList(const SVF_P2F_C4B_T2F_F4B* vertices, const uint16* indices, int numVertices, int numIndices)
void UiImageSequenceComponent::RenderTriangleList(const LyShine::UiPrimitiveVertex* vertices, const uint16* indices, int numVertices, int numIndices)
{
if (numVertices != m_cachedPrimitive.m_numVertices)
{
ClearCachedVertices();
m_cachedPrimitive.m_vertices = new SVF_P2F_C4B_T2F_F4B[numVertices];
m_cachedPrimitive.m_vertices = new LyShine::UiPrimitiveVertex[numVertices];
m_cachedPrimitive.m_numVertices = numVertices;
}
@@ -570,7 +570,7 @@ void UiImageSequenceComponent::RenderTriangleList(const SVF_P2F_C4B_T2F_F4B* ver
m_cachedPrimitive.m_numIndices = numIndices;
}
memcpy(m_cachedPrimitive.m_vertices, vertices, sizeof(SVF_P2F_C4B_T2F_F4B) * numVertices);
memcpy(m_cachedPrimitive.m_vertices, vertices, sizeof(LyShine::UiPrimitiveVertex) * numVertices);
memcpy(m_cachedPrimitive.m_indices, indices, sizeof(uint16) * numIndices);
m_isRenderCacheDirty = false;