aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/utils
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-03-10 23:06:05 +0900
committersyeyoung <cyong06@naver.com>2021-03-10 23:06:05 +0900
commit92ce9024b73df31f3c88ad23a7443dec2578469c (patch)
treedd7f6c928c79e2847a34ccb47820a037d244e361 /src/main/java/kr/syeyoung/dungeonsguide/utils
parenta7030786cc5f3b756f8b538f8f071cd7d5c14e77 (diff)
downloadSkyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.tar.gz
Skyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.tar.bz2
Skyblock-Dungeons-Guide-92ce9024b73df31f3c88ad23a7443dec2578469c.zip
finally fix gui flashing issue.
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/utils')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
index 35319e71..8ffcab39 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
@@ -70,7 +70,6 @@ public class RenderUtils {
}
tessellator.draw();
GlStateManager.enableTexture2D();
- GlStateManager.disableBlend();
}
@@ -118,6 +117,42 @@ public class RenderUtils {
}
tessellator.draw();
GlStateManager.enableTexture2D();
+ GlStateManager.enableBlend();
+ }
+
+ public static void drawRectSafe(int left, int top, int right, int bottom, int color)
+ {
+ if (left < right)
+ {
+ int i = left;
+ left = right;
+ right = i;
+ }
+
+ if (top < bottom)
+ {
+ int j = top;
+ top = bottom;
+ bottom = j;
+ }
+
+ float f3 = (float)(color >> 24 & 255) / 255.0F;
+ float f = (float)(color >> 16 & 255) / 255.0F;
+ float f1 = (float)(color >> 8 & 255) / 255.0F;
+ float f2 = (float)(color & 255) / 255.0F;
+ Tessellator tessellator = Tessellator.getInstance();
+ WorldRenderer worldrenderer = tessellator.getWorldRenderer();
+ GlStateManager.enableBlend();
+ GlStateManager.disableTexture2D();
+ GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
+ GlStateManager.color(f, f1, f2, f3);
+ worldrenderer.begin(7, DefaultVertexFormats.POSITION);
+ worldrenderer.pos((double)left, (double)bottom, 0.0D).endVertex();
+ worldrenderer.pos((double)right, (double)bottom, 0.0D).endVertex();
+ worldrenderer.pos((double)right, (double)top, 0.0D).endVertex();
+ worldrenderer.pos((double)left, (double)top, 0.0D).endVertex();
+ tessellator.draw();
+ GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
}