Skip to content

Commit

Permalink
Fix render double wireframe logic
Browse files Browse the repository at this point in the history
Fix render double wireframe logic for object has 'angles' keyvalue.
  • Loading branch information
UnrealKaraulov committed Jan 31, 2024
1 parent 8921861 commit 9de4fa1
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/editor/BspRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2654,15 +2654,12 @@ void BspRenderer::drawModel(RenderEnt* ent, int pass, bool highlight, bool edges

if (ent && ent->needAngles)
{
if (highlight)
{
glLineWidth(std::min(g_app->lineWidthRange[1], 3.0f));
g_app->matmodel = ent->modelMat4x4_calc;
g_app->colorShader->updateMatrixes();
rend_mdl.wireframeBuffer->drawFull();
rend_mdl.wireframeBuffer->frameId--;
glLineWidth(1.3f);
}
glLineWidth(std::min(g_app->lineWidthRange[1], 3.0f));
g_app->matmodel = ent->modelMat4x4_calc;
g_app->colorShader->updateMatrixes();
rend_mdl.wireframeBuffer->drawFull();
rend_mdl.wireframeBuffer->frameId--;
glLineWidth(1.3f);

g_app->matmodel = ent->modelMat4x4_calc_angles;
g_app->colorShader->updateMatrixes();
Expand Down Expand Up @@ -2765,7 +2762,7 @@ void BspRenderer::drawModel(RenderEnt* ent, int pass, bool highlight, bool edges

rgroup.buffer->drawFull();

if (ent && ent->needAngles && !highlight)
if (ent && ent->needAngles && highlight)
{
for (int s = 0; s < MAX_LIGHTMAPS; s++)
{
Expand Down

0 comments on commit 9de4fa1

Please sign in to comment.