Fix up particle emitter to work with Atom (#626)
* Fix up particle emitter component to work with Atom * PR feedback and disable render target tests until supported
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
#include "LyShine_precompiled.h"
|
||||
|
||||
#include "UiImageSequenceComponent.h"
|
||||
#include "Sprite.h"
|
||||
#include "RenderGraph.h"
|
||||
|
||||
#include <LyShine/Draw2d.h>
|
||||
#include <LyShine/ISprite.h>
|
||||
#include <LyShine/IRenderGraph.h>
|
||||
@@ -100,7 +103,7 @@ void UiImageSequenceComponent::Render(LyShine::IRenderGraph* renderGraph)
|
||||
return;
|
||||
}
|
||||
|
||||
ISprite* sprite = m_spriteList[m_sequenceIndex];
|
||||
CSprite* sprite = dynamic_cast<CSprite*>(m_spriteList[m_sequenceIndex]);
|
||||
|
||||
// get fade value (tracked by UiRenderer) and compute the desired alpha for the image
|
||||
float fade = renderGraph->GetAlphaFade();
|
||||
@@ -158,15 +161,23 @@ void UiImageSequenceComponent::Render(LyShine::IRenderGraph* renderGraph)
|
||||
}
|
||||
}
|
||||
|
||||
ITexture* texture = (sprite) ? sprite->GetTexture() : nullptr;
|
||||
AZ::Data::Instance<AZ::RPI::Image> image;
|
||||
if (sprite)
|
||||
{
|
||||
image = sprite->GetImage();
|
||||
}
|
||||
bool isClampTextureMode = false;
|
||||
bool isTextureSRGB = false;
|
||||
bool isTexturePremultipliedAlpha = false;
|
||||
LyShine::BlendMode blendMode = LyShine::BlendMode::Normal;
|
||||
|
||||
// Add the quad to the render graph
|
||||
renderGraph->AddPrimitive(&m_cachedPrimitive, texture,
|
||||
isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode);
|
||||
LyShine::RenderGraph* lyRenderGraph = dynamic_cast<LyShine::RenderGraph*>(renderGraph);
|
||||
if (lyRenderGraph)
|
||||
{
|
||||
lyRenderGraph->AddPrimitiveAtom(&m_cachedPrimitive, image,
|
||||
isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user