Merge pull request #144 from aws-lumberyard-dev/nvsickle/MainFontFixes

Fix debug font rendering & assert on game mode transition
This commit is contained in:
Nicholas Van Sickle
2021-04-20 12:32:26 -07:00
committed by GitHub
6 changed files with 97 additions and 61 deletions
+9 -8
View File
@@ -276,9 +276,6 @@ void EditorViewportWidget::paintEvent([[maybe_unused]] QPaintEvent* event)
if ((ge && ge->IsLevelLoaded()) || (GetType() != ET_ViewportCamera))
{
setRenderOverlayVisible(true);
m_isOnPaint = true;
Update();
m_isOnPaint = false;
}
else
{
@@ -809,6 +806,10 @@ void EditorViewportWidget::OnBeginPrepareRender()
return;
}
m_isOnPaint = true;
Update();
m_isOnPaint = false;
float fNearZ = GetIEditor()->GetConsoleVar("cl_DefaultNearPlane");
float fFarZ = m_Camera.GetFarPlane();
@@ -880,6 +881,11 @@ void EditorViewportWidget::OnBeginPrepareRender()
GetIEditor()->GetSystem()->SetViewCamera(m_Camera);
if (GetIEditor()->IsInGameMode())
{
return;
}
PreWidgetRendering();
RenderAll();
@@ -905,11 +911,6 @@ void EditorViewportWidget::OnBeginPrepareRender()
m_debugDisplay->DepthTestOn();
PostWidgetRendering();
if (!m_renderer->IsStereoEnabled())
{
GetIEditor()->GetSystem()->RenderStatistics();
}
}
//////////////////////////////////////////////////////////////////////////
+4 -1
View File
@@ -418,8 +418,11 @@ void CLayoutWnd::CreateLayout(EViewLayout layout, bool bBindViewports, EViewport
QRect rcView = rect();
rcView.setBottom(rcView.bottom() - m_infoBar->height());
// Ensure we delete our old view immediately so it can relinquish its backing ViewportContext
if (m_maximizedView)
m_maximizedView->deleteLater();
{
delete m_maximizedView;
}
m_maximizedView = new CLayoutViewPane(this);
m_maximizedView->SetId(0);
@@ -95,6 +95,11 @@ bool ViewportManipulatorControllerInstance::HandleInputChannelEvent(const AzFram
AZStd::optional<MouseButton> overrideButton;
AZStd::optional<MouseEvent> eventType;
// Because we receive events multiple times at separate priorities for manipulator events and
// viewport interaction events, we want to avoid updating our "last tick state" until we're on our last event,
// which currently is the low priority Interaction processor.
const bool finishedProcessingEvents = event.m_priority == InteractionPriority;
if (IsMouseMove(event.m_inputChannel))
{
// Cache the ray trace results when doing manipulator interaction checks, no need to recalculate after
@@ -120,10 +125,11 @@ bool ViewportManipulatorControllerInstance::HandleInputChannelEvent(const AzFram
}
else if (auto mouseButton = GetMouseButton(event.m_inputChannel); mouseButton != MouseButton::None)
{
const AZ::u32 mouseButtonValue = static_cast<AZ::u32>(mouseButton);
overrideButton = mouseButton;
if (event.m_inputChannel.GetState() == InputChannel::State::Began)
{
m_state.m_mouseButtons.m_mouseButtons |= static_cast<AZ::u32>(mouseButton);
m_state.m_mouseButtons.m_mouseButtons |= mouseButtonValue;
if (IsDoubleClick(mouseButton))
{
// Only remove the double click flag once we're done processing both Manipulator and Interaction events
@@ -135,8 +141,8 @@ bool ViewportManipulatorControllerInstance::HandleInputChannelEvent(const AzFram
}
else
{
// Only insert the double click timing once we're done processing both Manipulator and Interaction events, to avoid a false IsDoubleClick positive
if (event.m_priority == InteractionPriority)
// Only insert the double click timing once we're done processing events, to avoid a false IsDoubleClick positive
if (finishedProcessingEvents)
{
m_pendingDoubleClicks[mouseButton] = m_curTime;
}
@@ -145,8 +151,18 @@ bool ViewportManipulatorControllerInstance::HandleInputChannelEvent(const AzFram
}
else if (event.m_inputChannel.GetState() == InputChannel::State::Ended)
{
m_state.m_mouseButtons.m_mouseButtons &= ~static_cast<AZ::u32>(mouseButton);
eventType = MouseEvent::Up;
// If we've actually logged a mouse down event, forward a mouse up event.
// This prevents corner cases like the context menu thinking it should be opened even though no one clicked in this viewport,
// due to RenderViewportWidget ensuring all controllers get InputChannel::State::Ended events.
if (m_state.m_mouseButtons.m_mouseButtons & mouseButtonValue)
{
// Erase the button from our state if we're done processing events.
if (event.m_priority == InteractionPriority)
{
m_state.m_mouseButtons.m_mouseButtons &= ~mouseButtonValue;
}
eventType = MouseEvent::Up;
}
}
}
else if (auto keyboardModifier = GetKeyboardModifier(event.m_inputChannel); keyboardModifier != KeyboardModifier::None)