Fixing formatting, calls to glLineWidth with invalid line width and chuck in some improvements

master
Ansariel 2025-10-13 23:43:19 +02:00
parent 137cd754e9
commit 259c453f6d
3 changed files with 221 additions and 221 deletions

View File

@ -603,7 +603,7 @@ void FSManipRotateJoint::renderCenterCircle(const F32 radius, const LLColor4& no
LLGLDepthTest gls_depth(GL_FALSE);
constexpr int segments = 64;
glLineWidth(6.0f); // Set the desired line thickness
gGL.setLineWidth(6.0f); // Set the desired line thickness
// Compute a scale factor that already factors in the radius.
float scale = radius;
@ -637,7 +637,7 @@ void FSManipRotateJoint::renderCenterCircle(const F32 radius, const LLColor4& no
}
gGL.end();
glLineWidth(1.0f); // Reset the line width.
gGL.setLineWidth(1.0f); // Reset the line width.
}
gGL.popMatrix();
}

View File

@ -825,7 +825,7 @@ void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_me
const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
glLineWidth(1.0f);
gGL.setLineWidth(1.0f);
gGL.color4fv(parcel_outline_color);
for (S32 i = 0; i <= GRIDS_PER_EDGE; i++)
{

View File

@ -4614,7 +4614,7 @@ void LLPipeline::renderSnapshotGuidesOverlay()
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();
gGL.loadIdentity();
gGLLastMatrix = NULL;
gGLLastMatrix = nullptr;
const LLColor4 line_color(mSnapshotGuideState.color, alpha);
gGL.color4fv(line_color.mV);
@ -4646,7 +4646,7 @@ void LLPipeline::renderSnapshotGuidesOverlay()
{
case SnapshotGuideState::Style::RuleOfThirds:
{
const F32 offsets[] = { 1.f / 3.f, 2.f / 3.f };
constexpr std::array<F32, 2> offsets = { 1.f / 3.f, 2.f / 3.f };
for (F32 offset : offsets)
{
draw_vertical_norm(offset);
@ -4738,25 +4738,24 @@ void LLPipeline::renderSnapshotGuidesOverlay()
break;
}
if (step % 4 == 0)
switch (step % 4)
{
case 0:
x0 += height;
add_line(x0, y0, x0, y1);
}
else if (step % 4 == 1)
{
break;
case 1:
y0 += width;
add_line(x0, y0, x1, y0);
}
else if (step % 4 == 2)
{
break;
case 2:
x1 -= height;
add_line(x1, y0, x1, y1);
}
else
{
break;
default:
y1 -= width;
add_line(x0, y1, x1, y1);
break;
}
}
@ -4842,22 +4841,22 @@ void LLPipeline::renderSnapshotGuidesOverlay()
gGL.flush();
const F32 line_width = llmax(thickness, 1.f);
glLineWidth(line_width);
gGL.setLineWidth(line_width);
draw_golden_spiral(12);
glLineWidth(1.f);
gGL.setLineWidth(1.f);
if (!line_segments.empty())
{
gGL.flush();
glLineWidth(line_width);
gGL.setLineWidth(line_width);
gGL.begin(LLRender::LINES);
for (const auto& segment : line_segments)
{
gGL.vertex2f(segment.first.mV[0], segment.first.mV[1]);
gGL.vertex2f(segment.second.mV[0], segment.second.mV[1]);
gGL.vertex2f(segment.first.mV[VX], segment.first.mV[VY]);
gGL.vertex2f(segment.second.mV[VX], segment.second.mV[VY]);
}
gGL.end();
glLineWidth(1.f);
gGL.setLineWidth(1.f);
}
break;
}
@ -4865,14 +4864,14 @@ void LLPipeline::renderSnapshotGuidesOverlay()
{
const F32 line_width = llmax(thickness, 1.f);
gGL.flush();
glLineWidth(line_width);
gGL.setLineWidth(line_width);
gGL.begin(LLRender::LINES);
gGL.vertex2f(left_px, bottom_px);
gGL.vertex2f(right_px, top_px);
gGL.vertex2f(left_px, top_px);
gGL.vertex2f(right_px, bottom_px);
gGL.end();
glLineWidth(1.f);
gGL.setLineWidth(1.f);
break;
}
}
@ -4881,17 +4880,17 @@ void LLPipeline::renderSnapshotGuidesOverlay()
gGL.popMatrix();
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.popMatrix();
gGLLastMatrix = NULL;
gGLLastMatrix = nullptr;
ui_shader->unbind();
mSnapshotGuideState.active = false;
}
// </FS:Beq>
// <FS:Beq> FIRE-32023 Focus Point Rendering
void LLPipeline::renderFocusPoint()
{
static LLCachedControl<bool> render_focus_point_crosshair(gSavedSettings, "FSFocusPointRender", false);
if (sDoFEnabled && render_focus_point_crosshair && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
{
@ -4930,6 +4929,7 @@ void LLPipeline::renderFocusPoint()
}
}
// </FS:Beq>
void LLPipeline::renderPhysicsDisplay()
{
if (!hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES))
@ -4942,7 +4942,7 @@ void LLPipeline::renderPhysicsDisplay()
LLGLEnable(GL_POLYGON_OFFSET_LINE);
glPolygonOffset(3.f, 3.f);
glLineWidth(3.f);
gGL.setLineWidth(3.f);
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
@ -4984,7 +4984,7 @@ void LLPipeline::renderPhysicsDisplay()
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
}
glLineWidth(1.f);
gGL.setLineWidth(1.f);
gDebugProgram.unbind();
}