more work on TextureAtlas
This commit is contained in:
parent
8d96aacf3f
commit
cd1b7e518a
@ -59,11 +59,27 @@
|
|||||||
*/
|
*/
|
||||||
package org.oscim.renderer.sublayers;
|
package org.oscim.renderer.sublayers;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.oscim.utils.pool.Inlist;
|
import org.oscim.utils.pool.Inlist;
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
|
||||||
public class TextureAtlas {
|
public class TextureAtlas{
|
||||||
|
|
||||||
|
public static class SpriteManager{
|
||||||
|
TextureAtlas atlas;
|
||||||
|
HashMap<Object, Rect> items;
|
||||||
|
|
||||||
|
public Rect getRegion(Object item){
|
||||||
|
return items.get(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Rect addItem(int width, int height){
|
||||||
|
return atlas.getRegion(width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Allocated slots */
|
/** Allocated slots */
|
||||||
public Slot mSlots;
|
public Slot mSlots;
|
||||||
private Rect mRects;
|
private Rect mRects;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user