diff --git a/Client/core/Graphics/CLine3DBatcher.cpp b/Client/core/Graphics/CLine3DBatcher.cpp index 679a251a7b..6fbc53102b 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; } //////////////////////////////////////////////////////////////// @@ -80,8 +80,8 @@ void CLine3DBatcher::Flush() { const SLine3DItem& item = *iter; + const ulong ulColor = item.ulColor; const float fWidth = item.fWidth; - ulong ulColor = item.ulColor; const CVector& vecA = item.vecFrom; const CVector& vecB = item.vecTo; @@ -116,7 +116,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); 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; }; 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;