mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 01:55:06 +00:00
Fix missing import. Thanks ichun :(
This commit is contained in:
1 parent
19316a0d38
commit
a2c059e562
1 file changed
+16
-14
@@ -18,11 +18,13 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.awt.image.ImageObserver;
|
import java.awt.image.ImageObserver;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
import cpw.mods.fml.client.FMLTextureFX;
|
import cpw.mods.fml.client.FMLTextureFX;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A texture override for animations, it takes a vertical image of
|
* A texture override for animations, it takes a vertical image of
|
||||||
* texture frames and constantly rotates them in the texture.
|
* texture frames and constantly rotates them in the texture.
|
||||||
*/
|
*/
|
||||||
public class ModTextureAnimation extends FMLTextureFX
|
public class ModTextureAnimation extends FMLTextureFX
|
||||||
@@ -31,45 +33,45 @@ public class ModTextureAnimation extends FMLTextureFX
|
|||||||
private byte[][] images;
|
private byte[][] images;
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
private int ticks = 0;
|
private int ticks = 0;
|
||||||
|
|
||||||
private String targetTex = null;
|
private String targetTex = null;
|
||||||
private BufferedImage imgData = null;
|
private BufferedImage imgData = null;
|
||||||
|
|
||||||
public ModTextureAnimation(int icon, int target, BufferedImage image, int tickCount)
|
public ModTextureAnimation(int icon, int target, BufferedImage image, int tickCount)
|
||||||
{
|
{
|
||||||
this(icon, 1, target, image, tickCount);
|
this(icon, 1, target, image, tickCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModTextureAnimation(int icon, int size, int target, BufferedImage image, int tickCount)
|
public ModTextureAnimation(int icon, int size, int target, BufferedImage image, int tickCount)
|
||||||
{
|
{
|
||||||
this(icon, size, (target == 0 ? "/terrain.png" : "/gui/items.png"), image, tickCount);
|
this(icon, size, (target == 0 ? "/terrain.png" : "/gui/items.png"), image, tickCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModTextureAnimation(int icon, int size, String target, BufferedImage image, int tickCount)
|
public ModTextureAnimation(int icon, int size, String target, BufferedImage image, int tickCount)
|
||||||
{
|
{
|
||||||
super(icon);
|
super(icon);
|
||||||
RenderEngine re = FMLClientHandler.instance().getClient().field_71446_o;
|
RenderEngine re = FMLClientHandler.instance().getClient().field_71446_o;
|
||||||
|
|
||||||
targetTex = target;
|
targetTex = target;
|
||||||
field_76849_e = size;
|
field_76849_e = size;
|
||||||
field_76847_f = re.func_78341_b(target);
|
field_76847_f = re.func_78341_b(target);
|
||||||
|
|
||||||
tickRate = tickCount;
|
tickRate = tickCount;
|
||||||
ticks = tickCount;
|
ticks = tickCount;
|
||||||
imgData = image;
|
imgData = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup()
|
public void setup()
|
||||||
{
|
{
|
||||||
super.setup();
|
super.setup();
|
||||||
|
|
||||||
int sWidth = imgData.getWidth();
|
int sWidth = imgData.getWidth();
|
||||||
int sHeight = imgData.getHeight();
|
int sHeight = imgData.getHeight();
|
||||||
int tWidth = tileSizeBase;
|
int tWidth = tileSizeBase;
|
||||||
int tHeight = tileSizeBase;
|
int tHeight = tileSizeBase;
|
||||||
|
|
||||||
|
|
||||||
int frames = (int)Math.floor((double)(sHeight / sWidth));
|
int frames = (int)Math.floor((double)(sHeight / sWidth));
|
||||||
|
|
||||||
if (frames < 1)
|
if (frames < 1)
|
||||||
@@ -80,7 +82,7 @@ public class ModTextureAnimation extends FMLTextureFX
|
|||||||
{
|
{
|
||||||
images = new byte[frames][];
|
images = new byte[frames][];
|
||||||
BufferedImage image = imgData;
|
BufferedImage image = imgData;
|
||||||
|
|
||||||
if (sWidth != tWidth)
|
if (sWidth != tWidth)
|
||||||
{
|
{
|
||||||
BufferedImage b = new BufferedImage(tWidth, tHeight * frames, 6);
|
BufferedImage b = new BufferedImage(tWidth, tHeight * frames, 6);
|
||||||
@@ -107,7 +109,7 @@ public class ModTextureAnimation extends FMLTextureFX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_76846_a()
|
public void func_76846_a()
|
||||||
{
|
{
|
||||||
if (++ticks >= tickRate)
|
if (++ticks >= tickRate)
|
||||||
@@ -121,7 +123,7 @@ public class ModTextureAnimation extends FMLTextureFX
|
|||||||
ticks = 0;
|
ticks = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void func_76845_a(RenderEngine renderEngine)
|
public void func_76845_a(RenderEngine renderEngine)
|
||||||
{
|
{
|
||||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, field_76847_f);
|
GL11.glBindTexture(GL11.GL_TEXTURE_2D, field_76847_f);
|
||||||
|
|||||||
Reference in new issue
Block a user