public void drawLiquidRect(int startU, int startV, Icon par3Icon, int endU, int endV) {
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(
       startU + 0,
       startV + endV,
       this.zLevel,
       par3Icon.getMinU(),
       par3Icon.getMaxV()); // Bottom left
   tessellator.addVertexWithUV(
       startU + endU,
       startV + endV,
       this.zLevel,
       par3Icon.getMaxU(),
       par3Icon.getMaxV()); // Bottom right
   tessellator.addVertexWithUV(
       startU + endU,
       startV + 0,
       this.zLevel,
       par3Icon.getMaxU(),
       par3Icon.getMinV()); // Top right
   tessellator.addVertexWithUV(
       startU + 0, startV + 0, this.zLevel, par3Icon.getMinU(), par3Icon.getMinV()); // Top left
   tessellator.draw();
 }
Ejemplo n.º 2
0
 public void func_6274_a(int i, int j, int k, int l, int i1, int j1) {
   float f = 0.00390625F;
   float f1 = 0.00390625F;
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.addVertexWithUV(i + 0, j + j1, 0.0D, (float) (k + 0) * f, (float) (l + j1) * f1);
   tessellator.addVertexWithUV(i + i1, j + j1, 0.0D, (float) (k + i1) * f, (float) (l + j1) * f1);
   tessellator.addVertexWithUV(i + i1, j + 0, 0.0D, (float) (k + i1) * f, (float) (l + 0) * f1);
   tessellator.addVertexWithUV(i + 0, j + 0, 0.0D, (float) (k + 0) * f, (float) (l + 0) * f1);
   tessellator.draw();
 }
Ejemplo n.º 3
0
 private void loadScreen() throws LWJGLException {
   ScaledResolution scaledresolution =
       new ScaledResolution(gameSettings, displayWidth, displayHeight);
   GL11.glClear(16640);
   GL11.glMatrixMode(5889 /*GL_PROJECTION*/);
   GL11.glLoadIdentity();
   GL11.glOrtho(
       0.0D, scaledresolution.field_25121_a, scaledresolution.field_25120_b, 0.0D, 1000D, 3000D);
   GL11.glMatrixMode(5888 /*GL_MODELVIEW0_ARB*/);
   GL11.glLoadIdentity();
   GL11.glTranslatef(0.0F, 0.0F, -2000F);
   GL11.glViewport(0, 0, displayWidth, displayHeight);
   GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
   Tessellator tessellator = Tessellator.instance;
   GL11.glDisable(2896 /*GL_LIGHTING*/);
   GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
   GL11.glDisable(2912 /*GL_FOG*/);
   GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, renderEngine.getTexture("/title/mojang.png"));
   tessellator.startDrawingQuads();
   tessellator.setColorOpaque_I(0xffffff);
   tessellator.addVertexWithUV(0.0D, displayHeight, 0.0D, 0.0D, 0.0D);
   tessellator.addVertexWithUV(displayWidth, displayHeight, 0.0D, 0.0D, 0.0D);
   tessellator.addVertexWithUV(displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
   tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
   tessellator.draw();
   char c = '\u0100';
   char c1 = '\u0100';
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   tessellator.setColorOpaque_I(0xffffff);
   func_6274_a(
       (scaledresolution.getScaledWidth() - c) / 2,
       (scaledresolution.getScaledHeight() - c1) / 2,
       0,
       0,
       c,
       c1);
   GL11.glDisable(2896 /*GL_LIGHTING*/);
   GL11.glDisable(2912 /*GL_FOG*/);
   GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
   GL11.glAlphaFunc(516, 0.1F);
   Display.swapBuffers();
 }
Ejemplo n.º 4
0
  public int func_982_a() {
    if (!field_1488_w) {
      throw new IllegalStateException("Not tesselating!");
    }
    if (renderingChunk && subTessellators.length > 0) {
      boolean flag = false;
      for (int j = 0; j < subTessellators.length; j++) {
        int k = subTextures[j];
        if (k <= 0) {
          break;
        }
        Tessellator tessellator = subTessellators[j];
        if (tessellator.field_1488_w) {
          GL11.glBindTexture(3553, k);
          tessellator.func_982_a();
          flag = true;
        }
      }

      if (flag) {
        GL11.glBindTexture(3553, getTerrainTexture());
      }
    }
    field_1488_w = false;
    if (field_1505_h > 0) {
      field_1508_e.clear();
      field_1508_e.put(field_1506_g, 0, field_1498_o);
      field_1509_d.position(0);
      field_1509_d.limit(field_1498_o * 4);
      if (field_1487_x) {
        field_1485_z = (field_1485_z + 1) % field_1496_A;
        ARBVertexBufferObject.glBindBufferARB(34962, field_1486_y.get(field_1485_z));
        ARBVertexBufferObject.glBufferDataARB(34962, field_1509_d, 35040);
      }
      if (field_1500_m) {
        if (field_1487_x) {
          GL11.glTexCoordPointer(2, 5126, 32, 12L);
        } else {
          field_1507_f.position(3);
          GL11.glTexCoordPointer(2, 32, field_1507_f);
        }
        GL11.glEnableClientState(32888);
      }
      if (field_35838_p) {
        OpenGlHelper.func_40451_b(OpenGlHelper.field_40455_b);
        if (field_1487_x) {
          GL11.glTexCoordPointer(2, 5122, 32, 28L);
        } else {
          field_35836_g.position(14);
          GL11.glTexCoordPointer(2, 32, field_35836_g);
        }
        GL11.glEnableClientState(32888);
        OpenGlHelper.func_40451_b(OpenGlHelper.field_40457_a);
      }
      if (field_1501_l) {
        if (field_1487_x) {
          GL11.glColorPointer(4, 5121, 32, 20L);
        } else {
          field_1509_d.position(20);
          GL11.glColorPointer(4, true, 32, field_1509_d);
        }
        GL11.glEnableClientState(32886);
      }
      if (field_1499_n) {
        if (field_1487_x) {
          GL11.glNormalPointer(5121, 32, 24L);
        } else {
          field_1509_d.position(24);
          GL11.glNormalPointer(32, field_1509_d);
        }
        GL11.glEnableClientState(32885);
      }
      if (field_1487_x) {
        GL11.glVertexPointer(3, 5126, 32, 0L);
      } else {
        field_1507_f.position(0);
        GL11.glVertexPointer(3, 32, field_1507_f);
      }
      GL11.glEnableClientState(32884);
      if (field_1493_r == 7 && field_1511_b) {
        GL11.glDrawArrays(4, 0, field_1505_h);
      } else {
        GL11.glDrawArrays(field_1493_r, 0, field_1505_h);
      }
      GL11.glDisableClientState(32884);
      if (field_1500_m) {
        GL11.glDisableClientState(32888);
      }
      if (field_35838_p) {
        OpenGlHelper.func_40451_b(OpenGlHelper.field_40455_b);
        GL11.glDisableClientState(32888);
        OpenGlHelper.func_40451_b(OpenGlHelper.field_40457_a);
      }
      if (field_1501_l) {
        GL11.glDisableClientState(32886);
      }
      if (field_1499_n) {
        GL11.glDisableClientState(32885);
      }
    }
    int i = field_1498_o * 4;
    func_985_d();
    return i;
  }
Ejemplo n.º 5
0
 public Tessellator getSubTessellator(int i) {
   Tessellator tessellator = getSubTessellatorImpl(i);
   if (!tessellator.field_1488_w) {
     tessellator.func_992_a(field_1493_r);
   }
   tessellator.field_35837_l = field_35837_l;
   tessellator.field_35838_p = field_35838_p;
   tessellator.field_1502_k = field_1502_k;
   tessellator.field_1501_l = field_1501_l;
   tessellator.field_1489_v = field_1489_v;
   tessellator.field_1499_n = field_1499_n;
   tessellator.renderingChunk = renderingChunk;
   tessellator.defaultTexture = false;
   tessellator.field_1492_s = field_1492_s;
   tessellator.field_1491_t = field_1491_t;
   tessellator.field_1490_u = field_1490_u;
   return tessellator;
 }
Ejemplo n.º 6
0
  private void displayDebugInfo(long l) {
    long l1 = 0xfe502aL;
    if (prevFrameTime == -1L) {
      prevFrameTime = System.nanoTime();
    }
    long l2 = System.nanoTime();
    tickTimes[numRecordedFrameTimes & frameTimes.length - 1] = l;
    frameTimes[numRecordedFrameTimes++ & frameTimes.length - 1] = l2 - prevFrameTime;
    prevFrameTime = l2;
    GL11.glClear(256);
    GL11.glMatrixMode(5889 /*GL_PROJECTION*/);
    GL11.glLoadIdentity();
    GL11.glOrtho(0.0D, displayWidth, displayHeight, 0.0D, 1000D, 3000D);
    GL11.glMatrixMode(5888 /*GL_MODELVIEW0_ARB*/);
    GL11.glLoadIdentity();
    GL11.glTranslatef(0.0F, 0.0F, -2000F);
    GL11.glLineWidth(1.0F);
    GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawing(7);
    int i = (int) (l1 / 0x30d40L);
    tessellator.setColorOpaque_I(0x20000000);
    tessellator.addVertex(0.0D, displayHeight - i, 0.0D);
    tessellator.addVertex(0.0D, displayHeight, 0.0D);
    tessellator.addVertex(frameTimes.length, displayHeight, 0.0D);
    tessellator.addVertex(frameTimes.length, displayHeight - i, 0.0D);
    tessellator.setColorOpaque_I(0x20200000);
    tessellator.addVertex(0.0D, displayHeight - i * 2, 0.0D);
    tessellator.addVertex(0.0D, displayHeight - i, 0.0D);
    tessellator.addVertex(frameTimes.length, displayHeight - i, 0.0D);
    tessellator.addVertex(frameTimes.length, displayHeight - i * 2, 0.0D);
    tessellator.draw();
    long l3 = 0L;
    for (int j = 0; j < frameTimes.length; j++) {
      l3 += frameTimes[j];
    }

    int k = (int) (l3 / 0x30d40L / (long) frameTimes.length);
    tessellator.startDrawing(7);
    tessellator.setColorOpaque_I(0x20400000);
    tessellator.addVertex(0.0D, displayHeight - k, 0.0D);
    tessellator.addVertex(0.0D, displayHeight, 0.0D);
    tessellator.addVertex(frameTimes.length, displayHeight, 0.0D);
    tessellator.addVertex(frameTimes.length, displayHeight - k, 0.0D);
    tessellator.draw();
    tessellator.startDrawing(1);
    for (int i1 = 0; i1 < frameTimes.length; i1++) {
      int j1 = ((i1 - numRecordedFrameTimes & frameTimes.length - 1) * 255) / frameTimes.length;
      int k1 = (j1 * j1) / 255;
      k1 = (k1 * k1) / 255;
      int i2 = (k1 * k1) / 255;
      i2 = (i2 * i2) / 255;
      if (frameTimes[i1] > l1) {
        tessellator.setColorOpaque_I(0xff000000 + k1 * 0x10000);
      } else {
        tessellator.setColorOpaque_I(0xff000000 + k1 * 256);
      }
      long l4 = frameTimes[i1] / 0x30d40L;
      long l5 = tickTimes[i1] / 0x30d40L;
      tessellator.addVertex((float) i1 + 0.5F, (float) ((long) displayHeight - l4) + 0.5F, 0.0D);
      tessellator.addVertex((float) i1 + 0.5F, (float) displayHeight + 0.5F, 0.0D);
      tessellator.setColorOpaque_I(0xff000000 + k1 * 0x10000 + k1 * 256 + k1 * 1);
      tessellator.addVertex((float) i1 + 0.5F, (float) ((long) displayHeight - l4) + 0.5F, 0.0D);
      tessellator.addVertex(
          (float) i1 + 0.5F, (float) ((long) displayHeight - (l4 - l5)) + 0.5F, 0.0D);
    }

    tessellator.draw();
    GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
  }