diff options
author | syeyoung <cyoung06@naver.com> | 2022-05-07 00:45:55 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2022-05-07 00:45:55 +0900 |
commit | 183549fad0e35b543dc06b212c2836ddd5bad3d5 (patch) | |
tree | c2d01cb3ea4d5e9846a091e222485e96b16176db /src | |
parent | e72b31d22413acf4e6cd87c35340c3dcbf9a3d6a (diff) | |
download | Skyblock-Dungeons-Guide-183549fad0e35b543dc06b212c2836ddd5bad3d5.tar.gz Skyblock-Dungeons-Guide-183549fad0e35b543dc06b212c2836ddd5bad3d5.tar.bz2 Skyblock-Dungeons-Guide-183549fad0e35b543dc06b212c2836ddd5bad3d5.zip |
- Remove unnecessary un-culling.
Diffstat (limited to 'src')
3 files changed, 13 insertions, 30 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java index 7ccbdcf9..663cde9f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java @@ -152,7 +152,6 @@ public class PanelPartyListElement extends MPanel { RenderHelper.disableStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting(); GlStateManager.scale(2,2,1); - GlStateManager.enableCull(); GlStateManager.enableDepth(); renderItem.renderItemAndEffectIntoGUI(itemStack, 0,0); GlStateManager.popMatrix(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRedRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRedRoom.java index 311d5de9..2ac55ea8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRedRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorRedRoom.java @@ -99,7 +99,6 @@ public class RoomProcessorRedRoom extends GeneralRoomProcessor { GlStateManager.rotate(dir, 0.0f, 1.0f, 0.0f); GlStateManager.scale(-0.05f, -0.05f, 0.05f); GlStateManager.disableLighting(); - GlStateManager.disableCull(); GlStateManager.depthMask(false); GL11.glDisable(GL11.GL_DEPTH_TEST); GlStateManager.disableDepth(); GlStateManager.enableBlend(); @@ -111,7 +110,6 @@ public class RoomProcessorRedRoom extends GeneralRoomProcessor { GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); GlStateManager.depthMask(true); GlStateManager.enableDepth(); - GlStateManager.enableCull(); GlStateManager.popMatrix(); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java index 282dcf76..18f09cb0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java @@ -76,7 +76,6 @@ public class RenderUtils { GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); GlStateManager.disableLighting(); GlStateManager.disableDepth(); - GlStateManager.enableCull(); GlStateManager.enableTexture2D(); GlStateManager.tryBlendFuncSeparate(770, 1, 1, 0); GlStateManager.enableBlend(); @@ -121,7 +120,6 @@ public class RenderUtils { worldrenderer.pos(x + d4, y + topOffset, z + d5).tex(0.0D, d15).color(r, g, b, alpha).endVertex(); tessellator.draw(); - GlStateManager.disableCull(); double d12 = -1.0D + d1; double d13 = height + d12; @@ -238,31 +236,25 @@ public class RenderUtils { GlStateManager.translate(width/2.0+x, height/2.0+y, 0); Tessellator t = Tessellator.getInstance(); GlStateManager.disableTexture2D(); - GlStateManager.disableCull(); RenderUtils.GL_SETCOLOR(color); WorldRenderer wr = t.getWorldRenderer(); wr.begin(GL11.GL_POLYGON, DefaultVertexFormats.POSITION); for (double i = 0.1; i < Math.PI*2; i+= delta) { double cos = MathHelper.cos((float) i); double sin = MathHelper.sin((float) i); - if (cos != 0 || sin != 0) - wr.pos(cos * radius + (cos < 0 ? -width/2.0+radius : width/2.0-radius), - sin * radius + (sin <= 0 ? -height/2.0+radius : height/2.0-radius), 0) - .endVertex(); // .color((int) (i/(Math.PI*2) * 255),0,0,255) - if (cos *MathHelper.cos((float) (i + delta)) <= 0) { // X Change - sin = Math.round(sin); - - wr.pos((cos < 0 ? -1 : 1) * (width/2.0 - radius), - sin * radius + (sin < 0 ? -height/2.0+radius : height/2.0-radius), 0).endVertex(); - wr.pos((cos < 0 ? 1 : -1) * (width/2.0 - radius), - sin * radius + (sin < 0 ? -height/2.0+radius : height/2.0-radius), 0).endVertex(); - } else if (sin * MathHelper.sin((float) (i+delta)) <= 0) { // Y Change - cos = Math.round(cos); - - wr.pos(cos * radius + (cos < 0 ? -width/2.0+radius : width/2.0-radius), - (sin < 0 ? -1 : 1) *(height/2.0 - radius), 0).endVertex(); - wr.pos(cos * radius + (cos < 0 ? -width/2.0+radius : width/2.0-radius), - (sin < 0 ? 1 : -1) *(height/2.0 - radius), 0).endVertex(); + if (cos * MathHelper.cos((float) (i + delta)) <= 0) { + wr.pos(sin * radius + (sin > 0 ? 1 : -1) * (width/2.0 - radius), + cos * radius + (cos > 0 ? 1 : -1) * (height/2.0 - radius),0).endVertex(); + wr.pos(sin * radius + (sin > 0 ? 1 : -1) * (width/2.0 - radius), + cos * radius + (cos > 0 ? -1 : 1) * (height/2.0 - radius),0).endVertex(); + } else if (sin * MathHelper.sin((float) (i+delta)) <= 0) { + wr.pos(sin * radius + (sin > 0 ? 1 : -1) * (width/2.0 - radius), + cos * radius + (cos > 0 ? 1 : -1) * (height/2.0 - radius), 0).endVertex(); + wr.pos(sin * radius + (sin > 0 ? -1 : 1) * (width/2.0 - radius), + cos * radius + (cos > 0 ? 1 : -1) * (height/2.0 - radius), 0).endVertex(); + } else { + wr.pos(sin * radius + (sin > 0 ? 1 : -1) * (width/2.0 - radius), + cos * radius + (cos > 0 ? 1 : -1) * (height/2.0 - radius), 0).endVertex(); } } t.draw(); @@ -473,13 +465,10 @@ public class RenderUtils { double playerX = player.prevPosX + (player.posX - player.prevPosX) * partialTicks; double playerY = player.prevPosY + (player.posY - player.prevPosY) * partialTicks; double playerZ = player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks; -//because of the way 3D rendering is done, all coordinates are relative to the camera. This "resets" the "0,0,0" position to the location that is (0,0,0) in the world. - GlStateManager.pushMatrix(); GlStateManager.translate(-playerX, -playerY, -playerZ); GlStateManager.disableTexture2D(); - GlStateManager.disableCull(); GlStateManager.enableAlpha(); if (dungeonDoor.getType().isExist()) @@ -536,7 +525,6 @@ public class RenderUtils { GlStateManager.disableBlend(); GlStateManager.enableTexture2D(); - GlStateManager.enableCull(); RenderManager renderManager = Minecraft.getMinecraft().getRenderManager(); @@ -832,7 +820,6 @@ public class RenderUtils { GlStateManager.disableLighting(); GlStateManager.enableBlend(); - GlStateManager.disableCull(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GlStateManager.disableTexture2D(); @@ -906,7 +893,6 @@ public class RenderUtils { GlStateManager.disableLighting(); GlStateManager.enableBlend(); - GlStateManager.disableCull(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GlStateManager.disableTexture2D(); |