Starling ATF Loader problem

hello,

I’ve ported a showroom app 90% to cpp. amazing!!!

When I am using the Assets Class I can load every content element. But when using the Urloader I have some problems.

inside the Event.COMPLETE listener I have this:

   var byteArray : ByteArray = new ByteArray();
   var loader:URLLoader = cast (e.currentTarget) ;
    byteArray = loader.data; 
    texture_stx = Texture.fromAtfData(byteArray, 1, false);

ok, I can check the size, fine, but I can’t see the texture
and I have this output on the cli:
[openfl._internal.formats.atf.ATFReader] WARNING: Only ATF block compressed textures without JPEG-XR+LZMA are supported

png to ATF is done with: png2atf.exe -c d -r -q 0 -f 0 -i texture.png -o texture.atf

by the way bitmap works:

byteArray = loader.data;
var bmp = new Bitmap(BitmapData.fromBytes(byteArray)); texture_stx = Texture.fromBitmap(bmp, true, false, 1, "bgra", false, null);

when using the Assetmanager I miss the usemipmap property. How can I activate this feature?

The “Only ATF block compressed textures without JPEG-XR+LZMA are supported” message is because we do not have JPEG-XR support on native, and it is not supported by browsers.

I’m not familiar with the png2atf.exe command arguments, but I believe there is a way to encode differently.

starling.utils.AssetManager appears to have the useMipmaps property in the constructor. Is that what you are looking for?

thanks, I got it work with some other settings.

with the new assets.Assetsmanager the mipMapping is activated with. textureOptions.mipMapping = true;

regards

1 Like