Ejemplo n.º 1
0
 public Tessellator(int p_i52_1_) {
   renderingChunk = false;
   defaultTexture = true;
   autoGrow = true;
   subTessellators = new Tessellator[0];
   subTextures = new int[0];
   terrainTexture = 0;
   textureUpdateTime = 0L;
   field_1505_h = 0;
   field_1501_l = false;
   field_1500_m = false;
   field_35838_p = false;
   field_1499_n = false;
   field_1498_o = 0;
   field_1497_p = 0;
   field_1495_q = false;
   field_1488_w = false;
   field_1487_x = false;
   field_1485_z = 0;
   field_1496_A = 10;
   field_1494_B = p_i52_1_;
   field_1509_d = GLAllocation.func_1127_b(p_i52_1_ * 4);
   field_1508_e = field_1509_d.asIntBuffer();
   field_1507_f = field_1509_d.asFloatBuffer();
   field_35836_g = field_1509_d.asShortBuffer();
   field_1506_g = new int[p_i52_1_];
   field_1487_x = field_1510_c && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
   if (field_1487_x) {
     field_1486_y = GLAllocation.func_1125_c(field_1496_A);
     ARBVertexBufferObject.glGenBuffersARB(field_1486_y);
   }
 }
Ejemplo n.º 2
0
  Tessellator(int par1) {
    vertexCount = 0;
    hasColor = false;
    hasTexture = false;
    hasBrightness = false;
    hasNormals = false;
    rawBufferIndex = 0;
    addedVertices = 0;
    isColorDisabled = false;
    isDrawing = false;
    useVBO = false;
    vboIndex = 0;
    vboCount = 10;
    bufferSize = par1;
    byteBuffer = GLAllocation.createDirectByteBuffer(par1 * 4);
    intBuffer = byteBuffer.asIntBuffer();
    floatBuffer = byteBuffer.asFloatBuffer();
    shortBuffer = byteBuffer.asShortBuffer();
    rawBuffer = new int[par1];
    useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;

    if (useVBO) {
      vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount);
      ARBVertexBufferObject.glGenBuffersARB(vertexBuffers);
    }
  }
Ejemplo n.º 3
0
 public void func_991_a(double p_991_1_, double p_991_3_, double p_991_5_) {
   if (autoGrow && field_1498_o >= field_1494_B - 32) {
     Config.dbg(
         (new StringBuilder())
             .append("Expand tessellator buffer, old: ")
             .append(field_1494_B)
             .append(", new: ")
             .append(field_1494_B * 2)
             .toString());
     field_1494_B *= 2;
     int ai[] = new int[field_1494_B];
     System.arraycopy(field_1506_g, 0, ai, 0, field_1506_g.length);
     field_1506_g = ai;
     field_1509_d = GLAllocation.func_1127_b(field_1494_B * 4);
     field_1508_e = field_1509_d.asIntBuffer();
     field_1507_f = field_1509_d.asFloatBuffer();
     field_35836_g = field_1509_d.asShortBuffer();
   }
   field_1497_p++;
   if (field_1493_r == 7 && field_1511_b && field_1497_p % 4 == 0) {
     for (int i = 0; i < 2; i++) {
       int j = 8 * (3 - i);
       if (field_1500_m) {
         field_1506_g[field_1498_o + 3] = field_1506_g[(field_1498_o - j) + 3];
         field_1506_g[field_1498_o + 4] = field_1506_g[(field_1498_o - j) + 4];
       }
       if (field_35838_p) {
         field_1506_g[field_1498_o + 7] = field_1506_g[(field_1498_o - j) + 7];
       }
       if (field_1501_l) {
         field_1506_g[field_1498_o + 5] = field_1506_g[(field_1498_o - j) + 5];
       }
       field_1506_g[field_1498_o + 0] = field_1506_g[(field_1498_o - j) + 0];
       field_1506_g[field_1498_o + 1] = field_1506_g[(field_1498_o - j) + 1];
       field_1506_g[field_1498_o + 2] = field_1506_g[(field_1498_o - j) + 2];
       field_1505_h++;
       field_1498_o += 8;
     }
   }
   if (field_1500_m) {
     field_1506_g[field_1498_o + 3] = Float.floatToRawIntBits((float) field_1504_i);
     field_1506_g[field_1498_o + 4] = Float.floatToRawIntBits((float) field_1503_j);
   }
   if (field_35838_p) {
     field_1506_g[field_1498_o + 7] = field_35837_l;
   }
   if (field_1501_l) {
     field_1506_g[field_1498_o + 5] = field_1502_k;
   }
   if (field_1499_n) {
     field_1506_g[field_1498_o + 6] = field_1489_v;
   }
   field_1506_g[field_1498_o + 0] = Float.floatToRawIntBits((float) (p_991_1_ + field_1492_s));
   field_1506_g[field_1498_o + 1] = Float.floatToRawIntBits((float) (p_991_3_ + field_1491_t));
   field_1506_g[field_1498_o + 2] = Float.floatToRawIntBits((float) (p_991_5_ + field_1490_u));
   field_1498_o += 8;
   field_1505_h++;
   if (!autoGrow && field_1497_p % 4 == 0 && field_1498_o >= field_1494_B - 32) {
     func_982_a();
     field_1488_w = true;
   }
 }