Fixed new link line not showing up in the world editor

This commit is contained in:
Aruki 2017-05-21 19:20:27 -06:00
parent f5654dcfa7
commit 8e819fd454
3 changed files with 11 additions and 23 deletions

View File

@ -217,15 +217,12 @@ void CEditorApplication::TickEditors()
{ {
if (pEditor->isVisible()) if (pEditor->isVisible())
{ {
pEditor->EditorTick((float) DeltaTime);
CBasicViewport *pViewport = pEditor->Viewport(); CBasicViewport *pViewport = pEditor->Viewport();
bool ViewportVisible = (pViewport && pViewport->isVisible() && !pEditor->isMinimized());
if (pViewport && pViewport->isVisible() && !pEditor->isMinimized()) if (ViewportVisible) pViewport->ProcessInput();
{ pEditor->EditorTick((float) DeltaTime);
pViewport->ProcessInput(); if (ViewportVisible) pViewport->Render();
pViewport->Render();
}
} }
} }
} }

View File

@ -355,6 +355,12 @@ CSceneViewport* CWorldEditor::Viewport() const
} }
// ************ PUBLIC SLOTS ************ // ************ PUBLIC SLOTS ************
void CWorldEditor::EditorTick(float)
{
// Update new link line
UpdateNewLinkLine();
}
void CWorldEditor::NotifyNodeAboutToBeDeleted(CSceneNode *pNode) void CWorldEditor::NotifyNodeAboutToBeDeleted(CSceneNode *pNode)
{ {
INodeEditor::NotifyNodeAboutToBeDeleted(pNode); INodeEditor::NotifyNodeAboutToBeDeleted(pNode);
@ -1144,21 +1150,6 @@ void CWorldEditor::OnPickModeExit()
UpdateCursor(); UpdateCursor();
} }
void CWorldEditor::RefreshViewport()
{
if (!mGizmo.IsTransforming())
mGizmo.ResetSelectedAxes();
// Process input
ui->MainViewport->ProcessInput();
// Update new link line
UpdateNewLinkLine();
// Render
ui->MainViewport->Render();
}
void CWorldEditor::UpdateCameraOrbit() void CWorldEditor::UpdateCameraOrbit()
{ {
CCamera *pCamera = &ui->MainViewport->Camera(); CCamera *pCamera = &ui->MainViewport->Camera();

View File

@ -98,6 +98,7 @@ public:
inline bool CanRepack() const { return !mWorldDir.isEmpty() && !mPakFileList.isEmpty() && !mPakTarget.isEmpty(); } inline bool CanRepack() const { return !mWorldDir.isEmpty() && !mPakFileList.isEmpty() && !mPakTarget.isEmpty(); }
public slots: public slots:
virtual void EditorTick(float);
virtual void NotifyNodeAboutToBeDeleted(CSceneNode *pNode); virtual void NotifyNodeAboutToBeDeleted(CSceneNode *pNode);
void Cut(); void Cut();
@ -150,7 +151,6 @@ private slots:
void OnUndoStackIndexChanged(); void OnUndoStackIndexChanged();
void OnPickModeEnter(QCursor Cursor); void OnPickModeEnter(QCursor Cursor);
void OnPickModeExit(); void OnPickModeExit();
void RefreshViewport();
void UpdateCameraOrbit(); void UpdateCameraOrbit();
void OnCameraSpeedChange(double Speed); void OnCameraSpeedChange(double Speed);
void OnTransformSpinBoxModified(CVector3f Value); void OnTransformSpinBoxModified(CVector3f Value);