v0.9.4: removed unnecessary texture reference in TextureFilm
This commit is contained in:
parent
001c40f15e
commit
72275d240d
|
@ -109,7 +109,7 @@ public class SmartTexture extends Texture {
|
|||
|
||||
public RectF uvRect( float left, float top, float right, float bottom ) {
|
||||
return new RectF(
|
||||
left / width,
|
||||
left / width,
|
||||
top / height,
|
||||
right / width,
|
||||
bottom / height );
|
||||
|
|
|
@ -34,13 +34,11 @@ public class TextureFilm {
|
|||
private int texWidth;
|
||||
private int texHeight;
|
||||
|
||||
private SmartTexture texture;
|
||||
|
||||
protected HashMap<Object,RectF> frames = new HashMap<>();
|
||||
|
||||
public TextureFilm( Object tx ) {
|
||||
|
||||
texture = TextureCache.get( tx );
|
||||
SmartTexture texture = TextureCache.get( tx );
|
||||
|
||||
texWidth = texture.width;
|
||||
texHeight = texture.height;
|
||||
|
@ -54,7 +52,7 @@ public class TextureFilm {
|
|||
|
||||
public TextureFilm( Object tx, int width, int height ) {
|
||||
|
||||
texture = TextureCache.get( tx );
|
||||
SmartTexture texture = TextureCache.get( tx );
|
||||
|
||||
texWidth = texture.width;
|
||||
texHeight = texture.height;
|
||||
|
@ -74,8 +72,6 @@ public class TextureFilm {
|
|||
|
||||
public TextureFilm( TextureFilm atlas, Object key, int width, int height ) {
|
||||
|
||||
texture = atlas.texture;
|
||||
|
||||
texWidth = atlas.texWidth;
|
||||
texHeight = atlas.texHeight;
|
||||
|
||||
|
@ -99,8 +95,13 @@ public class TextureFilm {
|
|||
frames.put( id, rect );
|
||||
}
|
||||
|
||||
public void add( Object id, int left, int top, int right, int bottom){
|
||||
frames.put( id, texture.uvRect(left, top, right, bottom));
|
||||
public void add( Object id, float left, float top, float right, float bottom){
|
||||
frames.put( id,
|
||||
new RectF(
|
||||
left / texWidth,
|
||||
top / texHeight,
|
||||
right / texWidth,
|
||||
bottom / texHeight ));
|
||||
}
|
||||
|
||||
public RectF get( Object id ) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user