From 8d480311145aef6581dc9d7b2cfedd50777919dc Mon Sep 17 00:00:00 2001 From: D-AIRY <admin@ds-servers.com> Date: Mon, 21 Oct 2019 12:46:14 +0300 Subject: [PATCH] Fixed border rendering; Disable updating hidden windows --- .gitignore | 1 + source/gui/IRenderBorder.cpp | 3 ++- source/xUI/XUI.cpp | 10 ++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 620d25825..62c1fb08e 100644 --- a/.gitignore +++ b/.gitignore @@ -210,6 +210,7 @@ build/gamesource/* /build/gamesource/shaders/cache/* !shaders/ !gui/ +!editor_gui/ docs/html/* !docs/html/material_editor/ !docs/html/particles_editor/ diff --git a/source/gui/IRenderBorder.cpp b/source/gui/IRenderBorder.cpp index 5ed841626..b9537f75c 100644 --- a/source/gui/IRenderBorder.cpp +++ b/source/gui/IRenderBorder.cpp @@ -17,11 +17,12 @@ namespace gui m_iIndexStart[i] = 0; m_iIndexCount[i] = 0; //m_iColor[i] = 0xFF000000; - m_pColor[i] = float4_t(0.0f, 0.0f, 0.0f, 1.0f); + m_pColor[i] = float4_t(0.0f, 0.0f, 0.0f, 0.0f); m_iVertexCount[i] = 0; m_iVertexStart[i] = 0; m_iSideCount[i] = 0; m_pColorsConstant[i] = GetGUI()->getDevice()->createConstantBuffer(sizeof(float4)); + m_pColorsConstant[i]->update(&m_pColor[i]); } m_pColorBlack = GetGUI()->getDevice()->createConstantBuffer(sizeof(float4)); diff --git a/source/xUI/XUI.cpp b/source/xUI/XUI.cpp index 84905dbb0..4c4b40281 100644 --- a/source/xUI/XUI.cpp +++ b/source/xUI/XUI.cpp @@ -51,7 +51,10 @@ void XMETHODCALLTYPE CXUI::render() for(UINT i = 0, l = m_pWindows.size(); i < l; ++i) { - m_pWindows[i]->render(pCtx); + if(m_pWindows[i]->isVisible()) + { + m_pWindows[i]->render(pCtx); + } } pCtx->setColorTarget(pOldSurface); @@ -63,7 +66,10 @@ void XMETHODCALLTYPE CXUI::present() { for(UINT i = 0, l = m_pWindows.size(); i < l; ++i) { - m_pWindows[i]->present(); + if(m_pWindows[i]->isVisible()) + { + m_pWindows[i]->present(); + } } } -- GitLab