Skip to content

Commit fb6e937

Browse files
fix: Use RenderSystem#lineWidth instead of direct GL call
1 parent a864970 commit fb6e937

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mod/src/main/kotlin/gg/skytils/skytilsmod/utils/RenderUtil.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ object RenderUtil {
172172
val matrices = UMatrixStack.Compat.get()
173173
matrices.push()
174174
DrawHelper.cameraOffset(matrices)
175-
GL11.glLineWidth(width)
175+
RenderSystem.lineWidth(width)
176176
DrawHelper.writeOutlineCube(buffer, matrices, aabb, color.multAlpha(1f))
177177
buffer.build()?.drawAndClose(if (throughWalls) SRenderPipelines.noDepthBoxPipeline else SRenderPipelines.boxPipeline)
178178
matrices.pop()
@@ -216,7 +216,7 @@ object RenderUtil {
216216
) {
217217
matrixStack.push()
218218
DrawHelper.cameraOffset(matrixStack)
219-
GL11.glLineWidth(width.toFloat())
219+
RenderSystem.lineWidth(width.toFloat())
220220
val fixedColor = color.multAlpha(alphaMultiplier)
221221
val buffer = UBufferBuilder.create(UGraphics.DrawMode.LINE_STRIP, UGraphics.CommonVertexFormats.POSITION_COLOR)
222222
buffer.pos(matrixStack, pos1.x, pos1.y, pos1.z).color(fixedColor).endVertex()
@@ -235,7 +235,7 @@ object RenderUtil {
235235
) {
236236
matrixStack.push()
237237
DrawHelper.cameraOffset(matrixStack)
238-
GL11.glLineWidth(width.toFloat())
238+
RenderSystem.lineWidth(width.toFloat())
239239
val fixedColor = color.multAlpha(alphaMultiplier)
240240
val buffer = UBufferBuilder.create(UGraphics.DrawMode.LINE_STRIP, UGraphics.CommonVertexFormats.POSITION_COLOR)
241241
for (pos in points) {
@@ -508,7 +508,7 @@ object RenderUtil {
508508
fun drawCircle(matrixStack: UMatrixStack, x: Double, y: Double, z: Double, partialTicks: Float, radius: Double, edges: Int, r: Int, g: Int, b: Int, a: Int = 255) {
509509
val ug = UGraphics.getFromTessellator()
510510
val angleDelta = Math.PI * 2 / edges
511-
GL11.glLineWidth(5f)
511+
RenderSystem.lineWidth(5f)
512512
ug.beginWithDefaultShader(UGraphics.DrawMode.LINE_STRIP, UGraphics.CommonVertexFormats.POSITION_COLOR)
513513
repeat(edges) { idx ->
514514
ug.pos(matrixStack, x - mc.entityRenderDispatcher.field_4695 + radius * cos(idx * angleDelta), y - mc.entityRenderDispatcher.field_4694, z - mc.entityRenderDispatcher.field_4693 + radius * sin(idx * angleDelta)).color(r, g, b, a).endVertex()

0 commit comments

Comments
 (0)