Files
MinecraftForge/patches/minecraft/net/minecraft/client/renderer/RenderEngine.java.patch
T
2013-03-09 12:10:13 -05:00

112 lines
4.3 KiB
Diff

--- ../src-base/minecraft/net/minecraft/client/renderer/RenderEngine.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderEngine.java
@@ -1,8 +1,11 @@
package net.minecraft.client.renderer;
+import cpw.mods.fml.client.TextureFXManager;
+import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.awt.Color;
+import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -11,6 +14,9 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
import javax.imageio.ImageIO;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
@@ -37,6 +43,8 @@
private final TextureMap field_94155_m;
private int field_94153_n;
+ public static Logger log = FMLLog.getLogger();
+
public RenderEngine(TexturePackList p_i3192_1_, GameSettings p_i3192_2_)
{
this.field_78366_k = p_i3192_1_;
@@ -87,14 +95,17 @@
}
else
{
- aint1 = this.func_78348_b(this.func_78345_a(inputstream));
+ BufferedImage bufferedimage = this.func_78345_a(inputstream);
+ TextureFXManager.instance().fixTransparency(bufferedimage, p_78346_1_);
+ aint1 = this.func_78348_b(bufferedimage);
}
this.field_78359_d.put(p_78346_1_, aint1);
return aint1;
}
- catch (IOException ioexception)
- {
+ catch (Exception ioexception)
+ {
+ log.log(Level.INFO, String.format("An error occured reading texture file %s (getTexture)", p_78346_1_), ioexception);
ioexception.printStackTrace();
int[] aint2 = this.func_78348_b(this.field_78364_l);
this.field_78359_d.put(p_78346_1_, aint2);
@@ -162,6 +173,7 @@
try
{
int i = GLAllocation.func_74528_a();
+ TextureFXManager.instance().bindTextureToName(p_78341_1_, i);
boolean flag = p_78341_1_.startsWith("%blur%");
if (flag)
@@ -184,7 +196,9 @@
}
else
{
- this.func_98184_a(this.func_78345_a(inputstream), i, flag, flag1);
+ BufferedImage bufferedimage = this.func_78345_a(inputstream);
+ TextureFXManager.instance().fixTransparency(bufferedimage, p_78341_1_);
+ this.func_98184_a(bufferedimage, i, flag, flag1);
}
this.field_78362_c.put(s1, Integer.valueOf(i));
@@ -240,6 +254,7 @@
int j = p_98184_1_.getWidth();
int k = p_98184_1_.getHeight();
+ TextureFXManager.instance().setTextureDimensions(p_98184_2_, j, k);
int[] aint = new int[j * k];
p_98184_1_.getRGB(0, 0, j, k, aint, 0, j);
@@ -412,10 +427,12 @@
}
BufferedImage bufferedimage1 = this.func_78345_a(itexturepack.func_77532_a(s));
+ TextureFXManager.instance().fixTransparency(bufferedimage1, s);
this.func_98184_a(bufferedimage1, j, flag, flag1);
}
- catch (IOException ioexception)
- {
+ catch (Exception ioexception)
+ {
+ log.log(Level.INFO,String.format("An error occured reading texture file %s (refreshTexture)", s), ioexception);
ioexception.printStackTrace();
}
}
@@ -429,10 +446,12 @@
try
{
bufferedimage = this.func_78345_a(itexturepack.func_77532_a(s));
+ TextureFXManager.instance().fixTransparency(bufferedimage, s);
this.func_78340_a(bufferedimage, (int[])this.field_78359_d.get(s));
}
- catch (IOException ioexception1)
- {
+ catch (Exception ioexception1)
+ {
+ log.log(Level.INFO,String.format("An error occured reading texture file data %s (refreshTexture)", s), ioexception1);
ioexception1.printStackTrace();
}
}