protected void drawRectangle(double x, double y, double width, double height, int color) { GlStateManager.disableTexture2D(); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); float a = (float) (color >> 24 & 0xFF) / 255.0F; float r = (float) (color >> 16 & 0xFF) / 255.0F; float g = (float) (color >> 8 & 0xFF) / 255.0F; float b = (float) (color & 0xFF) / 255.0F; Tessellator tessellator = Tessellator.getInstance(); VertexBuffer vertexBuffer = tessellator.getBuffer(); vertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); vertexBuffer.pos(x, y + height, 0.0).color(r, g, b, a).endVertex(); vertexBuffer.pos(x + width, y + height, 0.0).color(r, g, b, a).endVertex(); vertexBuffer.pos(x + width, y, 0.0).color(r, g, b, a).endVertex(); vertexBuffer.pos(x, y, 0.0).color(r, g, b, a).endVertex(); tessellator.draw(); GlStateManager.disableBlend(); GlStateManager.enableAlpha(); GlStateManager.enableTexture2D(); }
protected void drawTexturedRectangle(double x, double y, double width, double height, int color) { GlStateManager.enableTexture2D(); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); float a = (float) (color >> 24 & 0xFF) / 255.0F; float r = (float) (color >> 16 & 0xFF) / 255.0F; float g = (float) (color >> 8 & 0xFF) / 255.0F; float b = (float) (color & 0xFF) / 255.0F; Tessellator tessellator = Tessellator.getInstance(); VertexBuffer vertexBuffer = tessellator.getBuffer(); vertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); vertexBuffer.pos(x, y + height, 0.0).tex(0.0F, 1.0F).color(r, g, b, a).endVertex(); vertexBuffer.pos(x + width, y + height, 0.0).tex(1.0F, 1.0F).color(r, g, b, a).endVertex(); vertexBuffer.pos(x + width, y, 0.0).tex(1.0F, 0.0F).color(r, g, b, a).endVertex(); vertexBuffer.pos(x, y, 0.0).tex(0.0F, 0.0F).color(r, g, b, a).endVertex(); tessellator.draw(); GlStateManager.disableBlend(); GlStateManager.enableAlpha(); GlStateManager.disableTexture2D(); }
buffer.pos(bounds.minX, bounds.minY, bounds.minZ).color(r, g, b, a).tex(minU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.maxX, bounds.minY, bounds.minZ).color(r, g, b, a).tex(maxU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.maxX, bounds.minY, bounds.maxZ).color(r, g, b, a).tex(maxU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.minX, bounds.minY, bounds.maxZ).color(r, g, b, a).tex(minU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); break; case UP: buffer.pos(bounds.minX, bounds.maxY, bounds.minZ).color(r, g, b, a).tex(minU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.minX, bounds.maxY, bounds.maxZ).color(r, g, b, a).tex(minU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.maxX, bounds.maxY, bounds.maxZ).color(r, g, b, a).tex(maxU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.maxX, bounds.maxY, bounds.minZ).color(r, g, b, a).tex(maxU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); break; case NORTH: buffer.pos(bounds.minX, bounds.minY, bounds.minZ).color(r, g, b, a).tex(minU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.minX, bounds.maxY, bounds.minZ).color(r, g, b, a).tex(minU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.maxX, bounds.maxY, bounds.minZ).color(r, g, b, a).tex(maxU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.maxX, bounds.minY, bounds.minZ).color(r, g, b, a).tex(maxU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); break; case SOUTH: buffer.pos(bounds.minX, bounds.minY, bounds.maxZ).color(r, g, b, a).tex(maxU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.maxX, bounds.minY, bounds.maxZ).color(r, g, b, a).tex(minU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.maxX, bounds.maxY, bounds.maxZ).color(r, g, b, a).tex(minU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.minX, bounds.maxY, bounds.maxZ).color(r, g, b, a).tex(maxU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); break; case WEST: buffer.pos(bounds.minX, bounds.minY, bounds.minZ).color(r, g, b, a).tex(maxU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.minX, bounds.minY, bounds.maxZ).color(r, g, b, a).tex(minU, maxV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.minX, bounds.maxY, bounds.maxZ).color(r, g, b, a).tex(minU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); buffer.pos(bounds.minX, bounds.maxY, bounds.minZ).color(r, g, b, a).tex(maxU, minV).lightmap(brightnessHighBits, brightnessLowBits).endVertex(); break;
vertexbuffer.pos(x, y + faceOffset, z).color(f11, f12, f13, 1.0F).endVertex(); vertexbuffer.pos(x, y + faceOffset, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex(); vertexbuffer.pos(x + 1.0D, y + faceOffset, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex(); vertexbuffer.pos(x + 1.0D, y + faceOffset, z).color(f11, f12, f13, 1.0F).endVertex(); vertexbuffer.pos(x, y + faceOffset, z).color(f11, f12, f13, 1.0F).endVertex(); vertexbuffer.pos(x + 1.0D, y + faceOffset, z).color(f11, f12, f13, 1.0F).endVertex(); vertexbuffer.pos(x + 1.0D, y + faceOffset, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex(); vertexbuffer.pos(x, y + faceOffset, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex();
GlStateManager.disableTexture2D(); var18.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); var18.getBuffer().pos((double) boxLeft, (double) (var19 + var13 + 2), 0).tex(0, 1).color(0x80, 0x80, 0x80, 0xFF).endVertex(); var18.getBuffer().pos((double) boxRight, (double) (var19 + var13 + 2), 0).tex(1, 1).color(0x80, 0x80, 0x80, 0xFF).endVertex(); var18.getBuffer().pos((double) boxRight, (double) (var19 - 2), 0).tex(1, 0).color(0x80, 0x80, 0x80, 0xFF).endVertex(); var18.getBuffer().pos((double) boxLeft, (double) (var19 - 2), 0).tex(0, 0).color(0x80, 0x80, 0x80, 0xFF).endVertex(); var18.getBuffer().pos((double) (boxLeft + 1), (double) (var19 + var13 + 1), 0).tex(0, 1).color(0x00, 0x00, 0x00, 0xFF).endVertex(); var18.getBuffer().pos((double) (boxRight - 1), (double) (var19 + var13 + 1), 0).tex(1, 1).color(0x00, 0x00, 0x00, 0xFF).endVertex(); var18.getBuffer().pos((double) (boxRight - 1), (double) (var19 - 1), 0).tex(1, 0).color(0x00, 0x00, 0x00, 0xFF).endVertex(); var18.getBuffer().pos((double) (boxLeft + 1), (double) (var19 - 1), 0).tex(0, 0).color(0x00, 0x00, 0x00, 0xFF).endVertex(); var18.draw(); GlStateManager.enableTexture2D(); var18.getBuffer().pos((double) scrollBarXStart, (double) this.bottom, 0).tex(0, 1).color(0x00, 0x00, 0x00, 0xFF).endVertex(); var18.getBuffer().pos((double) scrollBarXEnd, (double) this.bottom, 0).tex(1, 1).color(0x00, 0x00, 0x00, 0xFF).endVertex(); var18.getBuffer().pos((double) scrollBarXEnd, (double) this.top, 0).tex(1, 0).color(0x00, 0x00, 0x00, 0xFF).endVertex(); var18.getBuffer().pos((double) scrollBarXStart, (double) this.top, 0).tex(0, 0).color(0x00, 0x00, 0x00, 0xFF).endVertex(); var18.draw(); var18.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); var18.getBuffer().pos((double) scrollBarXStart, (double) (var14 + var13), 0).tex(0, 1).color(0x80, 0x80, 0x80, 0xFF).endVertex(); var18.getBuffer().pos((double) scrollBarXEnd, (double) (var14 + var13), 0).tex(1, 1).color(0x80, 0x80, 0x80, 0xFF).endVertex(); var18.getBuffer().pos((double) scrollBarXEnd, (double) var14, 0).tex(1, 0).color(0x80, 0x80, 0x80, 0xFF).endVertex(); var18.getBuffer().pos((double) scrollBarXStart, (double) var14, 0).tex(0, 0).color(0x80, 0x80, 0x80, 0xFF).endVertex(); var18.draw(); var18.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); var18.getBuffer().pos((double) scrollBarXStart, (double) (var14 + var13 - 1), 0).tex(0, 1).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex(); var18.getBuffer().pos((double) (scrollBarXEnd - 1), (double) (var14 + var13 - 1), 0).tex(1, 1).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex(); var18.getBuffer().pos((double) (scrollBarXEnd - 1), (double) var14, 0).tex(1, 0).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex(); var18.getBuffer().pos((double) scrollBarXStart, (double) var14, 0).tex(0, 0).color(0xC0, 0xC0, 0xC0, 0xFF).endVertex();
int k3 = j3 >> 16 & 65535; int l3 = j3 & 65535; vertexbuffer.pos((double)l1 - d3 + 0.5D, (double)l2, (double)k1 - d4 + 0.5D).tex(0.0D, (double)k2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f4).lightmap(k3, l3).endVertex(); vertexbuffer.pos((double)l1 + d3 + 0.5D, (double)l2, (double)k1 + d4 + 0.5D).tex(1.0D, (double)k2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f4).lightmap(k3, l3).endVertex(); vertexbuffer.pos((double)l1 + d3 + 0.5D, (double)k2, (double)k1 + d4 + 0.5D).tex(1.0D, (double)l2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f4).lightmap(k3, l3).endVertex(); vertexbuffer.pos((double)l1 - d3 + 0.5D, (double)k2, (double)k1 - d4 + 0.5D).tex(0.0D, (double)l2 * 0.25D + d5).color(1.0F, 1.0F, 1.0F, f4).lightmap(k3, l3).endVertex(); } else { if (j1 != 1) { int j4 = i4 >> 16 & 65535; int k4 = i4 & 65535; vertexbuffer.pos((double)l1 - d3 + 0.5D, (double)l2, (double)k1 - d4 + 0.5D).tex(0.0D + d9, (double)k2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f5).lightmap(j4, k4).endVertex(); vertexbuffer.pos((double)l1 + d3 + 0.5D, (double)l2, (double)k1 + d4 + 0.5D).tex(1.0D + d9, (double)k2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f5).lightmap(j4, k4).endVertex(); vertexbuffer.pos((double)l1 + d3 + 0.5D, (double)k2, (double)k1 + d4 + 0.5D).tex(1.0D + d9, (double)l2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f5).lightmap(j4, k4).endVertex(); vertexbuffer.pos((double)l1 - d3 + 0.5D, (double)k2, (double)k1 - d4 + 0.5D).tex(0.0D + d9, (double)l2 * 0.25D + d8 + d10).color(1.0F, 1.0F, 1.0F, f5).lightmap(j4, k4).endVertex();