Rogue: Savage Rats, a retro-themed dungeon crawler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rogue-savage-rats/src/mightypork/gamecore/resources/textures/LazyTexture.java

57 lines
1.0 KiB

package mightypork.gamecore.resources.textures;
import mightypork.gamecore.resources.BaseLazyResource;
import mightypork.gamecore.resources.TextureBasedResource;
import mightypork.utils.annotations.Alias;
import mightypork.utils.math.constraints.rect.Rect;
/**
* Deferred texture (to be extended by backend texture)
*
* @author Ondřej Hruška (MightyPork)
*/
@Alias(name = "Texture")
@TextureBasedResource
public abstract class LazyTexture extends BaseLazyResource implements ITexture {
protected FilterMode filter = FilterMode.NEAREST;
protected WrapMode wrap = WrapMode.CLAMP;
/**
* @param resourcePath resource path
*/
public LazyTexture(String resourcePath) {
super(resourcePath);
}
@Override
public TxQuad makeQuad(Rect uvs)
{
return new TxQuad(this, uvs);
}
@Override
public void setFilter(FilterMode filterMin)
{
this.filter = filterMin;
}
@Override
public void setWrap(WrapMode wrapping)
{
this.wrap = wrapping;
}
@Override
public QuadGrid grid(int x, int y)
{
return new QuadGrid(this, x, y);
}
}