From 40e56567422c03b5e4b97410742f6735318ecf74 Mon Sep 17 00:00:00 2001 From: Michael Pollind Date: Fri, 6 Oct 2023 16:42:55 -0700 Subject: [PATCH] bugfix: fix quad renderering for debug draw Signed-off-by: Michael Pollind --- HPL2/sources/graphics/DebugDraw.cpp | 12 ++++++------ .../Common/EdEditModeSelectToolTranslate.cpp | 1 - .../common/EditorEditModeSelectToolTranslate.cpp | 7 +------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/HPL2/sources/graphics/DebugDraw.cpp b/HPL2/sources/graphics/DebugDraw.cpp index 678f60222..b107df8d7 100644 --- a/HPL2/sources/graphics/DebugDraw.cpp +++ b/HPL2/sources/graphics/DebugDraw.cpp @@ -67,15 +67,15 @@ namespace hpl { }); m_colorShader.Load(renderer->Rend(), [&](Shader** shader) { ShaderLoadDesc loadDesc = {}; - loadDesc.mStages[0].pFileName = "debug_line.vert"; - loadDesc.mStages[1].pFileName = "debug_line.frag"; + loadDesc.mStages[0].pFileName = "debug.vert"; + loadDesc.mStages[1].pFileName = "debug.frag"; addShader(renderer->Rend(), &loadDesc, shader); return true; }); m_color2DShader.Load(renderer->Rend(), [&](Shader** shader) { ShaderLoadDesc loadDesc = {}; - loadDesc.mStages[0].pFileName = "debug_line_2D.vert"; - loadDesc.mStages[1].pFileName = "debug_line.frag"; + loadDesc.mStages[0].pFileName = "debug_2D.vert"; + loadDesc.mStages[1].pFileName = "debug.frag"; addShader(renderer->Rend(), &loadDesc, shader); return true; }); @@ -223,7 +223,7 @@ namespace hpl { PipelineDesc pipelineDesc = {}; pipelineDesc.mType = PIPELINE_TYPE_GRAPHICS; auto& pipelineSettings = pipelineDesc.mGraphicsDesc; - pipelineSettings.mPrimitiveTopo = PRIMITIVE_TOPO_LINE_LIST; + pipelineSettings.mPrimitiveTopo = PRIMITIVE_TOPO_TRI_LIST; pipelineSettings.mRenderTargetCount = colorFormats.size(); pipelineSettings.pColorFormats = colorFormats.data(); pipelineSettings.pDepthState = &depthStateDesc; @@ -232,7 +232,7 @@ namespace hpl { pipelineSettings.mDepthStencilFormat = DepthBufferFormat; pipelineSettings.mSampleQuality = 0; pipelineSettings.pRootSignature = m_colorRootSignature.m_handle; - pipelineSettings.pShaderProgram = m_color2DShader.m_handle; + pipelineSettings.pShaderProgram = m_colorShader.m_handle; pipelineSettings.pRasterizerState = &rasterizerStateDesc; pipelineSettings.pVertexLayout = &colorVertexLayout; diff --git a/tools/NewEditors/Common/EdEditModeSelectToolTranslate.cpp b/tools/NewEditors/Common/EdEditModeSelectToolTranslate.cpp index 9de0020d6..6ad037d4e 100644 --- a/tools/NewEditors/Common/EdEditModeSelectToolTranslate.cpp +++ b/tools/NewEditors/Common/EdEditModeSelectToolTranslate.cpp @@ -22,7 +22,6 @@ #include "../Common/EdWindowViewport.h" #include "../Common/EdCamera.h" #include "../Common/EdScnObject.h" -//#include "../Common/EdEditModeSelect.h" #include "../Common/Editor.h" diff --git a/tools/editors/common/EditorEditModeSelectToolTranslate.cpp b/tools/editors/common/EditorEditModeSelectToolTranslate.cpp index f8fc55f57..48fa9240b 100644 --- a/tools/editors/common/EditorEditModeSelectToolTranslate.cpp +++ b/tools/editors/common/EditorEditModeSelectToolTranslate.cpp @@ -24,7 +24,6 @@ #include "EditorGrid.h" -//#include "EditorActionSelectionTranslate.h" #include "EditorActionSelection.h" #include "EditorSelection.h" @@ -34,15 +33,12 @@ cEditorEditModeSelectToolTranslate::cEditorEditModeSelectToolTranslate(cEditorEd { } -//---------------------------------------------------------------- bool cEditorEditModeSelectToolTranslate::IsActive() { return mpSelection->CanTranslate(); } -//---------------------------------------------------------------- - bool cEditorEditModeSelectToolTranslate::CheckRayIntersectsAxis(eSelectToolAxis aeAxis, const cVector3f& avRayStart, const cVector3f& avRayEnd) { cVector3f vMin = mvAxisMin[aeAxis]; @@ -51,7 +47,6 @@ bool cEditorEditModeSelectToolTranslate::CheckRayIntersectsAxis(eSelectToolAxis return cMath::CheckAABBLineIntersection(vMin,vMax,avRayStart,avRayEnd, NULL, NULL); } -//---------------------------------------------------------------- void cEditorEditModeSelectToolTranslate::CheckMouseOverAxis() { @@ -247,7 +242,7 @@ void cEditorEditModeSelectToolTranslate::DrawAxes(cEditorWindowViewport* apViewp //apFunctions->GetLowLevelGfx()->DrawBoxMinMax(mvHeadMin[i], mvHeadMax[i], cColor(1,1)); } - auto drawArrowGeometry = [&](const cColor& c, const DebugDraw::DebugDrawOptions& options) { + const auto drawArrowGeometry = [&](const cColor& c, const DebugDraw::DebugDrawOptions& options) { apFunctions->DrawQuad( Vector3(0,0,0), Vector3(-fX,fYZ,fYZ),