{"version":3,"file":"BatchableSprite.mjs","sources":["../../../src/scene/sprite/BatchableSprite.ts"],"sourcesContent":["import { type GPUData } from '../view/ViewContainer';\n\nimport type { Matrix } from '../../maths/matrix/Matrix';\nimport type { Batch, Batcher } from '../../rendering/batcher/shared/Batcher';\nimport type { DefaultBatchableQuadElement } from '../../rendering/batcher/shared/DefaultBatcher';\nimport type { Topology } from '../../rendering/renderers/shared/geometry/const';\nimport type { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport type { BoundsData } from '../container/bounds/Bounds';\nimport type { Container } from '../container/Container';\n\n/**\n * A batchable sprite object.\n * @internal\n */\nexport class BatchableSprite implements DefaultBatchableQuadElement, GPUData\n{\n    public batcherName = 'default';\n    public topology: Topology = 'triangle-list';\n\n    // batch specific..\n    public readonly attributeSize = 4;\n    public readonly indexSize = 6;\n    public readonly packAsQuad = true;\n\n    public transform: Matrix;\n\n    public renderable: Container;\n    public texture: Texture;\n    public bounds: BoundsData;\n\n    public roundPixels: 0 | 1 = 0;\n\n    public _indexStart: number;\n    public _textureId: number;\n    public _attributeStart = 0; // location in the buffer\n    public _batcher: Batcher = null;\n    public _batch: Batch = null;\n\n    get blendMode() { return this.renderable.groupBlendMode; }\n    get color() { return this.renderable.groupColorAlpha; }\n\n    public reset()\n    {\n        this.renderable = null;\n        this.texture = null;\n        this._batcher = null;\n        this._batch = null;\n        this.bounds = null;\n    }\n\n    public destroy()\n    {\n        this.reset();\n    }\n}\n"],"names":[],"mappings":";AAcO,MAAM,eAAA,CACb;AAAA,EADO,WAAA,GAAA;AAEH,IAAA,IAAA,CAAO,WAAA,GAAc,SAAA;AACrB,IAAA,IAAA,CAAO,QAAA,GAAqB,eAAA;AAG5B;AAAA,IAAA,IAAA,CAAgB,aAAA,GAAgB,CAAA;AAChC,IAAA,IAAA,CAAgB,SAAA,GAAY,CAAA;AAC5B,IAAA,IAAA,CAAgB,UAAA,GAAa,IAAA;AAQ7B,IAAA,IAAA,CAAO,WAAA,GAAqB,CAAA;AAI5B,IAAA,IAAA,CAAO,eAAA,GAAkB,CAAA;AACzB;AAAA,IAAA,IAAA,CAAO,QAAA,GAAoB,IAAA;AAC3B,IAAA,IAAA,CAAO,MAAA,GAAgB,IAAA;AAAA,EAAA;AAAA,EAEvB,IAAI,SAAA,GAAY;AAAE,IAAA,OAAO,KAAK,UAAA,CAAW,cAAA;AAAA,EAAgB;AAAA,EACzD,IAAI,KAAA,GAAQ;AAAE,IAAA,OAAO,KAAK,UAAA,CAAW,eAAA;AAAA,EAAiB;AAAA,EAE/C,KAAA,GACP;AACI,IAAA,IAAA,CAAK,UAAA,GAAa,IAAA;AAClB,IAAA,IAAA,CAAK,OAAA,GAAU,IAAA;AACf,IAAA,IAAA,CAAK,QAAA,GAAW,IAAA;AAChB,IAAA,IAAA,CAAK,MAAA,GAAS,IAAA;AACd,IAAA,IAAA,CAAK,MAAA,GAAS,IAAA;AAAA,EAClB;AAAA,EAEO,OAAA,GACP;AACI,IAAA,IAAA,CAAK,KAAA,EAAM;AAAA,EACf;AACJ;;;;"}