diff --git a/common/src/main/java/org/vivecraft/client_vr/render/helpers/RenderHelper.java b/common/src/main/java/org/vivecraft/client_vr/render/helpers/RenderHelper.java index 953185f77..c37709876 100644 --- a/common/src/main/java/org/vivecraft/client_vr/render/helpers/RenderHelper.java +++ b/common/src/main/java/org/vivecraft/client_vr/render/helpers/RenderHelper.java @@ -6,6 +6,7 @@ import com.mojang.math.Axis; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiComponent; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.renderer.GameRenderer; import net.minecraft.client.renderer.LightTexture; @@ -322,22 +323,13 @@ public static void drawMouseMenuQuad(PoseStack poseStack, int mouseX, int mouseY float size = 15.0F * Math.max(ClientDataHolderVR.getInstance().vrSettings.menuCrosshairScale, 1.0F / (float) MC.getWindow().getGuiScale()); - float halfSize = size * 0.5F; int x = (int) (mouseX - size * 0.5F + 1); int y = (int) (mouseY - size * 0.5F + 1); - RenderSystem.setShader(GameRenderer::getPositionTexShader); - RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderTexture(0, Gui.GUI_ICONS_LOCATION); - BufferBuilder bufferBuilder = Tesselator.getInstance().getBuilder(); - bufferBuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX); - bufferBuilder.vertex(x - halfSize, y - halfSize, 0).uv(0, 0).endVertex(); - bufferBuilder.vertex(x - halfSize, y + halfSize, 0).uv(0, 15F / 265F).endVertex(); - bufferBuilder.vertex(x + halfSize, y + halfSize, 0).uv(15F / 265F, 15F / 265F).endVertex(); - bufferBuilder.vertex(x + halfSize, y - halfSize, 0).uv(15F / 265F, 0).endVertex(); - BufferUploader.drawWithShader(bufferBuilder.end()); + GuiComponent.blit(poseStack, x, y, (int) size, (int) size, 0, 0, 15, 15, 256, 256); RenderSystem.defaultBlendFunc(); RenderSystem.enableDepthTest(); diff --git a/common/src/main/java/org/vivecraft/client_vr/render/helpers/VRPassHelper.java b/common/src/main/java/org/vivecraft/client_vr/render/helpers/VRPassHelper.java index 0f28c0f5e..d9254fee3 100644 --- a/common/src/main/java/org/vivecraft/client_vr/render/helpers/VRPassHelper.java +++ b/common/src/main/java/org/vivecraft/client_vr/render/helpers/VRPassHelper.java @@ -143,7 +143,7 @@ public static void renderAndSubmit(boolean renderLevel, long nanoTime, float act MC.mouseHandler.ypos() * (double) MC.getWindow().getGuiScaledHeight() / (double) MC.getWindow().getScreenHeight() ); - RenderHelper.drawMouseMenuQuad(poseStack, x, y); + RenderHelper.drawMouseMenuQuad(new PoseStack(), x, y); poseStack.popPose(); RenderSystem.applyModelViewMatrix(); diff --git a/gradle.properties b/gradle.properties index 3a64a57d0..08899bf26 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ minecraft_version=1.19.4 enabled_platforms=fabric,forge archives_base_name=vivecraft -mod_version=1.2.2 +mod_version=1.2.3 maven_group=org.vivecraft lwjgl_version=3.3.2