Skip to content

Commit

Permalink
Simplify terminal overlay rendering, should also make it more compati…
Browse files Browse the repository at this point in the history
…ble with mods messing with the render pipeline. Closes #162.
  • Loading branch information
fnuecke committed Jan 6, 2023
1 parent a31f30b commit 43d4c79
Showing 1 changed file with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package li.cil.tis3d.client.gui;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import li.cil.tis3d.client.ClientConfig;
import li.cil.tis3d.common.module.TerminalModule;
Expand All @@ -11,7 +10,6 @@
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11;

import java.util.Objects;

Expand All @@ -32,21 +30,10 @@ public boolean isFor(final TerminalModule that) {

@Override
public void render(final PoseStack matrixStack, final int mouseX, final int mouseY, final float partialTicks) {
RenderSystem.clear(GL11.GL_DEPTH_BUFFER_BIT, false);
RenderSystem.enableDepthTest();
RenderSystem.depthFunc(GL11.GL_LEQUAL);
RenderSystem.depthMask(true);
RenderSystem.colorMask(false, false, false, false);
matrixStack.pushPose();
matrixStack.translate(0, 0, 500);

fill(matrixStack, 8, 8, width - 8, height - 8, 0xFFFFFFFF);

matrixStack.popPose();
RenderSystem.depthMask(false);
RenderSystem.colorMask(true, true, true, true);

fill(matrixStack, 4, 4, width - 4, height - 4, Color.WHITE);
fill(matrixStack, 4, 4, width - 4, 8, Color.WHITE); // Top
fill(matrixStack, 4, 4, 8, height - 4, Color.WHITE); // Left
fill(matrixStack, 4, height - 8, width - 4, height - 4, Color.WHITE); // Bottom
fill(matrixStack, width - 8, 4, width - 4, height - 4, Color.WHITE); // Right
}

@Override
Expand Down

0 comments on commit 43d4c79

Please sign in to comment.