diff options
author | Linnea Gräf <nea@nea.moe> | 2024-07-05 22:17:02 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-07-05 22:17:02 +0200 |
commit | 3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7 (patch) | |
tree | b383c2c584a96b93c46d1dae3efcd3c6571e3d05 /src/main/kotlin/moe/nea/firmament/util/render/RenderCircleProgress.kt | |
parent | 5ee4b8d925eb12e068038a1fd2e1f35cdd8ef87e (diff) | |
download | firmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.tar.gz firmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.tar.bz2 firmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.zip |
Port to 1.21
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util/render/RenderCircleProgress.kt')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/render/RenderCircleProgress.kt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/render/RenderCircleProgress.kt b/src/main/kotlin/moe/nea/firmament/util/render/RenderCircleProgress.kt index a8245ca..28dcb5e 100644 --- a/src/main/kotlin/moe/nea/firmament/util/render/RenderCircleProgress.kt +++ b/src/main/kotlin/moe/nea/firmament/util/render/RenderCircleProgress.kt @@ -7,6 +7,7 @@ package moe.nea.firmament.util.render import com.mojang.blaze3d.systems.RenderSystem +import io.github.notenoughupdates.moulconfig.platform.next import org.joml.Matrix4f import org.joml.Vector2f import kotlin.math.atan2 @@ -31,12 +32,10 @@ object RenderCircleProgress { v2: Float, ) { RenderSystem.setShaderTexture(0, texture) - RenderSystem.setShader { GameRenderer.getPositionColorTexProgram() } + RenderSystem.setShader(GameRenderer::getPositionTexColorProgram) RenderSystem.enableBlend() val matrix: Matrix4f = drawContext.matrices.peek().positionMatrix - val bufferBuilder = Tessellator.getInstance().buffer - bufferBuilder.begin(DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR_TEXTURE) - bufferBuilder.fixedColor(255, 255, 255, 255) + val bufferBuilder = Tessellator.getInstance().begin(DrawMode.TRIANGLES, VertexFormats.POSITION_TEXTURE_COLOR) val corners = listOf( Vector2f(0F, -1F), @@ -79,17 +78,19 @@ object RenderCircleProgress { bufferBuilder .vertex(matrix, second.x, second.y, 0F) .texture(lerp(u1, u2, ilerp(second.x)), lerp(v1, v2, ilerp(second.y))) + .color(-1) .next() bufferBuilder .vertex(matrix, first.x, first.y, 0F) .texture(lerp(u1, u2, ilerp(first.x)), lerp(v1, v2, ilerp(first.y))) + .color(-1) .next() bufferBuilder .vertex(matrix, 0F, 0F, 0F) .texture(lerp(u1, u2, ilerp(0F)), lerp(v1, v2, ilerp(0F))) + .color(-1) .next() } - bufferBuilder.unfixColor() BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()) RenderSystem.disableBlend() } |