package eco;

import org.newdawn.slick.opengl.Texture;

public class TextureAtlas {
	
	public  Texture texture;
	
	public int textureRes = 8;
	public int size = 4;
	
	public TextureAtlas(Texture texture){
		this.texture = texture;
	}
	
	public float getXCoord(int pos, boolean increase){
		int pixelPos = pos * textureRes;
		if (increase){
			pixelPos += textureRes;
		}
		return (float) pixelPos / (float) (textureRes * size);
	}
	
	public float getYCoord(int pos, boolean increase){
		int pixelPos = pos * textureRes;
		if (increase){
			pixelPos += textureRes;
		}
		return (float) pixelPos / (float) (textureRes * size);
	}
	
	public float getCoord(int pos, boolean increase){
		int pixelPos = pos * textureRes;
		if (increase){
			pixelPos += textureRes;
		}
		return (float) pixelPos / (float) (textureRes * size);
	}
	
	public Texture getTexture(){
		return texture;
	}

}
@@ -196,18 +196,19 @@
 texture)
+ 
 %7B%0A
-
 %09%09this.t
@@ -272,32 +272,33 @@
 oolean increase)
+ 
 %7B%0A%09%09int pixelPos
@@ -470,32 +470,33 @@
 oolean increase)
+ 
 %7B%0A%09%09int pixelPos
@@ -671,24 +671,25 @@
 an increase)
+ 
 %7B%0A%09%09int pixe
@@ -851,16 +851,17 @@
 exture()
+ 
 %7B%0A%09%09retu
@@ -876,9 +876,10 @@
 re;%0A%09%7D%0A%0A
-
 %7D
+%0A

Update TextureAtlas.java