From a1dff63bca844c70819ffd5b9cce3a7b74eb7df4 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Fri, 8 May 2020 19:36:38 +0300 Subject: Remove deprecated usages of color4f from ScreenDrawing --- .../cottonmc/cotton/gui/client/ScreenDrawing.java | 23 ++++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/main') 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(); -- cgit