Skip to content

Commit

Permalink
Remove GuiBatchRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
odeyaioo committed Jul 28, 2024
1 parent 11e7a8f commit 375fbdd
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 319 deletions.
8 changes: 8 additions & 0 deletions src/main/java/net/vulkanmod/config/gui/GuiRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ public static void drawString(Font font, FormattedCharSequence formattedCharSequ
guiGraphics.drawString(font, formattedCharSequence, x, y, color);
}

public static void drawString(Font font, Component component, int x, int y, int color, boolean shadow) {
drawString(font, component.getVisualOrderText(), x, y, color, shadow);
}

public static void drawString(Font font, FormattedCharSequence formattedCharSequence, int x, int y, int color, boolean shadow) {
guiGraphics.drawString(font, formattedCharSequence, x, y, color, shadow);
}

public static void drawCenteredString(Font font, Component component, int x, int y, int color) {
FormattedCharSequence formattedCharSequence = component.getVisualOrderText();
guiGraphics.drawString(font, formattedCharSequence, x - font.width(formattedCharSequence) / 2, y, color);
Expand Down
125 changes: 0 additions & 125 deletions src/main/java/net/vulkanmod/mixin/debug/DebugScreenOverlayM.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,129 +77,4 @@ private ArrayList<String> redirectList(Object[] elements) {
private long getOffHeapMemory() {
return bytesToMegabytes(ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().getUsed());
}

// /**
// * @author
// */
// @Overwrite
// public void drawGameInformation(PoseStack matrices) {
// List<String> list = this.getGameInformation();
// list.add("");
// boolean bl = this.minecraft.getSingleplayerServer() != null;
// list.add("Debug: Pie [shift]: " + (this.minecraft.options.renderDebugCharts ? "visible" : "hidden") + (bl ? " FPS + TPS" : " FPS") + " [alt]: " + (this.minecraft.options.renderFpsChart ? "visible" : "hidden"));
// list.add("For help: press F3 + Q");
//
// RenderSystem.enableBlend();
// RenderSystem.setShader(GameRenderer::getPositionColorShader);
// GuiBatchRenderer.beginBatch(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
//
// for (int i = 0; i < list.size(); ++i) {
// String string = list.get(i);
// if (Strings.isNullOrEmpty(string)) continue;
// int j = this.font.lineHeight;
// int k = this.font.width(string);
// int l = 2;
// int m = 2 + j * i;
//
// GuiBatchRenderer.fill(matrices, 1, m - 1, 2 + k + 1, m + j - 1, -1873784752);
// }
// GuiBatchRenderer.endBatch();
//
// MultiBufferSource.BufferSource bufferSource = MultiBufferSource.immediate(Tesselator.getInstance().getBuilder());
// for (int i = 0; i < list.size(); ++i) {
// String string = list.get(i);
// if (Strings.isNullOrEmpty(string)) continue;
// int j = this.font.lineHeight;
// int k = this.font.width(string);
// int l = 2;
// int m = 2 + j * i;
//
// GuiBatchRenderer.drawString(this.font, bufferSource, matrices, string, 2.0f, (float)m, 0xE0E0E0);
// }
// bufferSource.endBatch();
// }

// @Inject(method = "drawGameInformation",
// at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z",
// shift = At.Shift.AFTER,
// ordinal = 2))
// protected void inject1(GuiGraphics guiGraphics, CallbackInfo ci)
// {
//
// RenderSystem.enableBlend();
// RenderSystem.setShader(GameRenderer::getPositionColorShader);
// GuiBatchRenderer.beginBatch(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
// }
//
//
// @Redirect(method = "renderLines",
// at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;fill(IIIII)V"))
// protected void redirectFill(GuiGraphics instance, int i, int j, int k, int l, int m)
// {
// GuiBatchRenderer.fill(instance.pose(), m, k, j, l, m);
// }
//
// @Redirect(method = "drawGameInformation(Lcom/mojang/blaze3d/vertex/PoseStack;)V",
// at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/Font;draw(Lcom/mojang/blaze3d/vertex/PoseStack;Ljava/lang/String;FFI)I"))
// protected int renderStuffRedirectThree(Font instance, PoseStack $$0, String $$1, float $$2, float $$3, int $$4)
// {
// return 0;
// }
//
// @Inject(method = "drawGameInformation(Lcom/mojang/blaze3d/vertex/PoseStack;)V", at = @At("TAIL"),
// locals = LocalCapture.CAPTURE_FAILHARD)
// public void renderStuff3(PoseStack poseStack, CallbackInfo ci, List<String> list)
// {
// GuiBatchRenderer.endBatch();
//
// MultiBufferSource.BufferSource bufferSource = MultiBufferSource.immediate(Tesselator.getInstance().getBuilder());
// for (int i = 0; i < list.size(); ++i) {
// String string = list.get(i);
// if (Strings.isNullOrEmpty(string)) continue;
// int j = this.font.lineHeight;
// int k = this.font.width(string);
// int l = 2;
// int m = 2 + j * i;
//
// GuiBatchRenderer.drawString(this.font, bufferSource, poseStack, string, 2.0f, (float)m, 0xE0E0E0);
// }
// bufferSource.endBatch();
// }
//
// /**
// * @author
// */
// @Overwrite
// public void drawSystemInformation(PoseStack matrices) {
// List<String> list = this.getSystemInformation();
//
// RenderSystem.enableBlend();
// RenderSystem.setShader(GameRenderer::getPositionColorShader);
// GuiBatchRenderer.beginBatch(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
//
// for (int i = 0; i < list.size(); ++i) {
// String string = list.get(i);
// if (Strings.isNullOrEmpty(string)) continue;
// int j = this.font.lineHeight;
// int k = this.font.width(string);
// int l = this.minecraft.getWindow().getGuiScaledWidth() - 2 - k;
// int m = 2 + j * i;
//
// GuiBatchRenderer.fill(matrices, l - 1, m - 1, l + k + 1, m + j - 1, -1873784752);
// }
// GuiBatchRenderer.endBatch();
//
// MultiBufferSource.BufferSource bufferSource = MultiBufferSource.immediate(Tesselator.getInstance().getBuilder());
// for (int i = 0; i < list.size(); ++i) {
// String string = list.get(i);
// if (Strings.isNullOrEmpty(string)) continue;
// int j = this.font.lineHeight;
// int k = this.font.width(string);
// int l = this.minecraft.getWindow().getGuiScaledWidth() - 2 - k;
// int m = 2 + j * i;
//
// GuiBatchRenderer.drawString(this.font, bufferSource, matrices, string, (float)l, (float)m, 0xE0E0E0);
// }
// bufferSource.endBatch();
// }
}
138 changes: 0 additions & 138 deletions src/main/java/net/vulkanmod/render/gui/GuiBatchRenderer.java

This file was deleted.

Loading

0 comments on commit 375fbdd

Please sign in to comment.