import {AssetBase, IAsset, ByteArray} from "@awayjs/core"; import {AWDBlock} from "./AWD3ParserUtils/AWDBlock"; /** * TextureAtlasParser provides a "parser" for natively supported image types (jpg, png). While it simply loads bytes into * a loader object, it wraps it in a BitmapImage2DResource so resource management can happen consistently without * exception cases. */ export class AWDFile extends AssetBase implements AssetBase { public static assetType:string = "[asset AWDFile]"; private _awdBlocks:Array; private _mapIAssetsToID:Object; private _bytes:ByteArray; constructor() { super(); this._awdBlocks=[]; this._mapIAssetsToID={}; // create the metadatablock } public get assetType():string { return AWDFile.assetType; } public get awdBlocks():Array { return this.awdBlocks; } public addAsset(asset:IAsset, dependenciesMode:number=AWDDependenciesMode.ADD_DEPENDENCIES):void { var newAWDBlock:AWDBlock=new AWDBlock(0,0); newAWDBlock.data = asset; this._awdBlocks.push(newAWDBlock); } public getBytes():ByteArray { var bodyLength:number=0; var i:number=0; for (i=0; i