package org.anddev.andengine.opengl.texture.atlas.bitmap; import org.anddev.andengine.opengl.texture.TextureOptions; import org.anddev.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource; import org.anddev.andengine.opengl.texture.atlas.buildable.BuildableTextureAtlas; import org.anddev.andengine.opengl.texture.bitmap.BitmapTexture.BitmapTextureFormat; import org.anddev.andengine.opengl.texture.source.ITextureAtlasSource; /** * (c) 2010 Nicolas Gramlich * (c) 2011 Zynga Inc. * * @author Nicolas Gramlich * @since 15:51:46 - 12.07.2011 */ public class BuildableBitmapTextureAtlas extends BuildableTextureAtlas<IBitmapTextureAtlasSource, BitmapTextureAtlas> { // =========================================================== // Constants // =========================================================== // =========================================================== // Fields // =========================================================== // =========================================================== // Constructors // =========================================================== /** * Uses {@link BitmapTextureFormat#RGBA_8888}. * * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). */ public BuildableBitmapTextureAtlas(final int pWidth, final int pHeight) { this(pWidth, pHeight, BitmapTextureFormat.RGBA_8888); } /** * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pBitmapTextureFormat use {@link BitmapTextureFormat#RGBA_8888} for {@link BitmapTextureAtlas}MAGIC_CONSTANT with transparency and {@link BitmapTextureFormat#RGB_565} for {@link BitmapTextureAtlas}MAGIC_CONSTANT without transparency. */ public BuildableBitmapTextureAtlas(final int pWidth, final int pHeight, final BitmapTextureFormat pBitmapTextureFormat) { this(pWidth, pHeight, pBitmapTextureFormat, TextureOptions.DEFAULT, null); } /** * Uses {@link BitmapTextureFormat#RGBA_8888}. * * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pTextureStateListener to be informed when this {@link BitmapTextureAtlas} is loaded, unloaded or a {@link ITextureAtlasSource} failed to load. */ public BuildableBitmapTextureAtlas(final int pWidth, final int pHeight, final ITextureAtlasStateListener<IBitmapTextureAtlasSource> pTextureStateListener) { this(pWidth, pHeight, BitmapTextureFormat.RGBA_8888, TextureOptions.DEFAULT, pTextureStateListener); } /** * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pBitmapTextureFormat use {@link BitmapTextureFormat#RGBA_8888} for {@link BitmapTextureAtlas}MAGIC_CONSTANT with transparency and {@link BitmapTextureFormat#RGB_565} for {@link BitmapTextureAtlas}MAGIC_CONSTANT without transparency. * @param pTextureStateListener to be informed when this {@link BitmapTextureAtlas} is loaded, unloaded or a {@link ITextureAtlasSource} failed to load. */ public BuildableBitmapTextureAtlas(final int pWidth, final int pHeight, final BitmapTextureFormat pBitmapTextureFormat, final ITextureAtlasStateListener<IBitmapTextureAtlasSource> pTextureStateListener) { this(pWidth, pHeight, pBitmapTextureFormat, TextureOptions.DEFAULT, pTextureStateListener); } /** * Uses {@link BitmapTextureFormat#RGBA_8888}. * * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pTextureOptions the (quality) settings of the BitmapTexture. */ public BuildableBitmapTextureAtlas(final int pWidth, final int pHeight, final TextureOptions pTextureOptions) throws IllegalArgumentException { this(pWidth, pHeight, BitmapTextureFormat.RGBA_8888, pTextureOptions, null); } /** * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pBitmapTextureFormat use {@link BitmapTextureFormat#RGBA_8888} for {@link BitmapTextureAtlas}MAGIC_CONSTANT with transparency and {@link BitmapTextureFormat#RGB_565} for {@link BitmapTextureAtlas}MAGIC_CONSTANT without transparency. * @param pTextureOptions the (quality) settings of the BitmapTexture. */ public BuildableBitmapTextureAtlas(final int pWidth, final int pHeight, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions) throws IllegalArgumentException { this(pWidth, pHeight, pBitmapTextureFormat, pTextureOptions, null); } /** * Uses {@link BitmapTextureFormat#RGBA_8888}. * * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pTextureOptions the (quality) settings of the BitmapTexture. * @param pTextureStateListener to be informed when this {@link BitmapTextureAtlas} is loaded, unloaded or a {@link ITextureAtlasSource} failed to load. */ public BuildableBitmapTextureAtlas(final int pWidth, final int pHeight, final TextureOptions pTextureOptions, final ITextureAtlasStateListener<IBitmapTextureAtlasSource> pTextureStateListener) throws IllegalArgumentException { this(pWidth, pHeight, BitmapTextureFormat.RGBA_8888, pTextureOptions, pTextureStateListener); } /** * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024). * @param pBitmapTextureFormat use {@link BitmapTextureFormat#RGBA_8888} for {@link BitmapTextureAtlas}MAGIC_CONSTANT with transparency and {@link BitmapTextureFormat#RGB_565} for {@link BitmapTextureAtlas}MAGIC_CONSTANT without transparency. * @param pTextureOptions the (quality) settings of the BitmapTexture. * @param pTextureStateListener to be informed when this {@link BitmapTextureAtlas} is loaded, unloaded or a {@link ITextureAtlasSource} failed to load. */ public BuildableBitmapTextureAtlas(final int pWidth, final int pHeight, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions, final ITextureAtlasStateListener<IBitmapTextureAtlasSource> pTextureStateListener) throws IllegalArgumentException { super(new BitmapTextureAtlas(pWidth, pHeight, pBitmapTextureFormat, pTextureOptions, pTextureStateListener)); } // =========================================================== // Getter & Setter // =========================================================== // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== // =========================================================== // Methods // =========================================================== // =========================================================== // Inner and Anonymous Classes // =========================================================== }