ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene crea… (#5153)
* ATOM-16747 RPISystemInterface::GetDefaultScene returns the scene created by PreviewRenderer but not the Main Scene Deprecate GetDefaultScene() function. Update all the places which use GetDefaultScene to use Scene::GetFeatureProcessorFromEntityId or GetMainScene. Tested with Editor, UI Editor, Material Editor, game launcher. Signed-off-by: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com>
This commit is contained in:
@@ -255,19 +255,22 @@ namespace Blast
|
||||
BlastFamilyComponentRequestBus::Broadcast(
|
||||
&BlastFamilyComponentRequests::FillDebugRenderBuffer, buffer, m_debugRenderMode);
|
||||
|
||||
// This is a system component, and thus is not associated with a specific scene, so use the default scene
|
||||
// This is a system component, and thus is not associated with a specific scene, so use the bootstrap scene
|
||||
// for the debug drawing
|
||||
const auto defaultScene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene();
|
||||
auto drawQueue = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(defaultScene);
|
||||
|
||||
for (DebugLine& line : buffer.m_lines)
|
||||
const auto mainScene = AZ::RPI::RPISystemInterface::Get()->GetSceneByName(AZ::Name("Main"));
|
||||
if (mainScene)
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArguments;
|
||||
drawArguments.m_verts = &line.m_p0;
|
||||
drawArguments.m_vertCount = 2;
|
||||
drawArguments.m_colors = &line.m_color;
|
||||
drawArguments.m_colorCount = 1;
|
||||
drawQueue->DrawLines(drawArguments);
|
||||
auto drawQueue = AZ::RPI::AuxGeomFeatureProcessorInterface::GetDrawQueueForScene(mainScene);
|
||||
|
||||
for (DebugLine& line : buffer.m_lines)
|
||||
{
|
||||
AZ::RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments drawArguments;
|
||||
drawArguments.m_verts = &line.m_p0;
|
||||
drawArguments.m_vertCount = 2;
|
||||
drawArguments.m_colors = &line.m_color;
|
||||
drawArguments.m_colorCount = 1;
|
||||
drawQueue->DrawLines(drawArguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user