From 16f92109bb6d2b536d04f150f2afe1f118c03d1d Mon Sep 17 00:00:00 2001 From: Nico <122193236+Nico8340@users.noreply.github.com> Date: Wed, 21 Feb 2024 23:48:19 +0100 Subject: [PATCH 1/4] Update CLine3DBatcher.h --- Client/core/Graphics/CLine3DBatcher.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/core/Graphics/CLine3DBatcher.h b/Client/core/Graphics/CLine3DBatcher.h index 82e376e854..6320ab5733 100644 --- a/Client/core/Graphics/CLine3DBatcher.h +++ b/Client/core/Graphics/CLine3DBatcher.h @@ -38,7 +38,7 @@ class CLine3DBatcher { public: ZERO_ON_NEW - CLine3DBatcher(bool bZTest); + CLine3DBatcher(bool bPreGUI); ~CLine3DBatcher(); void OnDeviceCreate(IDirect3DDevice9* pDevice, float fViewportSizeX, float fViewportSizeY); @@ -47,7 +47,7 @@ class CLine3DBatcher void AddLine3D(const CVector& vecFrom, const CVector& vecTo, float fWidth, ulong ulColor); protected: - bool m_bZTest; + bool m_bPreGUI; IDirect3DDevice9* m_pDevice; std::vector m_LineList; }; From 932d3e3cce9a613b81611771b0a648e1f7707717 Mon Sep 17 00:00:00 2001 From: Nico <122193236+Nico8340@users.noreply.github.com> Date: Wed, 21 Feb 2024 23:48:24 +0100 Subject: [PATCH 2/4] Update CLine3DBatcher.cpp --- Client/core/Graphics/CLine3DBatcher.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Client/core/Graphics/CLine3DBatcher.cpp b/Client/core/Graphics/CLine3DBatcher.cpp index 679a251a7b..f9ce259068 100644 --- a/Client/core/Graphics/CLine3DBatcher.cpp +++ b/Client/core/Graphics/CLine3DBatcher.cpp @@ -19,9 +19,9 @@ // // //////////////////////////////////////////////////////////////// -CLine3DBatcher::CLine3DBatcher(bool bZTest) +CLine3DBatcher::CLine3DBatcher(bool bPreGUI) { - m_bZTest = bZTest; + m_bPreGUI = bPreGUI; } //////////////////////////////////////////////////////////////// @@ -79,9 +79,17 @@ void CLine3DBatcher::Flush() for (std::vector::iterator iter = m_LineList.begin(); iter != m_LineList.end(); ++iter) { const SLine3DItem& item = *iter; + SColor color = item.ulColor; + if (m_bPreGUI) + { + color.R /= 2; + color.G /= 2; + color.B /= 2; + } + + const ulong ulColor = color; const float fWidth = item.fWidth; - ulong ulColor = item.ulColor; const CVector& vecA = item.vecFrom; const CVector& vecB = item.vecTo; @@ -116,7 +124,7 @@ void CLine3DBatcher::Flush() // Set states if (g_pDeviceState->AdapterState.bRequiresClipping) m_pDevice->SetRenderState(D3DRS_CLIPPING, TRUE); - m_pDevice->SetRenderState(D3DRS_ZENABLE, m_bZTest ? D3DZB_TRUE : D3DZB_FALSE); + m_pDevice->SetRenderState(D3DRS_ZENABLE, m_bPreGUI ? D3DZB_TRUE : D3DZB_FALSE); m_pDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL); m_pDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); m_pDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); From 9512a1c4fd3fc23507c727fdf5cf7004cff331e1 Mon Sep 17 00:00:00 2001 From: Nico <122193236+Nico8340@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:24:57 +0100 Subject: [PATCH 3/4] Update CLine3DBatcher.cpp --- Client/core/Graphics/CLine3DBatcher.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Client/core/Graphics/CLine3DBatcher.cpp b/Client/core/Graphics/CLine3DBatcher.cpp index f9ce259068..6fbc53102b 100644 --- a/Client/core/Graphics/CLine3DBatcher.cpp +++ b/Client/core/Graphics/CLine3DBatcher.cpp @@ -79,16 +79,8 @@ void CLine3DBatcher::Flush() for (std::vector::iterator iter = m_LineList.begin(); iter != m_LineList.end(); ++iter) { const SLine3DItem& item = *iter; - SColor color = item.ulColor; - if (m_bPreGUI) - { - color.R /= 2; - color.G /= 2; - color.B /= 2; - } - - const ulong ulColor = color; + const ulong ulColor = item.ulColor; const float fWidth = item.fWidth; const CVector& vecA = item.vecFrom; const CVector& vecB = item.vecTo; From c4977ad7eb59b7273ea354db62680105cc564689 Mon Sep 17 00:00:00 2001 From: Nico <122193236+Nico8340@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:25:00 +0100 Subject: [PATCH 4/4] Update CMaterialLine3DBatcher.cpp --- Client/core/Graphics/CMaterialLine3DBatcher.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Client/core/Graphics/CMaterialLine3DBatcher.cpp b/Client/core/Graphics/CMaterialLine3DBatcher.cpp index dcceaac89b..7f087dbce1 100644 --- a/Client/core/Graphics/CMaterialLine3DBatcher.cpp +++ b/Client/core/Graphics/CMaterialLine3DBatcher.cpp @@ -203,14 +203,7 @@ void CMaterialLine3DBatcher::DrawBatch(const CVector& vecCameraPos, uint* pBatch { const SMaterialLine3DItem& item = m_LineList[pBatchIndices[i]]; - SColor color = item.ulColor; - if (m_bPreGUI) - { - color.R /= 2; - color.G /= 2; - color.B /= 2; - } - const ulong ulColor = color; + const ulong ulColor = item.ulColor; const CVector& vecA = item.vecFrom; const CVector& vecB = item.vecTo;