Skip to content

Commit

Permalink
bugfix: fix quad renderering for debug draw
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Pollind <[email protected]>
  • Loading branch information
pollend committed Oct 6, 2023
1 parent 4e812d8 commit 40e5656
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
12 changes: 6 additions & 6 deletions HPL2/sources/graphics/DebugDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down
1 change: 0 additions & 1 deletion tools/NewEditors/Common/EdEditModeSelectToolTranslate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "../Common/EdWindowViewport.h"
#include "../Common/EdCamera.h"
#include "../Common/EdScnObject.h"
//#include "../Common/EdEditModeSelect.h"

#include "../Common/Editor.h"

Expand Down
7 changes: 1 addition & 6 deletions tools/editors/common/EditorEditModeSelectToolTranslate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "EditorGrid.h"

//#include "EditorActionSelectionTranslate.h"
#include "EditorActionSelection.h"
#include "EditorSelection.h"

Expand All @@ -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];
Expand All @@ -51,7 +47,6 @@ bool cEditorEditModeSelectToolTranslate::CheckRayIntersectsAxis(eSelectToolAxis
return cMath::CheckAABBLineIntersection(vMin,vMax,avRayStart,avRayEnd, NULL, NULL);
}

//----------------------------------------------------------------

void cEditorEditModeSelectToolTranslate::CheckMouseOverAxis()
{
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 40e5656

Please sign in to comment.