/*! * @pixi/particle-container - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * * @pixi/particle-container is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ this.PIXI=this.PIXI||{};var _pixi_particle_container=function(t,e,i,r,o,a){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},n(t,e)};function s(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var u=function(t){function i(i,r,o,a){void 0===i&&(i=1500),void 0===o&&(o=16384),void 0===a&&(a=!1);var n=t.call(this)||this;return o>16384&&(o=16384),n._properties=[!1,!0,!1,!1,!1],n._maxSize=i,n._batchSize=o,n._buffers=null,n._bufferUpdateIDs=[],n._updateID=0,n.interactiveChildren=!1,n.blendMode=e.BLEND_MODES.NORMAL,n.autoResize=a,n.roundPixels=!0,n.baseTexture=null,n.setProperties(r),n._tint=0,n.tintRgb=new Float32Array(4),n.tint=16777215,n}return s(i,t),i.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},i.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(i.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,r.hex2rgb(t,this.tintRgb)},enumerable:!1,configurable:!0}),i.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},i.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthi&&!t.autoResize&&(n=i);var s=t._buffers;s||(s=t._buffers=this.generateBuffers(t));var u=e[0]._texture.baseTexture,h=u.alphaMode>0;this.state.blendMode=r.correctBlendMode(t.blendMode,h),a.state.set(this.state);var p=a.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(a.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=r.premultiplyRgba(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h),this.shader.uniforms.uSampler=u,this.renderer.shader.bind(this.shader);for(var f=!1,l=0,d=0;lo&&(y=o),d>=s.length&&s.push(this._generateOneMoreBuffer(t));var v=s[d];v.uploadDynamic(e,l,y);var _=t._bufferUpdateIDs[d]||0;(f=f||v._updateID<_)&&(v._updateID=t._updateID,v.uploadStatic(e,l,y)),a.geometry.bind(v.geometry),p.drawElements(p.TRIANGLES,6*y,p.UNSIGNED_SHORT,0)}}},i.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,r=t._batchSize,o=t._properties,a=0;a0,p=u.alpha,c=p<1&&h?r.premultiplyTint(u._tintRGB,p):u._tintRGB+(255*p<<24);o[n]=c,o[n+a]=c,o[n+2*a]=c,o[n+3*a]=c,n+=4*a}},i.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},i.extension={name:"particle",type:o.ExtensionType.RendererPlugin},i}(o.ObjectRenderer);return t.ParticleContainer=u,t.ParticleRenderer=p,Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI,PIXI,PIXI.utils,PIXI,PIXI);Object.assign(this.PIXI,_pixi_particle_container); //# sourceMappingURL=particle-container.min.js.map