Initial Commit

This commit is contained in:
Chicken Bones committed 2013-07-16 17:58:02 +10:00
1 parent 397135f687
commit 0f32dd8620
82 files changed
+10693

No files matched your search

@@ -0,0 +1,38 @@
package codechicken.lib.render;
import java.awt.image.BufferedImage;
public class TextureDataHolder
{
public int width;
public int height;
public int[] data;
public TextureDataHolder(int width, int height)
{
this.width = width;
this.height = height;
data = new int[width*height];
}
public TextureDataHolder(int[] data, int width)
{
this.data = data;
this.width = width;
height = data.length/width;
}
public TextureDataHolder(BufferedImage img)
{
this(img.getWidth(), img.getHeight());
img.getRGB(0, 0, width, height, data, 0, width);
}
public TextureDataHolder copyData()
{
int[] copy = new int[data.length];
System.arraycopy(data, 0, copy, 0, data.length);
data = copy;
return this;
}
}