Caching textures for more efficiency
This commit is contained in:
parent
d4b71af9cb
commit
e8c86a8c92
7 changed files with 33 additions and 25 deletions
|
|
@ -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 LightCubeFX extends EntityFX {
|
||||
public static final ResourceLocation lightFX = new ResourceLocation("mysticmods", "textures/misc/lightCubeFX.png");
|
||||
|
||||
public LightCubeFX(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
|
@ -60,7 +63,7 @@ public class LightCubeFX extends EntityFX {
|
|||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 1);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("MysticMods:textures" + "/misc/lightCubeFX.png"));
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(lightFX);
|
||||
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 LightCubeFX 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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue