Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void circle(final float x, final float y, final float radius, final int fill) {
- arc(x, y, 0.0f, 360.0f, radius, fill);
- }
- public static void circle(final float x, final float y, final float radius, final Color fill) {
- arc(x, y, 0.0f, 360.0f, radius, fill);
- }
- public static void arc(final float x, final float y, final float start, final float end, final float radius, final int color) {
- arcEllipse(x, y, start, end, radius, radius, color);
- }
- public static void arc(final float x, final float y, final float start, final float end, final float radius, final Color color) {
- arcEllipse(x, y, start, end, radius, radius, color);
- }
- public static void arcEllipse(final float x, final float y, float start, float end, final float w, final float h, final int color) {
- GlStateManager.color(0.0f, 0.0f, 0.0f);
- GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.0f);
- float temp = 0.0f;
- if (start > end) {
- temp = end;
- end = start;
- start = temp;
- }
- final float var11 = (color >> 24 & 0xFF) / 255.0f;
- final float var12 = (color >> 16 & 0xFF) / 255.0f;
- final float var13 = (color >> 8 & 0xFF) / 255.0f;
- final float var14 = (color & 0xFF) / 255.0f;
- final Tessellator var15 = Tessellator.getInstance();
- final WorldRenderer var16 = var15.getWorldRenderer();
- GlStateManager.enableBlend();
- GlStateManager.disableTexture2D();
- GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
- GlStateManager.color(var12, var13, var14, var11);
- if (var11 > 0.5f) {
- GL11.glEnable(2848);
- GL11.glLineWidth(2.0f);
- GL11.glBegin(3);
- for (float i = end; i >= start; i -= 4.0f) {
- final float ldx = (float)Math.cos(i * 3.141592653589793 / 180.0) * (w * 1.001f);
- final float ldy = (float)Math.sin(i * 3.141592653589793 / 180.0) * (h * 1.001f);
- GL11.glVertex2f(x + ldx, y + ldy);
- }
- GL11.glEnd();
- GL11.glDisable(2848);
- }
- GL11.glBegin(6);
- for (float i = end; i >= start; i -= 4.0f) {
- final float ldx = (float)Math.cos(i * 3.141592653589793 / 180.0) * w;
- final float ldy = (float)Math.sin(i * 3.141592653589793 / 180.0) * h;
- GL11.glVertex2f(x + ldx, y + ldy);
- }
- GL11.glEnd();
- GlStateManager.enableTexture2D();
- GlStateManager.disableBlend();
- }
- public static void arcEllipse(final float x, final float y, float start, float end, final float w, final float h, final Color color) {
- GlStateManager.color(0.0f, 0.0f, 0.0f);
- GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.0f);
- float temp = 0.0f;
- if (start > end) {
- temp = end;
- end = start;
- start = temp;
- }
- final Tessellator var9 = Tessellator.getInstance();
- final WorldRenderer var10 = var9.getWorldRenderer();
- GlStateManager.enableBlend();
- GlStateManager.disableTexture2D();
- GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
- GlStateManager.color(color.getRed() / 255.0f, color.getGreen() / 255.0f, color.getBlue() / 255.0f, color.getAlpha() / 255.0f);
- if (color.getAlpha() > 0.5f) {
- GL11.glEnable(2848);
- GL11.glLineWidth(2.0f);
- GL11.glBegin(3);
- for (float i = end; i >= start; i -= 4.0f) {
- final float ldx = (float)Math.cos(i * 3.141592653589793 / 180.0) * (w * 1.001f);
- final float ldy = (float)Math.sin(i * 3.141592653589793 / 180.0) * (h * 1.001f);
- GL11.glVertex2f(x + ldx, y + ldy);
- }
- GL11.glEnd();
- GL11.glDisable(2848);
- }
- GL11.glBegin(6);
- for (float i = end; i >= start; i -= 4.0f) {
- final float ldx = (float)Math.cos(i * 3.141592653589793 / 180.0) * w;
- final float ldy = (float)Math.sin(i * 3.141592653589793 / 180.0) * h;
- GL11.glVertex2f(x + ldx, y + ldy);
- }
- GL11.glEnd();
- GlStateManager.enableTexture2D();
- GlStateManager.disableBlend();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement