Beispiel #1
0
  public int func_82772_a(TextureFX par1TextureFX, int par2) {
    // Spout HD Start
    this.imageData = TextureUtils.getByteBuffer(this.imageData, par1TextureFX.imageData);
    // Spout HD End

    if (par1TextureFX.iconIndex != par2) {
      par1TextureFX.bindImage(this);
      par2 = par1TextureFX.iconIndex;
    }

    for (int var3 = 0; var3 < par1TextureFX.tileSize; ++var3) {
      for (int var4 = 0; var4 < par1TextureFX.tileSize; ++var4) {
        GL11.glTexSubImage2D(
            GL11.GL_TEXTURE_2D,
            0,
            par1TextureFX.iconIndex % 16 * 16 + var3 * 16,
            par1TextureFX.iconIndex / 16 * 16 + var4 * 16,
            16,
            16,
            GL11.GL_RGBA,
            GL11.GL_UNSIGNED_BYTE,
            this.imageData);
      }
    }

    return par2;
  }
  public void updateDynamicTextures() {
    int var1 = -1;
    Iterator var2 = this.textureList.iterator();

    while (var2.hasNext()) {
      TextureFX var3 = (TextureFX) var2.next();
      var3.anaglyphEnabled = this.options.anaglyph;
      var3.onTick();
      this.imageData.clear();
      this.imageData.put(var3.imageData);
      this.imageData.position(0).limit(var3.imageData.length);

      if (var3.iconIndex != var1) {
        var3.bindImage(this);
        var1 = var3.iconIndex;
      }

      for (int var4 = 0; var4 < var3.tileSize; ++var4) {
        for (int var5 = 0; var5 < var3.tileSize; ++var5) {
          GL11.glTexSubImage2D(
              GL11.GL_TEXTURE_2D,
              0,
              var3.iconIndex % 16 * 16 + var4 * 16,
              var3.iconIndex / 16 * 16 + var5 * 16,
              16,
              16,
              GL11.GL_RGBA,
              GL11.GL_UNSIGNED_BYTE,
              this.imageData);
        }
      }
    }
  }