diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-08 19:36:38 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-08 19:36:38 +0300 |
commit | a1dff63bca844c70819ffd5b9cce3a7b74eb7df4 (patch) | |
tree | 1e6e13d3da183010d6eb8e9110ea593b4330b296 /src/main | |
parent | 569e006c737f66c7eed32952226ba4e63000a01a (diff) | |
download | LibGui-a1dff63bca844c70819ffd5b9cce3a7b74eb7df4.tar.gz LibGui-a1dff63bca844c70819ffd5b9cce3a7b74eb7df4.tar.bz2 LibGui-a1dff63bca844c70819ffd5b9cce3a7b74eb7df4.zip |
Remove deprecated usages of color4f from ScreenDrawing
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java index 4588a51..786f2ee 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java @@ -9,7 +9,6 @@ import com.mojang.blaze3d.systems.RenderSystem; import io.github.cottonmc.cotton.gui.widget.data.Alignment; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.font.TextRenderer; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.VertexFormats; @@ -65,12 +64,11 @@ public class ScreenDrawing { RenderSystem.enableBlend(); //GlStateManager.disableTexture2D(); RenderSystem.blendFuncSeparate(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SrcFactor.ONE, GlStateManager.DstFactor.ZERO); - RenderSystem.color4f(r, g, b, 1.0f); - buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION_TEXTURE); //I thought GL_QUADS was deprecated but okay, sure. - buffer.vertex(x, y + height, 0).texture(u1, v2).next(); - buffer.vertex(x + width, y + height, 0).texture(u2, v2).next(); - buffer.vertex(x + width, y, 0).texture(u2, v1).next(); - buffer.vertex(x, y, 0).texture(u1, v1).next(); + buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION_COLOR_TEXTURE); //I thought GL_QUADS was deprecated but okay, sure. + buffer.vertex(x, y + height, 0).color(r, g, b, 1.0f).texture(u1, v2).next(); + buffer.vertex(x + width, y + height, 0).color(r, g, b, 1.0f).texture(u2, v2).next(); + buffer.vertex(x + width, y, 0).color(r, g, b, 1.0f).texture(u2, v1).next(); + buffer.vertex(x, y, 0).color(r, g, b, 1.0f).texture(u1, v1).next(); tessellator.draw(); //GlStateManager.enableTexture2D(); RenderSystem.disableBlend(); @@ -126,12 +124,11 @@ public class ScreenDrawing { RenderSystem.enableBlend(); RenderSystem.disableTexture(); RenderSystem.blendFuncSeparate(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SrcFactor.ONE, GlStateManager.DstFactor.ZERO); - RenderSystem.color4f(r, g, b, a); - buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION); //I thought GL_QUADS was deprecated but okay, sure. - buffer.vertex(left, top + height, 0.0D).next(); - buffer.vertex(left + width, top + height, 0.0D).next(); - buffer.vertex(left + width, top, 0.0D).next(); - buffer.vertex(left, top, 0.0D).next(); + buffer.begin(GL11.GL_QUADS, VertexFormats.POSITION_COLOR); //I thought GL_QUADS was deprecated but okay, sure. + buffer.vertex(left, top + height, 0.0D).color(r, g, b, a).next(); + buffer.vertex(left + width, top + height, 0.0D).color(r, g, b, a).next(); + buffer.vertex(left + width, top, 0.0D).color(r, g, b, a).next(); + buffer.vertex(left, top, 0.0D).color(r, g, b, a).next(); tessellator.draw(); RenderSystem.enableTexture(); RenderSystem.disableBlend(); |