Change texturebinding to use the textureId directly rather than iconIndex

to determine if it needs to rebind the texture sheet
This commit is contained in:
Christian 2012-11-18 08:45:25 -05:00
parent 0340719ca2
commit 8025bf3a2c
2 changed files with 10 additions and 9 deletions

View file

@ -159,15 +159,11 @@ public class TextureFXManager
}
int old = GL11.glGetInteger(GL_TEXTURE_BINDING_2D);
effect.func_76845_a(client.field_71446_o);
id = GL11.glGetInteger(GL_TEXTURE_BINDING_2D);
GL11.glBindTexture(GL_TEXTURE_2D, old);
effectTextures.put(effect, id);
effect.field_76848_d = id;
return id;
}

View file

@ -59,7 +59,7 @@
this.field_78367_h.add(p_78355_1_);
p_78355_1_.func_76846_a();
}
@@ -417,16 +428,30 @@
@@ -417,28 +428,44 @@
{
TextureFX var3 = (TextureFX)this.field_78367_h.get(var2);
var3.field_76851_c = this.field_78365_j.field_74337_g;
@ -77,6 +77,8 @@
- this.field_78358_g.clear();
- this.field_78358_g.put(p_82772_1_.field_76852_a);
- this.field_78358_g.position(0).limit(p_82772_1_.field_76852_a.length);
-
- if (p_82772_1_.field_76850_b != p_82772_2_)
+ Dimension dim = TextureFXManager.instance().getTextureDimensions(p_82772_1_);
+ int tWidth = dim.width >> 4;
+ int tHeight = dim.height >> 4;
@ -92,10 +94,13 @@
+ {
+ TextureFXManager.instance().scaleTextureFXData(p_82772_1_.field_76852_a, field_78358_g, tWidth, tLen);
+ }
if (p_82772_1_.field_76850_b != p_82772_2_)
+
+ if (p_82772_1_.field_76848_d != p_82772_2_)
{
@@ -436,9 +461,11 @@
p_82772_1_.func_76845_a(this);
- p_82772_2_ = p_82772_1_.field_76850_b;
+ p_82772_2_ = p_82772_1_.field_76848_d;
}
for (int var3 = 0; var3 < p_82772_1_.field_76849_e; ++var3)
{