Caching textures for more efficiency

This commit is contained in:
GotoLink 2013-10-28 20:40:54 +01:00
commit e8c86a8c92
7 changed files with 33 additions and 25 deletions

View file

@ -1,5 +1,6 @@
package mysticworld.client.fx;
import mysticworld.client.ClientProxy;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
@ -10,6 +11,8 @@ import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
public class PowerWaterFX extends EntityFX {
public static final ResourceLocation waterFX = new ResourceLocation("mysticmods", "textures/misc/waterFX.png");
public PowerWaterFX(World world, double x, double y, double z) {
super(world, x, y, z);
}
@ -60,7 +63,7 @@ public class PowerWaterFX extends EntityFX {
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/waterFX.png"));
FMLClientHandler.instance().getClient().renderEngine.bindTexture(waterFX);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F);
float scale = 0.1F * this.particleScale;
float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX);
@ -77,7 +80,7 @@ public class PowerWaterFX extends EntityFX {
GL11.glDisable(3042);
GL11.glDepthMask(true);
GL11.glPopMatrix();
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("minecraft:textures" + "/particle/particles.png"));
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particle);
tessellator.startDrawingQuads();
}
}